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>
这个提交包含在:
@@ -529,6 +529,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
|
||||
(1ull << IB_USER_VERBS_CMD_DETACH_MCAST) |
|
||||
(1ull << IB_USER_VERBS_CMD_CREATE_SRQ) |
|
||||
(1ull << IB_USER_VERBS_CMD_MODIFY_SRQ) |
|
||||
(1ull << IB_USER_VERBS_CMD_QUERY_SRQ) |
|
||||
(1ull << IB_USER_VERBS_CMD_DESTROY_SRQ);
|
||||
|
||||
ibdev->ib_dev.query_device = mlx4_ib_query_device;
|
||||
@@ -547,6 +548,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
|
||||
ibdev->ib_dev.destroy_ah = mlx4_ib_destroy_ah;
|
||||
ibdev->ib_dev.create_srq = mlx4_ib_create_srq;
|
||||
ibdev->ib_dev.modify_srq = mlx4_ib_modify_srq;
|
||||
ibdev->ib_dev.query_srq = mlx4_ib_query_srq;
|
||||
ibdev->ib_dev.destroy_srq = mlx4_ib_destroy_srq;
|
||||
ibdev->ib_dev.post_srq_recv = mlx4_ib_post_srq_recv;
|
||||
ibdev->ib_dev.create_qp = mlx4_ib_create_qp;
|
||||
|
@@ -256,6 +256,7 @@ struct ib_srq *mlx4_ib_create_srq(struct ib_pd *pd,
|
||||
struct ib_udata *udata);
|
||||
int mlx4_ib_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
|
||||
enum ib_srq_attr_mask attr_mask, struct ib_udata *udata);
|
||||
int mlx4_ib_query_srq(struct ib_srq *srq, struct ib_srq_attr *srq_attr);
|
||||
int mlx4_ib_destroy_srq(struct ib_srq *srq);
|
||||
void mlx4_ib_free_srq_wqe(struct mlx4_ib_srq *srq, int wqe_index);
|
||||
int mlx4_ib_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
|
||||
|
@@ -240,6 +240,24 @@ int mlx4_ib_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mlx4_ib_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr)
|
||||
{
|
||||
struct mlx4_ib_dev *dev = to_mdev(ibsrq->device);
|
||||
struct mlx4_ib_srq *srq = to_msrq(ibsrq);
|
||||
int ret;
|
||||
int limit_watermark;
|
||||
|
||||
ret = mlx4_srq_query(dev->dev, &srq->msrq, &limit_watermark);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
srq_attr->srq_limit = be16_to_cpu(limit_watermark);
|
||||
srq_attr->max_wr = srq->msrq.max - 1;
|
||||
srq_attr->max_sge = srq->msrq.max_gs;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mlx4_ib_destroy_srq(struct ib_srq *srq)
|
||||
{
|
||||
struct mlx4_ib_dev *dev = to_mdev(srq->device);
|
||||
|
在新工单中引用
屏蔽一个用户