Skip to contentSkip to conversation

RDMA/bnxt_re: Driver update

PATCH Superseded Selvin Xavier 2 participants 25 messages Sep 12, 2021 – Sep 13, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Selvin Xavier

author maintainer
#0 lore raw

cover RDMA/bnxt_re: Driver update

Includes some feature updates and bug fixes for bnxt_re driver.

Please review and apply.

Thanks,
Selvin Xavier

Edwin Peer (1):
RDMA/bnxt_re: Use separate response buffer for stat_ctx_free

Selvin Xavier (11):
RDMA/bnxt_re: Add extended statistics counters RDMA/bnxt_re: Update statistics counter name
RDMA/bnxt_re: Reduce the delay in polling for hwrm command completion RDMA/bnxt_re: Support multiple page sizes
RDMA/bnxt_re: Suppress unwanted error messages RDMA/bnxt_re: Fix query SRQ failure
RDMA/bnxt_re: Fix FRMR issue with single page MR allocation RDMA/bnxt_re: Use GFP_KERNEL in non atomic context RDMA/bnxt_re: Correct FRMR size calculation
RDMA/bnxt_re: Check if the vlan is valid before reporting
MAINTAINERS: Update Broadcom RDMA maintainers

 MAINTAINERS                                 |   1 -
 drivers/infiniband/hw/bnxt_re/bnxt_re.h     |   7 +-
 drivers/infiniband/hw/bnxt_re/hw_counters.c | 277 ++++++++++++++++++----------
 drivers/infiniband/hw/bnxt_re/hw_counters.h |  30 ++-
 drivers/infiniband/hw/bnxt_re/ib_verbs.c    |  35 +++-
 drivers/infiniband/hw/bnxt_re/main.c        |  11 +-
 drivers/infiniband/hw/bnxt_re/qplib_fp.c    |  14 +-
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c  |   6 +-
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.h  |   2 +-
 drivers/infiniband/hw/bnxt_re/qplib_res.c   |   5 +-
 drivers/infiniband/hw/bnxt_re/qplib_res.h   |   9 +-
 drivers/infiniband/hw/bnxt_re/qplib_sp.c    |  51 +++++
 drivers/infiniband/hw/bnxt_re/qplib_sp.h    |  28 +++
 drivers/infiniband/hw/bnxt_re/roce_hsi.h    |  85 +++++++++
 14 files changed, 438 insertions(+), 123 deletions(-)
Signature · 1 line
2.5.5
author maintainer
#1 lore raw

PATCH 1/12 RDMA/bnxt_re: Add extended statistics counters

Implement extended statistics counters for newer adapters. Check if the FW support for this command and issue the FW command only if is supported. Includes code re-organization to handle extended stats. Also, add AH and PD software counters.

---
 drivers/infiniband/hw/bnxt_re/bnxt_re.h     |   5 +-
 drivers/infiniband/hw/bnxt_re/hw_counters.c | 273 ++++++++++++++++++----------
 drivers/infiniband/hw/bnxt_re/hw_counters.h |  28 ++-
 drivers/infiniband/hw/bnxt_re/ib_verbs.c    |  16 +-
 drivers/infiniband/hw/bnxt_re/main.c        |   4 +
 drivers/infiniband/hw/bnxt_re/qplib_fp.c    |   3 +
 drivers/infiniband/hw/bnxt_re/qplib_res.h   |   9 +-
 drivers/infiniband/hw/bnxt_re/qplib_sp.c    |  51 ++++++
 drivers/infiniband/hw/bnxt_re/qplib_sp.h    |  28 +++
 drivers/infiniband/hw/bnxt_re/roce_hsi.h    |  85 +++++++++
 10 files changed, 401 insertions(+), 101 deletions(-)
drivers/infiniband/hw/bnxt_re/bnxt_re.h +4 -1
index ba26d8e..5b85620 100644
@@ -39,6 +39,7 @@
 
 #ifndef __BNXT_RE_H__
 #define __BNXT_RE_H__
+#include "hw_counters.h"
 #define ROCE_DRV_MODULE_NAME		"bnxt_re"
 
 #define BNXT_RE_DESC	"Broadcom NetXtreme-C/E RoCE Driver"
@@ -177,15 +178,17 @@ struct bnxt_re_dev {
 	atomic_t			srq_count;
 	atomic_t			mr_count;
 	atomic_t			mw_count;
+	atomic_t			ah_count;
+	atomic_t			pd_count;
 	/* Max of 2 lossless traffic class supported per port */
 	u16				cosq[2];
 
 	/* QP for for handling QP1 packets */
 	struct bnxt_re_gsi_context	gsi_ctx;
+	struct bnxt_re_stats		stats;
 	atomic_t nq_alloc_cnt;
 	u32 is_virtfn;
 	u32 num_vfs;
-	struct bnxt_qplib_roce_stats	stats;
 };
 
 #define to_bnxt_re_dev(ptr, member)	\
drivers/infiniband/hw/bnxt_re/hw_counters.c +178 -95

319 lines not on this page · raw message

drivers/infiniband/hw/bnxt_re/hw_counters.h +27 -1
index 6f2d2f9..d65be4c 100644
@@ -41,6 +41,8 @@
 #define __BNXT_RE_HW_STATS_H__
 
 enum bnxt_re_hw_stats {
+	BNXT_RE_ACTIVE_PD,
+	BNXT_RE_ACTIVE_AH,
 	BNXT_RE_ACTIVE_QP,
 	BNXT_RE_ACTIVE_SRQ,
 	BNXT_RE_ACTIVE_CQ,
@@ -93,7 +95,31 @@ enum bnxt_re_hw_stats {
 	BNXT_RE_RES_TX_PCI_ERR,
 	BNXT_RE_RES_RX_PCI_ERR,
 	BNXT_RE_OUT_OF_SEQ_ERR,
-	BNXT_RE_NUM_COUNTERS
+	BNXT_RE_TX_ATOMIC_REQ,
+	BNXT_RE_TX_READ_REQ,
+	BNXT_RE_TX_READ_RES,
+	BNXT_RE_TX_WRITE_REQ,
+	BNXT_RE_TX_SEND_REQ,
+	BNXT_RE_RX_ATOMIC_REQ,
+	BNXT_RE_RX_READ_REQ,
+	BNXT_RE_RX_READ_RESP,
+	BNXT_RE_RX_WRITE_REQ,
+	BNXT_RE_RX_SEND_REQ,
+	BNXT_RE_RX_ROCE_GOOD_PKTS,
+	BNXT_RE_RX_ROCE_GOOD_BYTES,
+	BNXT_RE_OOB,
+	BNXT_RE_NUM_EXT_COUNTERS
+};
+
+#define BNXT_RE_NUM_STD_COUNTERS (BNXT_RE_OUT_OF_SEQ_ERR + 1)
+
+struct bnxt_re_rstat {
+	struct bnxt_qplib_roce_stats    errs;
+	struct bnxt_qplib_ext_stat      ext_stat;
+};
+
+struct bnxt_re_stats {
+	struct bnxt_re_rstat            rstat;
 };
 
 struct rdma_hw_stats *bnxt_re_ib_alloc_hw_port_stats(struct ib_device *ibdev,
drivers/infiniband/hw/bnxt_re/ib_verbs.c +13 -3
index 634d158..22e3668 100644
@@ -541,9 +541,12 @@ int bnxt_re_dealloc_pd(struct ib_pd *ib_pd, struct ib_udata *udata)
 
 	bnxt_re_destroy_fence_mr(pd);
 
-	if (pd->qplib_pd.id)
-		bnxt_qplib_dealloc_pd(&rdev->qplib_res, &rdev->qplib_res.pd_tbl,
-				      &pd->qplib_pd);
+	if (pd->qplib_pd.id) {
+		if (!bnxt_qplib_dealloc_pd(&rdev->qplib_res,
+					   &rdev->qplib_res.pd_tbl,
+					   &pd->qplib_pd))
+			atomic_dec(&rdev->pd_count);
+	}
 	return 0;
 }
 
@@ -595,6 +598,8 @@ int bnxt_re_alloc_pd(struct ib_pd *ibpd, struct ib_udata *udata)
 		if (bnxt_re_create_fence_mr(pd))
 			ibdev_warn(&rdev->ibdev,
 				   "Failed to create Fence-MR\n");
+	atomic_inc(&rdev->pd_count);
+
 	return 0;
 dbfail:
 	bnxt_qplib_dealloc_pd(&rdev->qplib_res, &rdev->qplib_res.pd_tbl,
@@ -611,6 +616,8 @@ int bnxt_re_destroy_ah(struct ib_ah *ib_ah, u32 flags)
 
 	bnxt_qplib_destroy_ah(&rdev->qplib_res, &ah->qplib_ah,
 			      !(flags & RDMA_DESTROY_AH_SLEEPABLE));
+	atomic_dec(&rdev->ah_count);
+
 	return 0;
 }
 
@@ -695,6 +702,7 @@ int bnxt_re_create_ah(struct ib_ah *ib_ah, struct rdma_ah_init_attr *init_attr,
 		wmb(); /* make sure cache is updated. */
 		spin_unlock_irqrestore(&uctx->sh_lock, flag);
 	}
+	atomic_inc(&rdev->ah_count);
 
 	return 0;
 }
@@ -760,6 +768,7 @@ static int bnxt_re_destroy_gsi_sqp(struct bnxt_re_qp *qp)
 	bnxt_qplib_destroy_ah(&rdev->qplib_res,
 			      &gsi_sah->qplib_ah,
 			      true);
+	atomic_dec(&rdev->ah_count);
 	bnxt_qplib_clean_qp(&qp->qplib_qp);
 
 	ibdev_dbg(&rdev->ibdev, "Destroy the shadow QP\n");
@@ -1006,6 +1015,7 @@ static struct bnxt_re_ah *bnxt_re_create_shadow_qp_ah
 			  "Failed to allocate HW AH for Shadow QP");
 		goto fail;
 	}
+	atomic_inc(&rdev->ah_count);
 
 	return ah;
 
drivers/infiniband/hw/bnxt_re/main.c +4 -0
index b3baffe..e4f39d8 100644
@@ -127,6 +127,8 @@ static int bnxt_re_setup_chip_ctx(struct bnxt_re_dev *rdev, u8 wqe_mode)
 
 	rdev->qplib_res.cctx = rdev->chip_ctx;
 	rdev->rcfw.res = &rdev->qplib_res;
+	rdev->qplib_res.dattr = &rdev->dev_attr;
+	rdev->qplib_res.is_vf = BNXT_VF(bp);
 
 	bnxt_re_set_drv_mode(rdev, wqe_mode);
 	if (bnxt_qplib_determine_atomics(en_dev->pdev))
@@ -777,6 +779,8 @@ static struct bnxt_re_dev *bnxt_re_dev_add(struct net_device *netdev,
 	atomic_set(&rdev->srq_count, 0);
 	atomic_set(&rdev->mr_count, 0);
 	atomic_set(&rdev->mw_count, 0);
+	atomic_set(&rdev->ah_count, 0);
+	atomic_set(&rdev->pd_count, 0);
 	rdev->cosq[0] = 0xFFFF;
 	rdev->cosq[1] = 0xFFFF;
 
drivers/infiniband/hw/bnxt_re/qplib_fp.c +3 -0
index d4d4959..d0895e6 100644
@@ -1049,6 +1049,9 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
 		qp_flags |= CMDQ_CREATE_QP_QP_FLAGS_FORCE_COMPLETION;
 	if (qp->wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE)
 		qp_flags |= CMDQ_CREATE_QP_QP_FLAGS_VARIABLE_SIZED_WQE_ENABLED;
+	if (_is_ext_stats_supported(res->dattr->dev_cap_flags) && !res->is_vf)
+		qp_flags |= CMDQ_CREATE_QP_QP_FLAGS_EXT_STATS_ENABLED;
+
 	req.qp_flags = cpu_to_le32(qp_flags);
 
 	/* ORRQ and IRRQ */
drivers/infiniband/hw/bnxt_re/qplib_res.h +8 -1
index 9103150..c39b202 100644
@@ -253,14 +253,15 @@ struct bnxt_qplib_ctx {
 struct bnxt_qplib_res {
 	struct pci_dev			*pdev;
 	struct bnxt_qplib_chip_ctx	*cctx;
+	struct bnxt_qplib_dev_attr      *dattr;
 	struct net_device		*netdev;
-
 	struct bnxt_qplib_rcfw		*rcfw;
 	struct bnxt_qplib_pd_tbl	pd_tbl;
 	struct bnxt_qplib_sgid_tbl	sgid_tbl;
 	struct bnxt_qplib_pkey_tbl	pkey_tbl;
 	struct bnxt_qplib_dpi_tbl	dpi_tbl;
 	bool				prio;
+	bool                            is_vf;
 };
 
 static inline bool bnxt_qplib_is_chip_gen_p5(struct bnxt_qplib_chip_ctx *cctx)
@@ -450,4 +451,10 @@ static inline void bnxt_qplib_ring_nq_db(struct bnxt_qplib_db_info *info,
 	else
 		bnxt_qplib_ring_db32(info, arm);
 }
+
+static inline bool _is_ext_stats_supported(u16 dev_cap_flags)
+{
+	return dev_cap_flags &
+		CREQ_QUERY_FUNC_RESP_SB_EXT_STATS;
+}
 #endif /* __BNXT_QPLIB_RES_H__ */
drivers/infiniband/hw/bnxt_re/qplib_sp.c +51 -0

60 lines not on this page · raw message

drivers/infiniband/hw/bnxt_re/qplib_sp.h +28 -0
index 26010478..3d5c418 100644
@@ -71,6 +71,7 @@ struct bnxt_qplib_dev_attr {
 	u32				l2_db_size;
 	u8				tqm_alloc_reqs[MAX_TQM_ALLOC_REQ];
 	bool				is_atomic;
+	u16                             dev_cap_flags;
 };
 
 struct bnxt_qplib_pd {
@@ -219,6 +220,30 @@ struct bnxt_qplib_roce_stats {
 	/* port 3 active qps */
 };
 
+struct bnxt_qplib_ext_stat {
+	u64  tx_atomic_req;
+	u64  tx_read_req;
+	u64  tx_read_res;
+	u64  tx_write_req;
+	u64  tx_send_req;
+	u64  tx_roce_pkts;
+	u64  tx_roce_bytes;
+	u64  rx_atomic_req;
+	u64  rx_read_req;
+	u64  rx_read_res;
+	u64  rx_write_req;
+	u64  rx_send_req;
+	u64  rx_roce_pkts;
+	u64  rx_roce_bytes;
+	u64  rx_roce_good_pkts;
+	u64  rx_roce_good_bytes;
+	u64  rx_out_of_buffer;
+	u64  rx_out_of_sequence;
+	u64  tx_cnp;
+	u64  rx_cnp;
+	u64  rx_ecn_marked;
+};
+
 int bnxt_qplib_get_sgid(struct bnxt_qplib_res *res,
 			struct bnxt_qplib_sgid_tbl *sgid_tbl, int index,
 			struct bnxt_qplib_gid *gid);
@@ -263,4 +288,7 @@ int bnxt_qplib_free_fast_reg_page_list(struct bnxt_qplib_res *res,
 int bnxt_qplib_map_tc2cos(struct bnxt_qplib_res *res, u16 *cids);
 int bnxt_qplib_get_roce_stats(struct bnxt_qplib_rcfw *rcfw,
 			      struct bnxt_qplib_roce_stats *stats);
+int bnxt_qplib_qext_stat(struct bnxt_qplib_rcfw *rcfw, u32 fid,
+			 struct bnxt_qplib_ext_stat *estat);
+
 #endif /* __BNXT_QPLIB_SP_H__*/
drivers/infiniband/hw/bnxt_re/roce_hsi.h +85 -0

109 lines not on this page · raw message

Signature · 1 line
2.5.5
Reviewed-by on v1 1/12
#2 lore raw

Re: [PATCH for-next 01/12] RDMA/bnxt_re: Add extended statistics counters

Quoted 6 lines · Selvin Xavier

Implement extended statistics counters for newer adapters. Check if the FW support for this command and issue the FW command only if is supported. Includes code re-organization to handle extended stats. Also, add AH and PD software counters.

Quoted 13 lines
---
 drivers/infiniband/hw/bnxt_re/bnxt_re.h     |   5 +-
 drivers/infiniband/hw/bnxt_re/hw_counters.c | 273 ++++++++++++++++++----------
 drivers/infiniband/hw/bnxt_re/hw_counters.h |  28 ++-
 drivers/infiniband/hw/bnxt_re/ib_verbs.c    |  16 +-
 drivers/infiniband/hw/bnxt_re/main.c        |   4 +
 drivers/infiniband/hw/bnxt_re/qplib_fp.c    |   3 +
 drivers/infiniband/hw/bnxt_re/qplib_res.h   |   9 +-
 drivers/infiniband/hw/bnxt_re/qplib_sp.c    |  51 ++++++
 drivers/infiniband/hw/bnxt_re/qplib_sp.h    |  28 +++
 drivers/infiniband/hw/bnxt_re/roce_hsi.h    |  85 +++++++++
 10 files changed, 401 insertions(+), 101 deletions(-)

Thanks,

author maintainer
#3 lore raw

PATCH 2/12 RDMA/bnxt_re: Update statistics counter name

In reply to Selvin Xavier

Update a statistics counter name as the interface
structure got updated.

Fixes 9d6b648c3112 ("bnxt_en: Update firmware interface spec to 1.10.1.65.")
---
 drivers/infiniband/hw/bnxt_re/hw_counters.c | 4 ++--
 drivers/infiniband/hw/bnxt_re/hw_counters.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/bnxt_re/hw_counters.c +2 -2
index 7e6dcf3..1c06c9c 100644
@@ -70,7 +70,7 @@ static const char * const bnxt_re_stat_name[] = {
 	[BNXT_RE_TX_PKTS]		=  "tx_pkts",
 	[BNXT_RE_TX_BYTES]		=  "tx_bytes",
 	[BNXT_RE_RECOVERABLE_ERRORS]	=  "recoverable_errors",
-	[BNXT_RE_RX_DROPS]		=  "rx_roce_drops",
+	[BNXT_RE_RX_ERRORS]		=  "rx_roce_errors",
 	[BNXT_RE_RX_DISCARDS]		=  "rx_roce_discards",
 	[BNXT_RE_TO_RETRANSMITS]        = "to_retransmits",
 	[BNXT_RE_SEQ_ERR_NAKS_RCVD]     = "seq_err_naks_rcvd",
@@ -273,7 +273,7 @@ int bnxt_re_ib_get_hw_stats(struct ib_device *ibdev,
 	if (hw_stats) {
 		stats->value[BNXT_RE_RECOVERABLE_ERRORS] =
 			le64_to_cpu(hw_stats->tx_bcast_pkts);
-		stats->value[BNXT_RE_RX_DROPS] =
+		stats->value[BNXT_RE_RX_ERRORS] =
 			le64_to_cpu(hw_stats->rx_error_pkts);
 		stats->value[BNXT_RE_RX_DISCARDS] =
 			le64_to_cpu(hw_stats->rx_discard_pkts);
drivers/infiniband/hw/bnxt_re/hw_counters.h +1 -1
index d65be4c..7943b2c 100644
@@ -53,7 +53,7 @@ enum bnxt_re_hw_stats {
 	BNXT_RE_TX_PKTS,
 	BNXT_RE_TX_BYTES,
 	BNXT_RE_RECOVERABLE_ERRORS,
-	BNXT_RE_RX_DROPS,
+	BNXT_RE_RX_ERRORS,
 	BNXT_RE_RX_DISCARDS,
 	BNXT_RE_TO_RETRANSMITS,
 	BNXT_RE_SEQ_ERR_NAKS_RCVD,
Signature · 1 line
2.5.5
Reviewed-by on v1 2/12
#4 lore raw

Re: [PATCH for-next 02/12] RDMA/bnxt_re: Update statistics counter name

Quoted 10 lines · Selvin Xavier

Update a statistics counter name as the interface
structure got updated.

Fixes 9d6b648c3112 ("bnxt_en: Update firmware interface spec to 1.10.1.65.")
---
 drivers/infiniband/hw/bnxt_re/hw_counters.c | 4 ++--
 drivers/infiniband/hw/bnxt_re/hw_counters.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Thanks,

author maintainer
#5 lore raw

PATCH 3/12 RDMA/bnxt_re: Use separate response buffer for stat_ctx_free

In reply to Selvin Xavier

From: Edwin Peer <[email protected]>

Use separate buffers for the request and response data. Eventhough the response data is not used, providing the correct length is appropriate.

---
 drivers/infiniband/hw/bnxt_re/main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/infiniband/hw/bnxt_re/main.c +4 -3
index e4f39d8..4214674 100644
@@ -525,7 +525,8 @@ static int bnxt_re_net_stats_ctx_free(struct bnxt_re_dev *rdev,
 				      u32 fw_stats_ctx_id)
 {
 	struct bnxt_en_dev *en_dev = rdev->en_dev;
-	struct hwrm_stat_ctx_free_input req = {0};
+	struct hwrm_stat_ctx_free_input req = {};
+	struct hwrm_stat_ctx_free_output resp = {};
 	struct bnxt_fw_msg fw_msg;
 	int rc = -EINVAL;
 
@@ -539,8 +540,8 @@ static int bnxt_re_net_stats_ctx_free(struct bnxt_re_dev *rdev,
 
 	bnxt_re_init_hwrm_hdr(rdev, (void *)&req, HWRM_STAT_CTX_FREE, -1, -1);
 	req.stat_ctx_id = cpu_to_le32(fw_stats_ctx_id);
-	bnxt_re_fill_fw_msg(&fw_msg, (void *)&req, sizeof(req), (void *)&req,
-			    sizeof(req), DFLT_HWRM_CMD_TIMEOUT);
+	bnxt_re_fill_fw_msg(&fw_msg, (void *)&req, sizeof(req), (void *)&resp,
+			    sizeof(resp), DFLT_HWRM_CMD_TIMEOUT);
 	rc = en_dev->en_ops->bnxt_send_fw_msg(en_dev, BNXT_ROCE_ULP, &fw_msg);
 	if (rc)
 		ibdev_err(&rdev->ibdev, "Failed to free HW stats context %#x",
Signature · 1 line
2.5.5
Reviewed-by on v1 3/12
#6 lore raw

Re: [PATCH for-next 03/12] RDMA/bnxt_re: Use separate response buffer for stat_ctx_free

Quoted 27 lines · Selvin Xavier

From: Edwin Peer <[email protected]>

Use separate buffers for the request and response data. Eventhough the response data is not used, providing the correct length is appropriate.

---
 drivers/infiniband/hw/bnxt_re/main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/infiniband/hw/bnxt_re/main.c +2 -1
index e4f39d8..4214674 100644
@@ -525,7 +525,8 @@ static int bnxt_re_net_stats_ctx_free(struct bnxt_re_dev *rdev,
 				      u32 fw_stats_ctx_id)
 {
 	struct bnxt_en_dev *en_dev = rdev->en_dev;
-	struct hwrm_stat_ctx_free_input req = {0};
+	struct hwrm_stat_ctx_free_input req = {};
+	struct hwrm_stat_ctx_free_output resp = {};
 	struct bnxt_fw_msg fw_msg;
 	int rc = -EINVAL;
 

drivers/infiniband/hw/bnxt_re/main.c static int bnxt_re_net_stats_ctx_free(struct bnxt_re_dev *rdev, · line 544

Quoted 7 lines
drivers/infiniband/hw/bnxt_re/main.c +2 -2
@@ -539,8 +540,8 @@ static int bnxt_re_net_stats_ctx_free(struct bnxt_re_dev *rdev,
 
 	bnxt_re_init_hwrm_hdr(rdev, (void *)&req, HWRM_STAT_CTX_FREE, -1, -1);
 	req.stat_ctx_id = cpu_to_le32(fw_stats_ctx_id);
-	bnxt_re_fill_fw_msg(&fw_msg, (void *)&req, sizeof(req), (void *)&req,
-			    sizeof(req), DFLT_HWRM_CMD_TIMEOUT);
+	bnxt_re_fill_fw_msg(&fw_msg, (void *)&req, sizeof(req), (void *)&resp,
+			    sizeof(resp), DFLT_HWRM_CMD_TIMEOUT);

As far as I remember, you don't need to cast to void.

Thanks,

author maintainer
#7 lore raw

PATCH 4/12 RDMA/bnxt_re: Reduce the delay in polling for hwrm command completion

In reply to Selvin Xavier

Driver has 1ms delay between the polling for atomic command completion. Polling immediately after issuing command usually doesn't report any completions. So all commands in the blocking path needs two iterations. So effectively 1ms spend on each command. HW requires much lesser time for each command. So reduce the delay to 1us and increase the iteration count to wait for the same time.

---
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 2 +-
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +1 -1
index 5d384de..947e8c5 100644
@@ -78,7 +78,7 @@ static int __block_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie)
 	if (!test_bit(cbit, cmdq->cmdq_bitmap))
 		goto done;
 	do {
-		mdelay(1); /* 1m sec */
+		udelay(1);
 		bnxt_qplib_service_creq(&rcfw->creq.creq_tasklet);
 	} while (test_bit(cbit, cmdq->cmdq_bitmap) && --count);
 done:
drivers/infiniband/hw/bnxt_re/qplib_rcfw.h +1 -1
index 9474c00..82faa4e 100644
@@ -96,7 +96,7 @@ static inline void bnxt_qplib_set_cmd_slots(struct cmdq_base *req)
 
 #define RCFW_MAX_COOKIE_VALUE		0x7FFF
 #define RCFW_CMD_IS_BLOCKING		0x8000
-#define RCFW_BLOCKED_CMD_WAIT_COUNT	0x4E20
+#define RCFW_BLOCKED_CMD_WAIT_COUNT	20000000UL /* 20 sec */
 
 #define HWRM_VERSION_RCFW_CMDQ_DEPTH_CHECK 0x1000900020011ULL
 
Signature · 1 line
2.5.5
Reviewed-by on v1 4/12
#8 lore raw

Re: [PATCH for-next 04/12] RDMA/bnxt_re: Reduce the delay in polling for hwrm command completion

Quoted 7 lines · Selvin Xavier

Driver has 1ms delay between the polling for atomic command completion. Polling immediately after issuing command usually doesn't report any completions. So all commands in the blocking path needs two iterations. So effectively 1ms spend on each command. HW requires much lesser time for each command. So reduce the delay to 1us and increase the iteration count to wait for the same time.

Quoted 6 lines
---
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 2 +-
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Thanks,

author maintainer
#9 lore raw

PATCH 5/12 RDMA/bnxt_re: Support multiple page sizes

In reply to Selvin Xavier

HW can support multiple page sizes. Enable bits
for enabling sizes from 4k to 1G by reporting
page_size_cap.

---
 drivers/infiniband/hw/bnxt_re/bnxt_re.h  | 2 ++
 drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/infiniband/hw/bnxt_re/bnxt_re.h +2 -0
index 5b85620..39a5677 100644
@@ -57,6 +57,8 @@
 #define BNXT_RE_PAGE_SIZE_8M		BIT(BNXT_RE_PAGE_SHIFT_8M)
 #define BNXT_RE_PAGE_SIZE_1G		BIT(BNXT_RE_PAGE_SHIFT_1G)
 
+#define BNXT_RE_PAGE_SIZE_SUPPORTED	0x7FFFF000 /* 4kb - 1G */
+
 #define BNXT_RE_MAX_MR_SIZE_LOW		BIT_ULL(BNXT_RE_PAGE_SHIFT_1G)
 #define BNXT_RE_MAX_MR_SIZE_HIGH	BIT_ULL(39)
 #define BNXT_RE_MAX_MR_SIZE		BNXT_RE_MAX_MR_SIZE_HIGH
drivers/infiniband/hw/bnxt_re/ib_verbs.c +2 -2
index 22e3668..c4d7a9e 100644
@@ -133,7 +133,7 @@ int bnxt_re_query_device(struct ib_device *ibdev,
 	bnxt_qplib_get_guid(rdev->netdev->dev_addr,
 			    (u8 *)&ib_attr->sys_image_guid);
 	ib_attr->max_mr_size = BNXT_RE_MAX_MR_SIZE;
-	ib_attr->page_size_cap = BNXT_RE_PAGE_SIZE_4K | BNXT_RE_PAGE_SIZE_2M;
+	ib_attr->page_size_cap = BNXT_RE_PAGE_SIZE_SUPPORTED;
 
 	ib_attr->vendor_id = rdev->en_dev->pdev->vendor;
 	ib_attr->vendor_part_id = rdev->en_dev->pdev->device;
@@ -3807,7 +3807,7 @@ struct ib_mr *bnxt_re_reg_user_mr(struct ib_pd *ib_pd, u64 start, u64 length,
 
 	mr->qplib_mr.va = virt_addr;
 	page_size = ib_umem_find_best_pgsz(
-		umem, BNXT_RE_PAGE_SIZE_4K | BNXT_RE_PAGE_SIZE_2M, virt_addr);
+		umem, BNXT_RE_PAGE_SIZE_SUPPORTED, virt_addr);
 	if (!page_size) {
 		ibdev_err(&rdev->ibdev, "umem page size unsupported!");
 		rc = -EFAULT;
Signature · 1 line
2.5.5
#10 lore raw

Re: [PATCH for-next 05/12] RDMA/bnxt_re: Support multiple page sizes

Quoted 15 lines · Selvin Xavier

HW can support multiple page sizes. Enable bits
for enabling sizes from 4k to 1G by reporting
page_size_cap.

---
 drivers/infiniband/hw/bnxt_re/bnxt_re.h  | 2 ++
 drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/infiniband/hw/bnxt_re/bnxt_re.h +0 -0
index 5b85620..39a5677 100644

drivers/infiniband/hw/bnxt_re/bnxt_re.h line 58

Quoted 2 lines
drivers/infiniband/hw/bnxt_re/bnxt_re.h +0 -0
@@ -57,6 +57,8 @@
 #define BNXT_RE_PAGE_SIZE_8M		BIT(BNXT_RE_PAGE_SHIFT_8M)
 #define BNXT_RE_PAGE_SIZE_1G		BIT(BNXT_RE_PAGE_SHIFT_1G)

All the defines above can be deleted, they are not used.

Quoted 31 lines
drivers/infiniband/hw/bnxt_re/bnxt_re.h +2 -0
+#define BNXT_RE_PAGE_SIZE_SUPPORTED	0x7FFFF000 /* 4kb - 1G */
+
 #define BNXT_RE_MAX_MR_SIZE_LOW		BIT_ULL(BNXT_RE_PAGE_SHIFT_1G)
 #define BNXT_RE_MAX_MR_SIZE_HIGH	BIT_ULL(39)
 #define BNXT_RE_MAX_MR_SIZE		BNXT_RE_MAX_MR_SIZE_HIGH
drivers/infiniband/hw/bnxt_re/ib_verbs.c +2 -2
index 22e3668..c4d7a9e 100644
@@ -133,7 +133,7 @@ int bnxt_re_query_device(struct ib_device *ibdev,
 	bnxt_qplib_get_guid(rdev->netdev->dev_addr,
 			    (u8 *)&ib_attr->sys_image_guid);
 	ib_attr->max_mr_size = BNXT_RE_MAX_MR_SIZE;
-	ib_attr->page_size_cap = BNXT_RE_PAGE_SIZE_4K | BNXT_RE_PAGE_SIZE_2M;
+	ib_attr->page_size_cap = BNXT_RE_PAGE_SIZE_SUPPORTED;
 
 	ib_attr->vendor_id = rdev->en_dev->pdev->vendor;
 	ib_attr->vendor_part_id = rdev->en_dev->pdev->device;
@@ -3807,7 +3807,7 @@ struct ib_mr *bnxt_re_reg_user_mr(struct ib_pd *ib_pd, u64 start, u64 length,
 
 	mr->qplib_mr.va = virt_addr;
 	page_size = ib_umem_find_best_pgsz(
-		umem, BNXT_RE_PAGE_SIZE_4K | BNXT_RE_PAGE_SIZE_2M, virt_addr);
+		umem, BNXT_RE_PAGE_SIZE_SUPPORTED, virt_addr);
 	if (!page_size) {
 		ibdev_err(&rdev->ibdev, "umem page size unsupported!");
 		rc = -EFAULT;
Signature · 1 line
2.5.5
author maintainer
#11 lore raw

PATCH 6/12 RDMA/bnxt_re: Suppress unwanted error messages

In reply to Selvin Xavier

Terminal CQEs are expected during QP destroy. Avoid the unwanted error messages.

---
 drivers/infiniband/hw/bnxt_re/qplib_fp.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +6 -3
index d0895e6..539b1a2 100644
@@ -2854,6 +2854,7 @@ int bnxt_qplib_poll_cq(struct bnxt_qplib_cq *cq, struct bnxt_qplib_cqe *cqe,
 	struct cq_base *hw_cqe;
 	u32 sw_cons, raw_cons;
 	int budget, rc = 0;
+	u8 type;
 
 	raw_cons = cq->hwq.cons;
 	budget = num_cqes;
@@ -2872,7 +2873,8 @@ int bnxt_qplib_poll_cq(struct bnxt_qplib_cq *cq, struct bnxt_qplib_cqe *cqe,
 		 */
 		dma_rmb();
 		/* From the device's respective CQE format to qplib_wc*/
-		switch (hw_cqe->cqe_type_toggle & CQ_BASE_CQE_TYPE_MASK) {
+		type = hw_cqe->cqe_type_toggle & CQ_BASE_CQE_TYPE_MASK;
+		switch (type) {
 		case CQ_BASE_CQE_TYPE_REQ:
 			rc = bnxt_qplib_cq_process_req(cq,
 						       (struct cq_req *)hw_cqe,
@@ -2919,8 +2921,9 @@ int bnxt_qplib_poll_cq(struct bnxt_qplib_cq *cq, struct bnxt_qplib_cqe *cqe,
 			/* Error while processing the CQE, just skip to the
 			 * next one
 			 */
-			dev_err(&cq->hwq.pdev->dev,
-				"process_cqe error rc = 0x%x\n", rc);
+			if (type != CQ_BASE_CQE_TYPE_TERMINAL)
+				dev_err(&cq->hwq.pdev->dev,
+					"process_cqe error rc = 0x%x\n", rc);
 		}
 		raw_cons++;
 	}
Signature · 1 line
2.5.5
author maintainer
#13 lore raw

PATCH 7/12 RDMA/bnxt_re: Fix query SRQ failure

In reply to Selvin Xavier

Fill the missing parameters for the FW command while querying SRQ.

Fixes 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters")
---
 drivers/infiniband/hw/bnxt_re/qplib_fp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +2 -0
index 539b1a2..e2926dd 100644
@@ -713,6 +713,8 @@ int bnxt_qplib_query_srq(struct bnxt_qplib_res *res,
 	sbuf = bnxt_qplib_rcfw_alloc_sbuf(rcfw, sizeof(*sb));
 	if (!sbuf)
 		return -ENOMEM;
+	req.resp_size = sizeof(*sb) / BNXT_QPLIB_CMDQE_UNITS;
+	req.srq_cid = cpu_to_le32(srq->id);
 	sb = sbuf->sb;
 	rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void *)&resp,
 					  (void *)sbuf, 0);
Signature · 1 line
2.5.5
#14 lore raw

Re: [PATCH for-next 07/12] RDMA/bnxt_re: Fix query SRQ failure

Quoted 14 lines · Selvin Xavier

Fill the missing parameters for the FW command while querying SRQ.

Fixes 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters")
---
 drivers/infiniband/hw/bnxt_re/qplib_fp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +0 -0
index 539b1a2..e2926dd 100644

drivers/infiniband/hw/bnxt_re/qplib_fp.c int bnxt_qplib_query_srq(struct bnxt_qplib_res *res, · line 717

Quoted 5 lines
drivers/infiniband/hw/bnxt_re/qplib_fp.c +2 -0
@@ -713,6 +713,8 @@ int bnxt_qplib_query_srq(struct bnxt_qplib_res *res,
 	sbuf = bnxt_qplib_rcfw_alloc_sbuf(rcfw, sizeof(*sb));
 	if (!sbuf)
 		return -ENOMEM;
+	req.resp_size = sizeof(*sb) / BNXT_QPLIB_CMDQE_UNITS;
+	req.srq_cid = cpu_to_le32(srq->id);

You already have this line.

   698 int bnxt_qplib_query_srq(struct bnxt_qplib_res *res,
   699                          struct bnxt_qplib_srq *srq)
   700 {
   ...
   708
   709         RCFW_CMD_PREP(req, QUERY_SRQ, cmd_flags);
   710         req.srq_cid = cpu_to_le32(srq->id);
Quoted 6 lines
drivers/infiniband/hw/bnxt_re/qplib_fp.c +0 -0
 	sb = sbuf->sb;
 	rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void *)&resp,
 					  (void *)sbuf, 0);
Signature · 1 line
2.5.5
author maintainer
#15 lore raw

Re: [PATCH for-next 07/12] RDMA/bnxt_re: Fix query SRQ failure

Quoted 11 lines · Leon Romanovsky
Quoted 9 lines · Selvin Xavier

Fill the missing parameters for the FW command while querying SRQ.

Fixes 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters")
---
 drivers/infiniband/hw/bnxt_re/qplib_fp.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 12 lines

drivers/infiniband/hw/bnxt_re/qplib_fp.c int bnxt_qplib_query_srq(struct bnxt_qplib_res *res, · line 717

Quoted 10 lines
drivers/infiniband/hw/bnxt_re/qplib_fp.c +2 -0
index 539b1a2..e2926dd 100644
@@ -713,6 +713,8 @@ int bnxt_qplib_query_srq(struct bnxt_qplib_res *res,
      sbuf = bnxt_qplib_rcfw_alloc_sbuf(rcfw, sizeof(*sb));
      if (!sbuf)
              return -ENOMEM;
+     req.resp_size = sizeof(*sb) / BNXT_QPLIB_CMDQE_UNITS;
+     req.srq_cid = cpu_to_le32(srq->id);

You already have this line.

ok.. I will remove one of them. mainly the fix was for the resp_size..

Thanks

Quoted 16 lines
   698 int bnxt_qplib_query_srq(struct bnxt_qplib_res *res,
   699                          struct bnxt_qplib_srq *srq)
   700 {
   ...
   708
   709         RCFW_CMD_PREP(req, QUERY_SRQ, cmd_flags);
   710         req.srq_cid = cpu_to_le32(srq->id);
Quoted 6 lines
drivers/infiniband/hw/bnxt_re/qplib_fp.c +0 -1
      sb = sbuf->sb;
      rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void *)&resp,
                                        (void *)sbuf, 0);
--

2.5.5

author maintainer
#16 lore raw

PATCH 8/12 RDMA/bnxt_re: Fix FRMR issue with single page MR allocation

In reply to Selvin Xavier

When the FRMR is allocated with single page, driver is attempting to create a level 0 HWQ and not allocating any page because the nopte field is set. This causes the crash during post_send as the pbl is not populated.

To avoid this crash, check for the nopte bit during HWQ creation with single page and create a level 1 page table and populate the pbl address correctly.

---
 drivers/infiniband/hw/bnxt_re/qplib_res.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_res.c +3 -2
index 44282a8..bf49363 100644
@@ -228,15 +228,16 @@ int bnxt_qplib_alloc_init_hwq(struct bnxt_qplib_hwq *hwq,
 				npages++;
 	}
 
-	if (npages == MAX_PBL_LVL_0_PGS) {
+	if (npages == MAX_PBL_LVL_0_PGS && !hwq_attr->sginfo->nopte) {
 		/* This request is Level 0, map PTE */
 		rc = __alloc_pbl(res, &hwq->pbl[PBL_LVL_0], hwq_attr->sginfo);
 		if (rc)
 			goto fail;
 		hwq->level = PBL_LVL_0;
+		goto done;
 	}
 
-	if (npages > MAX_PBL_LVL_0_PGS) {
+	if (npages >= MAX_PBL_LVL_0_PGS) {
 		if (npages > MAX_PBL_LVL_1_PGS) {
 			u32 flag = (hwq_attr->type == HWQ_TYPE_L2_CMPL) ?
 				    0 : PTU_PTE_VALID;
Signature · 1 line
2.5.5
Reviewed-by on v1 8/12
#17 lore raw

Re: [PATCH for-next 08/12] RDMA/bnxt_re: Fix FRMR issue with single page MR allocation

Quoted 5 lines · Selvin Xavier

When the FRMR is allocated with single page, driver is attempting to create a level 0 HWQ and not allocating any page because the nopte field is set. This causes the crash during post_send as the pbl is not populated.

Quoted 9 lines

To avoid this crash, check for the nopte bit during HWQ creation with single page and create a level 1 page table and populate the pbl address correctly.

---
 drivers/infiniband/hw/bnxt_re/qplib_res.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Thanks,

author maintainer
#18 lore raw

PATCH 9/12 RDMA/bnxt_re: Use GFP_KERNEL in non atomic context

In reply to Selvin Xavier

Use GFP_KERNEL instead of GFP_ATOMIC while allocating control path structures which will be only called from non atomic context

---
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +2 -2
index 947e8c5..3de8547 100644
@@ -848,13 +848,13 @@ struct bnxt_qplib_rcfw_sbuf *bnxt_qplib_rcfw_alloc_sbuf(
 {
 	struct bnxt_qplib_rcfw_sbuf *sbuf;
 
-	sbuf = kzalloc(sizeof(*sbuf), GFP_ATOMIC);
+	sbuf = kzalloc(sizeof(*sbuf), GFP_KERNEL);
 	if (!sbuf)
 		return NULL;
 
 	sbuf->size = size;
 	sbuf->sb = dma_alloc_coherent(&rcfw->pdev->dev, sbuf->size,
-				      &sbuf->dma_addr, GFP_ATOMIC);
+				      &sbuf->dma_addr, GFP_KERNEL);
 	if (!sbuf->sb)
 		goto bail;
 
Signature · 1 line
2.5.5
#19 lore raw

Re: [PATCH for-next 09/12] RDMA/bnxt_re: Use GFP_KERNEL in non atomic context

Quoted 14 lines · Selvin Xavier

Use GFP_KERNEL instead of GFP_ATOMIC while allocating control path structures which will be only called from non atomic context

---
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +0 -0
index 947e8c5..3de8547 100644

drivers/infiniband/hw/bnxt_re/qplib_rcfw.c struct bnxt_qplib_rcfw_sbuf *bnxt_qplib_rcfw_alloc_sbuf( · line 853

Quoted 7 lines
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +1 -1
@@ -848,13 +848,13 @@ struct bnxt_qplib_rcfw_sbuf *bnxt_qplib_rcfw_alloc_sbuf(
 {
 	struct bnxt_qplib_rcfw_sbuf *sbuf;
 
-	sbuf = kzalloc(sizeof(*sbuf), GFP_ATOMIC);
+	sbuf = kzalloc(sizeof(*sbuf), GFP_KERNEL);
 	if (!sbuf)
 		return NULL;

I think that you can do same change in bnxt_re_netdev_event() too.

Quoted 11 lines
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +1 -1
 	sbuf->size = size;
 	sbuf->sb = dma_alloc_coherent(&rcfw->pdev->dev, sbuf->size,
-				      &sbuf->dma_addr, GFP_ATOMIC);
+				      &sbuf->dma_addr, GFP_KERNEL);
 	if (!sbuf->sb)
 		goto bail;
 
Signature · 1 line
2.5.5
author maintainer
#20 lore raw

Re: [PATCH for-next 09/12] RDMA/bnxt_re: Use GFP_KERNEL in non atomic context

Quoted 19 lines · Leon Romanovsky
Quoted 17 lines · Selvin Xavier

Use GFP_KERNEL instead of GFP_ATOMIC while allocating control path structures which will be only called from non atomic context

---
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +0 -0
index 947e8c5..3de8547 100644
@@ -848,13 +848,13 @@ struct bnxt_qplib_rcfw_sbuf *bnxt_qplib_rcfw_alloc_sbuf(
 {
      struct bnxt_qplib_rcfw_sbuf *sbuf;
 
Quoted 6 lines

drivers/infiniband/hw/bnxt_re/qplib_rcfw.c struct bnxt_qplib_rcfw_sbuf *bnxt_qplib_rcfw_alloc_sbuf( · line 853

Quoted 4 lines
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +1 -1
-     sbuf = kzalloc(sizeof(*sbuf), GFP_ATOMIC);
+     sbuf = kzalloc(sizeof(*sbuf), GFP_KERNEL);
      if (!sbuf)
              return NULL;

I think that you can do same change in bnxt_re_netdev_event() too.

Sure.. thanks for pointing it out.

Quoted 12 lines
Quoted 12 lines
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +1 -2
      sbuf->size = size;
      sbuf->sb = dma_alloc_coherent(&rcfw->pdev->dev, sbuf->size,
-                                   &sbuf->dma_addr, GFP_ATOMIC);
+                                   &sbuf->dma_addr, GFP_KERNEL);
      if (!sbuf->sb)
              goto bail;
 
--

2.5.5

author maintainer
#21 lore raw

PATCH 10/12 RDMA/bnxt_re: Correct FRMR size calculation

In reply to Selvin Xavier

FRMR WQE requires to provide the log2 value of the PBL and page size.
Use the standard ilog2 to calculate the log2 value

---
 drivers/infiniband/hw/bnxt_re/ib_verbs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +2 -1
index c4d7a9e..1cbc7e1 100644
@@ -2487,7 +2487,8 @@ static int bnxt_re_build_reg_wqe(const struct ib_reg_wr *wr,
 
 	wqe->frmr.l_key = wr->key;
 	wqe->frmr.length = wr->mr->length;
-	wqe->frmr.pbl_pg_sz_log = (wr->mr->page_size >> PAGE_SHIFT_4K) - 1;
+	wqe->frmr.pbl_pg_sz_log = ilog2(PAGE_SIZE >> PAGE_SHIFT_4K);
+	wqe->frmr.pg_sz_log = ilog2(wr->mr->page_size >> PAGE_SHIFT_4K);
 	wqe->frmr.va = wr->mr->iova;
 	return 0;
 }
Signature · 1 line
2.5.5
Reviewed-by on v1 10/12
#22 lore raw

Re: [PATCH for-next 10/12] RDMA/bnxt_re: Correct FRMR size calculation

Quoted 9 lines · Selvin Xavier

FRMR WQE requires to provide the log2 value of the PBL and page size.
Use the standard ilog2 to calculate the log2 value

---
 drivers/infiniband/hw/bnxt_re/ib_verbs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Thanks,

author maintainer
#23 lore raw

PATCH 11/12 RDMA/bnxt_re: Check if the vlan is valid before reporting

In reply to Selvin Xavier

When VF is configured with default vlan, HW strips the vlan from the packet and driver receives it in Rx completion. VLAN needs to be reported for UD work completion only if the vlan is configured on the host. Add a check for valid vlan in the UD receive path.

---
 drivers/infiniband/hw/bnxt_re/ib_verbs.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +9 -3
index 1cbc7e1..935dbce 100644
@@ -3364,8 +3364,11 @@ static void bnxt_re_process_res_ud_wc(struct bnxt_re_qp *qp,
 				      struct ib_wc *wc,
 				      struct bnxt_qplib_cqe *cqe)
 {
+	struct bnxt_re_dev *rdev;
+	u16 vlan_id = 0;
 	u8 nw_type;
 
+	rdev = qp->rdev;
 	wc->opcode = IB_WC_RECV;
 	wc->status = __rc_to_ib_wc_status(cqe->status);
 
@@ -3377,9 +3380,12 @@ static void bnxt_re_process_res_ud_wc(struct bnxt_re_qp *qp,
 		memcpy(wc->smac, cqe->smac, ETH_ALEN);
 		wc->wc_flags |= IB_WC_WITH_SMAC;
 		if (cqe->flags & CQ_RES_UD_FLAGS_META_FORMAT_VLAN) {
-			wc->vlan_id = (cqe->cfa_meta & 0xFFF);
-			if (wc->vlan_id < 0x1000)
-				wc->wc_flags |= IB_WC_WITH_VLAN;
+			vlan_id = (cqe->cfa_meta & 0xFFF);
+		}
+		/* Mark only if vlan_id is non zero */
+		if (vlan_id && bnxt_re_check_if_vlan_valid(rdev, vlan_id)) {
+			wc->vlan_id = vlan_id;
+			wc->wc_flags |= IB_WC_WITH_VLAN;
 		}
 		nw_type = (cqe->flags & CQ_RES_UD_FLAGS_ROCE_IP_VER_MASK) >>
 			   CQ_RES_UD_FLAGS_ROCE_IP_VER_SFT;
Signature · 1 line
2.5.5
author maintainer
#24 lore raw

PATCH 12/12 MAINTAINERS: Update Broadcom RDMA maintainers

In reply to Selvin Xavier

Updating the bnxt_re maintainers as Naresh
decided to leave Broadcom.

---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)
MAINTAINERS +0 -1
index b25f14a..d7d7c71 100644
@@ -3795,7 +3795,6 @@ F:	drivers/scsi/mpi3mr/
 
 BROADCOM NETXTREME-E ROCE DRIVER
 M:	Selvin Xavier <[email protected]>
-M:	Naresh Kumar PBS <[email protected]>
 L:	[email protected]
 S:	Supported
 W:	http://www.broadcom.com
Signature · 1 line
2.5.5