IB/core: Separate CQ handle in SRQ context
Before this change CQ attached to SRQ was part of XRC specific extension. Moving CQ handle out makes it available to other types extending SRQ functionality. Signed-off-by: Artemy Kovalyov <artemyko@mellanox.com> Reviewed-by: Yossi Itigin <yosefe@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
Este cometimento está contido em:

cometido por
Doug Ledford

ascendente
6938fc1ee0
cometimento
1a56ff6daa
@@ -178,8 +178,8 @@ struct ib_srq *mlx4_ib_create_srq(struct ib_pd *pd,
|
||||
}
|
||||
}
|
||||
|
||||
cqn = (init_attr->srq_type == IB_SRQT_XRC) ?
|
||||
to_mcq(init_attr->ext.xrc.cq)->mcq.cqn : 0;
|
||||
cqn = ib_srq_has_cq(init_attr->srq_type) ?
|
||||
to_mcq(init_attr->ext.cq)->mcq.cqn : 0;
|
||||
xrcdn = (init_attr->srq_type == IB_SRQT_XRC) ?
|
||||
to_mxrcd(init_attr->ext.xrc.xrcd)->xrcdn :
|
||||
(u16) dev->dev->caps.reserved_xrcds;
|
||||
|
@@ -3217,7 +3217,7 @@ static int create_dev_resources(struct mlx5_ib_resources *devr)
|
||||
attr.attr.max_sge = 1;
|
||||
attr.attr.max_wr = 1;
|
||||
attr.srq_type = IB_SRQT_XRC;
|
||||
attr.ext.xrc.cq = devr->c0;
|
||||
attr.ext.cq = devr->c0;
|
||||
attr.ext.xrc.xrcd = devr->x0;
|
||||
|
||||
devr->s0 = mlx5_ib_create_srq(devr->p0, &attr, NULL);
|
||||
@@ -3232,9 +3232,9 @@ static int create_dev_resources(struct mlx5_ib_resources *devr)
|
||||
devr->s0->srq_context = NULL;
|
||||
devr->s0->srq_type = IB_SRQT_XRC;
|
||||
devr->s0->ext.xrc.xrcd = devr->x0;
|
||||
devr->s0->ext.xrc.cq = devr->c0;
|
||||
devr->s0->ext.cq = devr->c0;
|
||||
atomic_inc(&devr->s0->ext.xrc.xrcd->usecnt);
|
||||
atomic_inc(&devr->s0->ext.xrc.cq->usecnt);
|
||||
atomic_inc(&devr->s0->ext.cq->usecnt);
|
||||
atomic_inc(&devr->p0->usecnt);
|
||||
atomic_set(&devr->s0->usecnt, 0);
|
||||
|
||||
@@ -3253,9 +3253,9 @@ static int create_dev_resources(struct mlx5_ib_resources *devr)
|
||||
devr->s1->event_handler = NULL;
|
||||
devr->s1->srq_context = NULL;
|
||||
devr->s1->srq_type = IB_SRQT_BASIC;
|
||||
devr->s1->ext.xrc.cq = devr->c0;
|
||||
devr->s1->ext.cq = devr->c0;
|
||||
atomic_inc(&devr->p0->usecnt);
|
||||
atomic_set(&devr->s0->usecnt, 0);
|
||||
atomic_set(&devr->s1->usecnt, 0);
|
||||
|
||||
for (port = 0; port < ARRAY_SIZE(devr->ports); ++port) {
|
||||
INIT_WORK(&devr->ports[port].pkey_change_work,
|
||||
|
@@ -292,13 +292,16 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd,
|
||||
in.wqe_shift = srq->msrq.wqe_shift - 4;
|
||||
if (srq->wq_sig)
|
||||
in.flags |= MLX5_SRQ_FLAG_WQ_SIG;
|
||||
if (init_attr->srq_type == IB_SRQT_XRC) {
|
||||
|
||||
if (init_attr->srq_type == IB_SRQT_XRC)
|
||||
in.xrcd = to_mxrcd(init_attr->ext.xrc.xrcd)->xrcdn;
|
||||
in.cqn = to_mcq(init_attr->ext.xrc.cq)->mcq.cqn;
|
||||
} else if (init_attr->srq_type == IB_SRQT_BASIC) {
|
||||
else
|
||||
in.xrcd = to_mxrcd(dev->devr.x0)->xrcdn;
|
||||
|
||||
if (ib_srq_has_cq(init_attr->srq_type))
|
||||
in.cqn = to_mcq(init_attr->ext.cq)->mcq.cqn;
|
||||
else
|
||||
in.cqn = to_mcq(dev->devr.c0)->mcq.cqn;
|
||||
}
|
||||
|
||||
in.pd = to_mpd(pd)->pdn;
|
||||
in.db_record = srq->db.dma;
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador