Message ID | 20200827141655.406185-1-kamalheib1@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Jason Gunthorpe |
Headers | show |
Series | [for-next] RDMA/qedr: Fix reported max_pkeys | expand |
> From: Kamal Heib <kamalheib1@gmail.com> > Sent: Thursday, August 27, 2020 5:17 PM > > ---------------------------------------------------------------------- > As qedr driver supports both RoCE and iWarp, make sure to set the > max_pkeys only when running in RoCE mode. > > Signed-off-by: Kamal Heib <kamalheib1@gmail.com> > --- > drivers/infiniband/hw/qedr/verbs.c | 2 +- > drivers/net/ethernet/qlogic/qed/qed_rdma.c | 3 ++- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/infiniband/hw/qedr/verbs.c > b/drivers/infiniband/hw/qedr/verbs.c > index 4ce4e2eef6cc..1d1d5628bfc7 100644 > --- a/drivers/infiniband/hw/qedr/verbs.c > +++ b/drivers/infiniband/hw/qedr/verbs.c > @@ -157,7 +157,7 @@ int qedr_query_device(struct ib_device *ibdev, > > attr->local_ca_ack_delay = qattr->dev_ack_delay; > attr->max_fast_reg_page_list_len = qattr->max_mr / 8; > - attr->max_pkeys = QEDR_ROCE_PKEY_MAX; > + attr->max_pkeys = qattr->max_pkey; > attr->max_ah = qattr->max_ah; > > return 0; > diff --git a/drivers/net/ethernet/qlogic/qed/qed_rdma.c > b/drivers/net/ethernet/qlogic/qed/qed_rdma.c > index a4bcde522cdf..03894584415d 100644 > --- a/drivers/net/ethernet/qlogic/qed/qed_rdma.c > +++ b/drivers/net/ethernet/qlogic/qed/qed_rdma.c > @@ -504,7 +504,8 @@ static void qed_rdma_init_devinfo(struct qed_hwfn > *p_hwfn, > dev->max_mw = 0; > dev->max_mr_mw_fmr_pbl = (PAGE_SIZE / 8) * (PAGE_SIZE / 8); > dev->max_mr_mw_fmr_size = dev->max_mr_mw_fmr_pbl * > PAGE_SIZE; > - dev->max_pkey = QED_RDMA_MAX_P_KEY; > + if (QED_IS_ROCE_PERSONALITY(p_hwfn)) > + dev->max_pkey = QED_RDMA_MAX_P_KEY; > > dev->max_srq = p_hwfn->p_rdma_info->num_srqs; > dev->max_srq_wr = QED_RDMA_MAX_SRQ_WQE_ELEM; > -- > 2.26.2 Thanks, Acked-by: Michal Kalderon <michal.kalderon@marvell.com>
diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c index 4ce4e2eef6cc..1d1d5628bfc7 100644 --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c @@ -157,7 +157,7 @@ int qedr_query_device(struct ib_device *ibdev, attr->local_ca_ack_delay = qattr->dev_ack_delay; attr->max_fast_reg_page_list_len = qattr->max_mr / 8; - attr->max_pkeys = QEDR_ROCE_PKEY_MAX; + attr->max_pkeys = qattr->max_pkey; attr->max_ah = qattr->max_ah; return 0; diff --git a/drivers/net/ethernet/qlogic/qed/qed_rdma.c b/drivers/net/ethernet/qlogic/qed/qed_rdma.c index a4bcde522cdf..03894584415d 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_rdma.c +++ b/drivers/net/ethernet/qlogic/qed/qed_rdma.c @@ -504,7 +504,8 @@ static void qed_rdma_init_devinfo(struct qed_hwfn *p_hwfn, dev->max_mw = 0; dev->max_mr_mw_fmr_pbl = (PAGE_SIZE / 8) * (PAGE_SIZE / 8); dev->max_mr_mw_fmr_size = dev->max_mr_mw_fmr_pbl * PAGE_SIZE; - dev->max_pkey = QED_RDMA_MAX_P_KEY; + if (QED_IS_ROCE_PERSONALITY(p_hwfn)) + dev->max_pkey = QED_RDMA_MAX_P_KEY; dev->max_srq = p_hwfn->p_rdma_info->num_srqs; dev->max_srq_wr = QED_RDMA_MAX_SRQ_WQE_ELEM;
As qedr driver supports both RoCE and iWarp, make sure to set the max_pkeys only when running in RoCE mode. Signed-off-by: Kamal Heib <kamalheib1@gmail.com> --- drivers/infiniband/hw/qedr/verbs.c | 2 +- drivers/net/ethernet/qlogic/qed/qed_rdma.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)