aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/srq.c
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2007-06-21 06:03:11 -0400
committerRoland Dreier <rolandd@cisco.com>2007-07-12 18:41:24 -0400
commit65541cb7cf353946ecd78016a453b453b8830656 (patch)
tree0a93ed27fdb6caf3f90250eaaf179b560e6742f3 /drivers/net/mlx4/srq.c
parent6a775e2ba4f7635849ade628e64723ab2beef0bc (diff)
IB/mlx4: Implement query SRQ
Signed-off-by: Dotan Barak <dotanb@mellanox.co.il> Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/net/mlx4/srq.c')
-rw-r--r--drivers/net/mlx4/srq.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/mlx4/srq.c b/drivers/net/mlx4/srq.c
index 2134f83aed87..b061c86d6839 100644
--- a/drivers/net/mlx4/srq.c
+++ b/drivers/net/mlx4/srq.c
@@ -102,6 +102,13 @@ static int mlx4_ARM_SRQ(struct mlx4_dev *dev, int srq_num, int limit_watermark)
102 MLX4_CMD_TIME_CLASS_B); 102 MLX4_CMD_TIME_CLASS_B);
103} 103}
104 104
105static int mlx4_QUERY_SRQ(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox,
106 int srq_num)
107{
108 return mlx4_cmd_box(dev, 0, mailbox->dma, srq_num, 0, MLX4_CMD_QUERY_SRQ,
109 MLX4_CMD_TIME_CLASS_A);
110}
111
105int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, struct mlx4_mtt *mtt, 112int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, struct mlx4_mtt *mtt,
106 u64 db_rec, struct mlx4_srq *srq) 113 u64 db_rec, struct mlx4_srq *srq)
107{ 114{
@@ -205,6 +212,29 @@ int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark
205} 212}
206EXPORT_SYMBOL_GPL(mlx4_srq_arm); 213EXPORT_SYMBOL_GPL(mlx4_srq_arm);
207 214
215int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_watermark)
216{
217 struct mlx4_cmd_mailbox *mailbox;
218 struct mlx4_srq_context *srq_context;
219 int err;
220
221 mailbox = mlx4_alloc_cmd_mailbox(dev);
222 if (IS_ERR(mailbox))
223 return PTR_ERR(mailbox);
224
225 srq_context = mailbox->buf;
226
227 err = mlx4_QUERY_SRQ(dev, mailbox, srq->srqn);
228 if (err)
229 goto err_out;
230 *limit_watermark = srq_context->limit_watermark;
231
232err_out:
233 mlx4_free_cmd_mailbox(dev, mailbox);
234 return err;
235}
236EXPORT_SYMBOL_GPL(mlx4_srq_query);
237
208int __devinit mlx4_init_srq_table(struct mlx4_dev *dev) 238int __devinit mlx4_init_srq_table(struct mlx4_dev *dev)
209{ 239{
210 struct mlx4_srq_table *srq_table = &mlx4_priv(dev)->srq_table; 240 struct mlx4_srq_table *srq_table = &mlx4_priv(dev)->srq_table;