From: Wei Lin Guay Date: Thu, 13 Oct 2016 07:06:15 +0000 (+0200) Subject: sif: cq: Fix the max_cqe capability supported by SIF X-Git-Tag: v4.1.12-92~57^2~4 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=dd4adbc7e18c05204fa96826f08047189713cfa2;p=users%2Fjedix%2Flinux-maple.git sif: cq: Fix the max_cqe capability supported by SIF Orabug: 24673784 This patch fixes an incomplete patch in commit "cq: Add additional SIF visible cqes to CQ". The max_cqe capability reported by query_device is incorrect because it includes the SIF visible cqes. Signed-off-by: Wei Lin Guay Reviewed-by: Knut Omang --- diff --git a/drivers/infiniband/hw/sif/sif_query.c b/drivers/infiniband/hw/sif/sif_query.c index 5dc77aceb396..22549cb5a9b5 100644 --- a/drivers/infiniband/hw/sif/sif_query.c +++ b/drivers/infiniband/hw/sif/sif_query.c @@ -85,7 +85,7 @@ int sif_query_device(struct ib_device *ibdev, struct ib_device_attr *props) props->max_cqe = SIF_SW_MAX_CQE; /* Make sure we never fill the CQ completely on rev 1-3 - Bug #3657 */ if (PSIF_REVISION(sdev) <= 3) - props->max_cqe = SIF_SW_MAX_CQE - 1; + props->max_cqe = SIF_SW_MAX_CQE - (SIF_SW_RESERVED_DUL_CQE + SIF_SW_RESERVED_LAST_CQE); props->max_mr = sdev->ba[key].entry_cnt; props->max_pd = SIF_MAX_PD_INDEX - 1; /* 0 not used, limited by hw field size */ props->max_qp_rd_atom = ldev.max_qp_rd_atom;