Skip to contentSkip to conversation

Add Auxiliary driver support

PATCH Superseded Ajit Khaparde 2 participants 15 messages Nov 9, 2022 – Dec 7, 2022

Subsystems (6)

v4 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

v4 cover Add Auxiliary driver support

Add auxiliary device driver for Broadcom devices. The bnxt_en driver will register and initialize an aux device if RDMA is enabled in the underlying device.
The bnxt_re driver will then probe and initialize the RoCE interfaces with the infiniband stack.

We got rid of the bnxt_en_ops which the bnxt_re driver used to communicate with bnxt_en.
Similarly We have tried to clean up most of the bnxt_ulp_ops. In most of the cases we used the functions and entry points provided by the auxiliary bus driver framework.
And now these are the minimal functions needed to support the functionality.

We will try to work on getting rid of the remaining if we find any other viable option in future.

v1->v2:
- Incorporated review comments including usage of ulp_id & complex function indirections.
- Used function calls provided by the auxiliary bus interface instead of proprietary calls.
- Refactor code to remove ROCE driver's access to bnxt structure.

v2->v3:
- Addressed review comments including cleanup of some unnecessary wrappers
- Fixed warnings seen during cross compilation

v3->v4:
- Cleaned up bnxt_ulp.c and bnxt_ulp.h further
- Removed some more dead code
- Sending the patchset as a standalone series

Please apply. Thanks.

Ajit Khaparde (5):
bnxt_en: Add auxiliary driver support RDMA/bnxt_re: Use auxiliary driver interface
bnxt_en: Remove usage of ulp_id
bnxt_en: Use direct API instead of indirection
bnxt_en: Use auxiliary bus calls over proprietary calls

Hongguang Gao (1):
bnxt_en: Remove struct bnxt access from RoCE driver

 drivers/infiniband/hw/bnxt_re/bnxt_re.h       |   9 +-
 drivers/infiniband/hw/bnxt_re/main.c          | 578 +++++++-----------
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |  10 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.h     |   8 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 388 ++++++------
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h |  52 +-
 6 files changed, 463 insertions(+), 582 deletions(-)
Signature · 1 line
2.37.1 (Apple Git-137.1)
#1 lore raw

PATCH v4 1/6 bnxt_en: Add auxiliary driver support

Add auxiliary driver support.
An auxiliary device will be created if the hardware indicates support for RDMA.
The bnxt_ulp_probe() function has been removed and a new bnxt_rdma_aux_device_add() function has been added.
The bnxt_free_msix_vecs() and bnxt_req_msix_vecs() will now hold the RTNL lock when they call the bnxt_close_nic()and bnxt_open_nic() since the device close and open need to be protected under RTNL lock. The operations between the bnxt_en and bnxt_re will be protected using the en_ops_lock.
This will be used by the bnxt_re driver in a follow-on patch to create ROCE interfaces.

---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |   8 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.h     |   8 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 177 +++++++++++++++---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h |   7 +-
 4 files changed, 169 insertions(+), 31 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +6 -2
index d9ad325f7840..16265d177639 100644
@@ -13145,6 +13145,9 @@ static void bnxt_remove_one(struct pci_dev *pdev)
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct bnxt *bp = netdev_priv(dev);
 
+	bnxt_rdma_aux_device_uninit(bp->aux_dev);
+	bnxt_aux_dev_free(bp);
+
 	if (BNXT_PF(bp))
 		bnxt_sriov_disable(bp);
 
@@ -13738,11 +13741,13 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	bnxt_dl_fw_reporters_create(bp);
 
+	bnxt_rdma_aux_device_init(bp);
+
 	bnxt_print_device_info(bp);
 
 	pci_save_state(pdev);
-	return 0;
 
+	return 0;
 init_err_cleanup:
 	bnxt_dl_unregister(bp);
 init_err_dl:
@@ -13786,7 +13791,6 @@ static void bnxt_shutdown(struct pci_dev *pdev)
 	if (netif_running(dev))
 		dev_close(dev);
 
-	bnxt_ulp_shutdown(bp);
 	bnxt_clear_int_mode(bp);
 	pci_disable_device(pdev);
 
drivers/net/ethernet/broadcom/bnxt/bnxt.h +8 -0
index 7611bed4a196..222e1024ffde 100644
@@ -24,6 +24,7 @@
 #include <linux/interrupt.h>
 #include <linux/rhashtable.h>
 #include <linux/crash_dump.h>
+#include <linux/auxiliary_bus.h>
 #include <net/devlink.h>
 #include <net/dst_metadata.h>
 #include <net/xdp.h>
@@ -1622,6 +1623,12 @@ struct bnxt_fw_health {
 #define BNXT_FW_RETRY			5
 #define BNXT_FW_IF_RETRY		10
 
+struct bnxt_aux_dev {
+	struct auxiliary_device aux_dev;
+	struct bnxt_en_dev *edev;
+	int id;
+};
+
 enum board_idx {
 	BCM57301,
 	BCM57302,
@@ -1843,6 +1850,7 @@ struct bnxt {
 #define BNXT_CHIP_P4_PLUS(bp)			\
 	(BNXT_CHIP_P4(bp) || BNXT_CHIP_P5(bp))
 
+	struct bnxt_aux_dev	*aux_dev;
 	struct bnxt_en_dev	*edev;
 
 	struct bnxt_napi	**bnapi;
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +149 -28

266 lines not on this page · raw message

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h +6 -1
index 42b50abc3e91..8b85c663d881 100644
@@ -17,6 +17,7 @@
 #define BNXT_MIN_ROCE_STAT_CTXS	1
 
 struct hwrm_async_event_cmpl;
+struct bnxt_aux_dev;
 struct bnxt;
 
 struct bnxt_msix_entry {
@@ -102,10 +103,14 @@ int bnxt_get_ulp_stat_ctxs(struct bnxt *bp);
 void bnxt_ulp_stop(struct bnxt *bp);
 void bnxt_ulp_start(struct bnxt *bp, int err);
 void bnxt_ulp_sriov_cfg(struct bnxt *bp, int num_vfs);
-void bnxt_ulp_shutdown(struct bnxt *bp);
 void bnxt_ulp_irq_stop(struct bnxt *bp);
 void bnxt_ulp_irq_restart(struct bnxt *bp, int err);
 void bnxt_ulp_async_events(struct bnxt *bp, struct hwrm_async_event_cmpl *cmpl);
+void bnxt_aux_dev_release(struct device *dev);
+int bnxt_rdma_aux_device_add(struct bnxt *bp);
+void bnxt_rdma_aux_device_uninit(struct bnxt_aux_dev *bnxt_adev);
+void bnxt_rdma_aux_device_init(struct bnxt *bp);
+void bnxt_aux_dev_free(struct bnxt *bp);
 struct bnxt_en_dev *bnxt_ulp_probe(struct net_device *dev);
 
 #endif
Signature · 1 line
2.37.1 (Apple Git-137.1)
#2 lore raw

PATCH v4 2/6 RDMA/bnxt_re: Use auxiliary driver interface

In reply to Ajit Khaparde

Use auxiliary driver interface for driver load, unload ROCE driver. The driver does not need to register the interface using the netdev notifier anymore. Removed the bnxt_re_dev_list which is not needed. Currently probe, remove and shutdown ops have been implemented for the auxiliary device.

---
 drivers/infiniband/hw/bnxt_re/bnxt_re.h       |   9 +-
 drivers/infiniband/hw/bnxt_re/main.c          | 389 ++++++------------
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c |  29 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h |   3 -
 4 files changed, 135 insertions(+), 295 deletions(-)
drivers/infiniband/hw/bnxt_re/bnxt_re.h +1 -8
index 785c37cae3c0..b0465c8d229a 100644
@@ -89,13 +89,6 @@ struct bnxt_re_ring_attr {
 	u8		mode;
 };
 
-struct bnxt_re_work {
-	struct work_struct	work;
-	unsigned long		event;
-	struct bnxt_re_dev      *rdev;
-	struct net_device	*vlan_dev;
-};
-
 struct bnxt_re_sqp_entries {
 	struct bnxt_qplib_sge sge;
 	u64 wrid;
@@ -132,6 +125,7 @@ struct bnxt_re_dev {
 #define BNXT_RE_FLAG_ERR_DEVICE_DETACHED       17
 #define BNXT_RE_FLAG_ISSUE_ROCE_STATS          29
 	struct net_device		*netdev;
+	struct notifier_block		nb;
 	unsigned int			version, major, minor;
 	struct bnxt_qplib_chip_ctx	*chip_ctx;
 	struct bnxt_en_dev		*en_dev;
@@ -194,5 +188,4 @@ static inline struct device *rdev_to_dev(struct bnxt_re_dev *rdev)
 		return  &rdev->ibdev.dev;
 	return NULL;
 }
-
 #endif
drivers/infiniband/hw/bnxt_re/main.c +133 -256

557 lines not on this page · raw message

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +1 -28
index 7ffd61ec2683..1d2d30f97ed9 100644
@@ -19,6 +19,7 @@
 #include <linux/irq.h>
 #include <asm/byteorder.h>
 #include <linux/bitmap.h>
+#include <linux/auxiliary_bus.h>
 
 #include "bnxt_hsi.h"
 #include "bnxt.h"
@@ -78,8 +79,6 @@ static int bnxt_unregister_dev(struct bnxt_en_dev *edev, unsigned int ulp_id)
 	if (ulp_id >= BNXT_MAX_ULP)
 		return -EINVAL;
 
-	edev->flags |= BNXT_EN_FLAG_ULP_STOPPED;
-
 	ulp = &edev->ulp_tbl[ulp_id];
 	if (!rcu_access_pointer(ulp->ulp_ops)) {
 		netdev_err(bp->dev, "ulp id %d not registered\n", ulp_id);
@@ -595,29 +594,3 @@ int bnxt_rdma_aux_device_add(struct bnxt *bp)
 
 	return 0;
 }
-
-struct bnxt_en_dev *bnxt_ulp_probe(struct net_device *dev)
-{
-	struct bnxt *bp = netdev_priv(dev);
-	struct bnxt_en_dev *edev;
-
-	edev = bp->edev;
-	if (!edev) {
-		edev = kzalloc(sizeof(*edev), GFP_KERNEL);
-		if (!edev)
-			return ERR_PTR(-ENOMEM);
-		edev->en_ops = &bnxt_en_ops_tbl;
-		edev->net = dev;
-		edev->pdev = bp->pdev;
-		edev->l2_db_size = bp->db_size;
-		edev->l2_db_size_nc = bp->db_size;
-		bp->edev = edev;
-	}
-	edev->flags &= ~BNXT_EN_FLAG_ROCE_CAP;
-	if (bp->flags & BNXT_FLAG_ROCEV1_CAP)
-		edev->flags |= BNXT_EN_FLAG_ROCEV1_CAP;
-	if (bp->flags & BNXT_FLAG_ROCEV2_CAP)
-		edev->flags |= BNXT_EN_FLAG_ROCEV2_CAP;
-	return bp->edev;
-}
-EXPORT_SYMBOL(bnxt_ulp_probe);
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h +0 -3
index 8b85c663d881..aaf55d847505 100644
@@ -32,7 +32,6 @@ struct bnxt_ulp_ops {
 	void (*ulp_stop)(void *);
 	void (*ulp_start)(void *);
 	void (*ulp_sriov_config)(void *, int);
-	void (*ulp_shutdown)(void *);
 	void (*ulp_irq_stop)(void *);
 	void (*ulp_irq_restart)(void *, struct bnxt_msix_entry *);
 };
@@ -111,6 +110,4 @@ int bnxt_rdma_aux_device_add(struct bnxt *bp);
 void bnxt_rdma_aux_device_uninit(struct bnxt_aux_dev *bnxt_adev);
 void bnxt_rdma_aux_device_init(struct bnxt *bp);
 void bnxt_aux_dev_free(struct bnxt *bp);
-struct bnxt_en_dev *bnxt_ulp_probe(struct net_device *dev);
-
 #endif
Signature · 1 line
2.37.1 (Apple Git-137.1)
#3 lore raw

PATCH v4 3/6 bnxt_en: Remove usage of ulp_id

In reply to Ajit Khaparde

Since the driver continues to use the single ULP model, the extra complexity and indirection is unnecessary. Remove the usage of ulp_id from the code.

---
 drivers/infiniband/hw/bnxt_re/main.c          |  24 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |   2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 211 ++++++++----------
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h |  26 +--
 4 files changed, 112 insertions(+), 151 deletions(-)
drivers/infiniband/hw/bnxt_re/main.c +11 -13
index a9fb1067c9a1..e60bc3ce9c3d 100644
@@ -366,8 +366,7 @@ static int bnxt_re_unregister_netdev(struct bnxt_re_dev *rdev)
 
 	en_dev = rdev->en_dev;
 
-	rc = en_dev->en_ops->bnxt_unregister_device(rdev->en_dev,
-						    BNXT_ROCE_ULP);
+	rc = en_dev->en_ops->bnxt_unregister_device(rdev->en_dev);
 	return rc;
 }
 
@@ -381,7 +380,7 @@ static int bnxt_re_register_netdev(struct bnxt_re_dev *rdev)
 
 	en_dev = rdev->en_dev;
 
-	rc = en_dev->en_ops->bnxt_register_device(en_dev, BNXT_ROCE_ULP,
+	rc = en_dev->en_ops->bnxt_register_device(en_dev,
 						  &bnxt_re_ulp_ops, rdev);
 	rdev->qplib_res.pdev = rdev->en_dev->pdev;
 	return rc;
@@ -390,16 +389,15 @@ static int bnxt_re_register_netdev(struct bnxt_re_dev *rdev)
 static int bnxt_re_free_msix(struct bnxt_re_dev *rdev)
 {
 	struct bnxt_en_dev *en_dev;
-	int rc;
 
 	if (!rdev)
 		return -EINVAL;
 
 	en_dev = rdev->en_dev;
 
-	rc = en_dev->en_ops->bnxt_free_msix(rdev->en_dev, BNXT_ROCE_ULP);
+	en_dev->en_ops->bnxt_free_msix(rdev->en_dev);
 
-	return rc;
+	return 0;
 }
 
 static int bnxt_re_request_msix(struct bnxt_re_dev *rdev)
@@ -414,7 +412,7 @@ static int bnxt_re_request_msix(struct bnxt_re_dev *rdev)
 
 	num_msix_want = min_t(u32, BNXT_RE_MAX_MSIX, num_online_cpus());
 
-	num_msix_got = en_dev->en_ops->bnxt_request_msix(en_dev, BNXT_ROCE_ULP,
+	num_msix_got = en_dev->en_ops->bnxt_request_msix(en_dev,
 							 rdev->msix_entries,
 							 num_msix_want);
 	if (num_msix_got < BNXT_RE_MIN_MSIX) {
@@ -477,7 +475,7 @@ static int bnxt_re_net_ring_free(struct bnxt_re_dev *rdev,
 	req.ring_id = cpu_to_le16(fw_ring_id);
 	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);
+	rc = en_dev->en_ops->bnxt_send_fw_msg(en_dev, &fw_msg);
 	if (rc)
 		ibdev_err(&rdev->ibdev, "Failed to free HW ring:%d :%#x",
 			  req.ring_id, rc);
@@ -514,7 +512,7 @@ static int bnxt_re_net_ring_alloc(struct bnxt_re_dev *rdev,
 	req.int_mode = ring_attr->mode;
 	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);
+	rc = en_dev->en_ops->bnxt_send_fw_msg(en_dev, &fw_msg);
 	if (!rc)
 		*fw_ring_id = le16_to_cpu(resp.ring_id);
 
@@ -542,7 +540,7 @@ static int bnxt_re_net_stats_ctx_free(struct bnxt_re_dev *rdev,
 	req.stat_ctx_id = cpu_to_le32(fw_stats_ctx_id);
 	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);
+	rc = en_dev->en_ops->bnxt_send_fw_msg(en_dev, &fw_msg);
 	if (rc)
 		ibdev_err(&rdev->ibdev, "Failed to free HW stats context %#x",
 			  rc);
@@ -575,7 +573,7 @@ static int bnxt_re_net_stats_ctx_alloc(struct bnxt_re_dev *rdev,
 	req.stat_ctx_flags = STAT_CTX_ALLOC_REQ_STAT_CTX_FLAGS_ROCE;
 	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);
+	rc = en_dev->en_ops->bnxt_send_fw_msg(en_dev, &fw_msg);
 	if (!rc)
 		*fw_stats_ctx_id = le32_to_cpu(resp.stat_ctx_id);
 
@@ -1061,7 +1059,7 @@ static int bnxt_re_query_hwrm_pri2cos(struct bnxt_re_dev *rdev, u8 dir,
 
 	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);
+	rc = en_dev->en_ops->bnxt_send_fw_msg(en_dev, &fw_msg);
 	if (rc)
 		return rc;
 
@@ -1247,7 +1245,7 @@ static void bnxt_re_query_hwrm_intf_version(struct bnxt_re_dev *rdev)
 	req.hwrm_intf_upd = HWRM_VERSION_UPDATE;
 	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);
+	rc = en_dev->en_ops->bnxt_send_fw_msg(en_dev, &fw_msg);
 	if (rc) {
 		ibdev_err(&rdev->ibdev, "Failed to query HW version, rc = 0x%x",
 			  rc);
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -1
index 16265d177639..1b573e015b5e 100644
@@ -5533,7 +5533,7 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, u16 vnic_id)
 #endif
 	if ((bp->flags & BNXT_FLAG_STRIP_VLAN) || def_vlan)
 		req->flags |= cpu_to_le32(VNIC_CFG_REQ_FLAGS_VLAN_STRIP_MODE);
-	if (!vnic_id && bnxt_ulp_registered(bp->edev, BNXT_ROCE_ULP))
+	if (!vnic_id && bnxt_ulp_registered(bp->edev))
 		req->flags |= cpu_to_le32(bnxt_get_roce_vnic_mode(bp));
 
 	return hwrm_req_send(bp, req);
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +87 -124

399 lines not on this page · raw message

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h +13 -13
index aaf55d847505..7b2b829300b4 100644
@@ -65,7 +65,7 @@ struct bnxt_en_dev {
 	#define BNXT_EN_FLAG_MSIX_REQUESTED	0x4
 	#define BNXT_EN_FLAG_ULP_STOPPED	0x8
 	const struct bnxt_en_ops	*en_ops;
-	struct bnxt_ulp			ulp_tbl[BNXT_MAX_ULP];
+	struct bnxt_ulp			*ulp_tbl;
 	int				l2_db_size;	/* Doorbell BAR size in
 							 * bytes mapped by L2
 							 * driver.
@@ -77,21 +77,21 @@ struct bnxt_en_dev {
 };
 
 struct bnxt_en_ops {
-	int (*bnxt_register_device)(struct bnxt_en_dev *, unsigned int,
-				    struct bnxt_ulp_ops *, void *);
-	int (*bnxt_unregister_device)(struct bnxt_en_dev *, unsigned int);
-	int (*bnxt_request_msix)(struct bnxt_en_dev *, unsigned int,
-				 struct bnxt_msix_entry *, int);
-	int (*bnxt_free_msix)(struct bnxt_en_dev *, unsigned int);
-	int (*bnxt_send_fw_msg)(struct bnxt_en_dev *, unsigned int,
-				struct bnxt_fw_msg *);
-	int (*bnxt_register_fw_async_events)(struct bnxt_en_dev *, unsigned int,
-					     unsigned long *, u16);
+	int (*bnxt_register_device)(struct bnxt_en_dev *edev,
+				    struct bnxt_ulp_ops *ulp_ops, void *handle);
+	int (*bnxt_unregister_device)(struct bnxt_en_dev *edev);
+	int (*bnxt_request_msix)(struct bnxt_en_dev *edev,
+				 struct bnxt_msix_entry *ent, int num_msix);
+	void (*bnxt_free_msix)(struct bnxt_en_dev *edev);
+	int (*bnxt_send_fw_msg)(struct bnxt_en_dev *edev,
+				struct bnxt_fw_msg *fw_msg);
+	int (*bnxt_register_fw_async_events)(struct bnxt_en_dev *edev,
+					     unsigned long *events_bmap, u16 max_id);
 };
 
-static inline bool bnxt_ulp_registered(struct bnxt_en_dev *edev, int ulp_id)
+static inline bool bnxt_ulp_registered(struct bnxt_en_dev *edev)
 {
-	if (edev && rcu_access_pointer(edev->ulp_tbl[ulp_id].ulp_ops))
+	if (edev && edev->ulp_tbl)
 		return true;
 	return false;
 }
Signature · 1 line
2.37.1 (Apple Git-137.1)
#4 lore raw

PATCH v4 4/6 bnxt_en: Use direct API instead of indirection

In reply to Ajit Khaparde

For a single ULP user there is no need for complicating function indirection calls. Remove all this complexity in favour of direct function calls exported by the bnxt_en driver. This allows to simplify the code greatly.

---
 drivers/infiniband/hw/bnxt_re/main.c          | 71 ++++------------
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 84 ++++---------------
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h | 23 ++---
 3 files changed, 39 insertions(+), 139 deletions(-)
drivers/infiniband/hw/bnxt_re/main.c +16 -55
index e60bc3ce9c3d..021812956f73 100644
@@ -353,23 +353,6 @@ static struct bnxt_ulp_ops bnxt_re_ulp_ops = {
 
 /* RoCE -> Net driver */
 
-/* Driver registration routines used to let the networking driver (bnxt_en)
- * to know that the RoCE driver is now installed
- */
-static int bnxt_re_unregister_netdev(struct bnxt_re_dev *rdev)
-{
-	struct bnxt_en_dev *en_dev;
-	int rc;
-
-	if (!rdev)
-		return -EINVAL;
-
-	en_dev = rdev->en_dev;
-
-	rc = en_dev->en_ops->bnxt_unregister_device(rdev->en_dev);
-	return rc;
-}
-
 static int bnxt_re_register_netdev(struct bnxt_re_dev *rdev)
 {
 	struct bnxt_en_dev *en_dev;
@@ -380,26 +363,12 @@ static int bnxt_re_register_netdev(struct bnxt_re_dev *rdev)
 
 	en_dev = rdev->en_dev;
 
-	rc = en_dev->en_ops->bnxt_register_device(en_dev,
-						  &bnxt_re_ulp_ops, rdev);
-	rdev->qplib_res.pdev = rdev->en_dev->pdev;
+	rc = bnxt_register_dev(en_dev, &bnxt_re_ulp_ops, rdev);
+	if (!rc)
+		rdev->qplib_res.pdev = rdev->en_dev->pdev;
 	return rc;
 }
 
-static int bnxt_re_free_msix(struct bnxt_re_dev *rdev)
-{
-	struct bnxt_en_dev *en_dev;
-
-	if (!rdev)
-		return -EINVAL;
-
-	en_dev = rdev->en_dev;
-
-	en_dev->en_ops->bnxt_free_msix(rdev->en_dev);
-
-	return 0;
-}
-
 static int bnxt_re_request_msix(struct bnxt_re_dev *rdev)
 {
 	int rc = 0, num_msix_want = BNXT_RE_MAX_MSIX, num_msix_got;
@@ -412,9 +381,9 @@ static int bnxt_re_request_msix(struct bnxt_re_dev *rdev)
 
 	num_msix_want = min_t(u32, BNXT_RE_MAX_MSIX, num_online_cpus());
 
-	num_msix_got = en_dev->en_ops->bnxt_request_msix(en_dev,
-							 rdev->msix_entries,
-							 num_msix_want);
+	num_msix_got = bnxt_req_msix_vecs(en_dev,
+					  rdev->msix_entries,
+					  num_msix_want);
 	if (num_msix_got < BNXT_RE_MIN_MSIX) {
 		rc = -EINVAL;
 		goto done;
@@ -475,7 +444,7 @@ static int bnxt_re_net_ring_free(struct bnxt_re_dev *rdev,
 	req.ring_id = cpu_to_le16(fw_ring_id);
 	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, &fw_msg);
+	rc = bnxt_send_msg(en_dev, &fw_msg);
 	if (rc)
 		ibdev_err(&rdev->ibdev, "Failed to free HW ring:%d :%#x",
 			  req.ring_id, rc);
@@ -512,7 +481,7 @@ static int bnxt_re_net_ring_alloc(struct bnxt_re_dev *rdev,
 	req.int_mode = ring_attr->mode;
 	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, &fw_msg);
+	rc = bnxt_send_msg(en_dev, &fw_msg);
 	if (!rc)
 		*fw_ring_id = le16_to_cpu(resp.ring_id);
 
@@ -540,7 +509,7 @@ static int bnxt_re_net_stats_ctx_free(struct bnxt_re_dev *rdev,
 	req.stat_ctx_id = cpu_to_le32(fw_stats_ctx_id);
 	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, &fw_msg);
+	rc = bnxt_send_msg(en_dev, &fw_msg);
 	if (rc)
 		ibdev_err(&rdev->ibdev, "Failed to free HW stats context %#x",
 			  rc);
@@ -573,7 +542,7 @@ static int bnxt_re_net_stats_ctx_alloc(struct bnxt_re_dev *rdev,
 	req.stat_ctx_flags = STAT_CTX_ALLOC_REQ_STAT_CTX_FLAGS_ROCE;
 	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, &fw_msg);
+	rc = bnxt_send_msg(en_dev, &fw_msg);
 	if (!rc)
 		*fw_stats_ctx_id = le32_to_cpu(resp.stat_ctx_id);
 
@@ -1059,7 +1028,7 @@ static int bnxt_re_query_hwrm_pri2cos(struct bnxt_re_dev *rdev, u8 dir,
 
 	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, &fw_msg);
+	rc = bnxt_send_msg(en_dev, &fw_msg);
 	if (rc)
 		return rc;
 
@@ -1245,7 +1214,7 @@ static void bnxt_re_query_hwrm_intf_version(struct bnxt_re_dev *rdev)
 	req.hwrm_intf_upd = HWRM_VERSION_UPDATE;
 	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, &fw_msg);
+	rc = bnxt_send_msg(en_dev, &fw_msg);
 	if (rc) {
 		ibdev_err(&rdev->ibdev, "Failed to query HW version, rc = 0x%x",
 			  rc);
@@ -1308,20 +1277,12 @@ static void bnxt_re_dev_uninit(struct bnxt_re_dev *rdev)
 		bnxt_re_net_ring_free(rdev, rdev->rcfw.creq.ring_id, type);
 		bnxt_qplib_free_rcfw_channel(&rdev->rcfw);
 	}
-	if (test_and_clear_bit(BNXT_RE_FLAG_GOT_MSIX, &rdev->flags)) {
-		rc = bnxt_re_free_msix(rdev);
-		if (rc)
-			ibdev_warn(&rdev->ibdev,
-				   "Failed to free MSI-X vectors: %#x", rc);
-	}
+	if (test_and_clear_bit(BNXT_RE_FLAG_GOT_MSIX, &rdev->flags))
+		bnxt_free_msix_vecs(rdev->en_dev);
 
 	bnxt_re_destroy_chip_ctx(rdev);
-	if (test_and_clear_bit(BNXT_RE_FLAG_NETDEV_REGISTERED, &rdev->flags)) {
-		rc = bnxt_re_unregister_netdev(rdev);
-		if (rc)
-			ibdev_warn(&rdev->ibdev,
-				   "Failed to unregister with netdev: %#x", rc);
-	}
+	if (test_and_clear_bit(BNXT_RE_FLAG_NETDEV_REGISTERED, &rdev->flags))
+		bnxt_unregister_dev(rdev->en_dev);
 }
 
 /* worker thread for polling periodic events. Now used for QoS programming*/
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +16 -68

168 lines not on this page · raw message

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h +7 -16
index 7b2b829300b4..ed03a2da6233 100644
@@ -27,8 +27,6 @@ struct bnxt_msix_entry {
 };
 
 struct bnxt_ulp_ops {
-	/* async_notifier() cannot sleep (in BH context) */
-	void (*ulp_async_notifier)(void *, struct hwrm_async_event_cmpl *);
 	void (*ulp_stop)(void *);
 	void (*ulp_start)(void *);
 	void (*ulp_sriov_config)(void *, int);
@@ -64,7 +62,6 @@ struct bnxt_en_dev {
 						 BNXT_EN_FLAG_ROCEV2_CAP)
 	#define BNXT_EN_FLAG_MSIX_REQUESTED	0x4
 	#define BNXT_EN_FLAG_ULP_STOPPED	0x8
-	const struct bnxt_en_ops	*en_ops;
 	struct bnxt_ulp			*ulp_tbl;
 	int				l2_db_size;	/* Doorbell BAR size in
 							 * bytes mapped by L2
@@ -76,19 +73,6 @@ struct bnxt_en_dev {
 							 */
 };
 
-struct bnxt_en_ops {
-	int (*bnxt_register_device)(struct bnxt_en_dev *edev,
-				    struct bnxt_ulp_ops *ulp_ops, void *handle);
-	int (*bnxt_unregister_device)(struct bnxt_en_dev *edev);
-	int (*bnxt_request_msix)(struct bnxt_en_dev *edev,
-				 struct bnxt_msix_entry *ent, int num_msix);
-	void (*bnxt_free_msix)(struct bnxt_en_dev *edev);
-	int (*bnxt_send_fw_msg)(struct bnxt_en_dev *edev,
-				struct bnxt_fw_msg *fw_msg);
-	int (*bnxt_register_fw_async_events)(struct bnxt_en_dev *edev,
-					     unsigned long *events_bmap, u16 max_id);
-};
-
 static inline bool bnxt_ulp_registered(struct bnxt_en_dev *edev)
 {
 	if (edev && edev->ulp_tbl)
@@ -110,4 +94,11 @@ int bnxt_rdma_aux_device_add(struct bnxt *bp);
 void bnxt_rdma_aux_device_uninit(struct bnxt_aux_dev *bnxt_adev);
 void bnxt_rdma_aux_device_init(struct bnxt *bp);
 void bnxt_aux_dev_free(struct bnxt *bp);
+int bnxt_register_dev(struct bnxt_en_dev *edev, struct bnxt_ulp_ops *ulp_ops,
+		      void *handle);
+void bnxt_unregister_dev(struct bnxt_en_dev *edev);
+int bnxt_req_msix_vecs(struct bnxt_en_dev *edev, struct bnxt_msix_entry *ent,
+		       int num_msix);
+void bnxt_free_msix_vecs(struct bnxt_en_dev *edev);
+int bnxt_send_msg(struct bnxt_en_dev *edev, struct bnxt_fw_msg *fw_msg);
 #endif
Signature · 1 line
2.37.1 (Apple Git-137.1)
#5 lore raw

PATCH v4 5/6 bnxt_en: Use auxiliary bus calls over proprietary calls

In reply to Ajit Khaparde

Wherever possible use the function ops provided by auxiliary bus instead of using proprietary ops.

Defined bnxt_re_suspend and bnxt_re_resume calls which can be invoked by the bnxt_en driver instead of the ULP stop/start calls.

---
 drivers/infiniband/hw/bnxt_re/main.c          | 102 +++++++++++-------
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c |  40 ++++---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h |   2 -
 3 files changed, 87 insertions(+), 57 deletions(-)
drivers/infiniband/hw/bnxt_re/main.c +61 -41
index 021812956f73..b2d9667c02af 100644
@@ -226,45 +226,6 @@ static void bnxt_re_set_resource_limits(struct bnxt_re_dev *rdev)
 		bnxt_re_limit_vf_res(&rdev->qplib_ctx, num_vfs);
 }
 
-/* for handling bnxt_en callbacks later */
-static void bnxt_re_stop(void *p)
-{
-	struct bnxt_re_dev *rdev = p;
-	struct bnxt *bp;
-
-	if (!rdev)
-		return;
-
-	/* L2 driver invokes this callback during device error/crash or device
-	 * reset. Current RoCE driver doesn't recover the device in case of
-	 * error. Handle the error by dispatching fatal events to all qps
-	 * ie. by calling bnxt_re_dev_stop and release the MSIx vectors as
-	 * L2 driver want to modify the MSIx table.
-	 */
-	bp = netdev_priv(rdev->netdev);
-
-	ibdev_info(&rdev->ibdev, "Handle device stop call from L2 driver");
-	/* Check the current device state from L2 structure and move the
-	 * device to detached state if FW_FATAL_COND is set.
-	 * This prevents more commands to HW during clean-up,
-	 * in case the device is already in error.
-	 */
-	if (test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state))
-		set_bit(ERR_DEVICE_DETACHED, &rdev->rcfw.cmdq.flags);
-
-	bnxt_re_dev_stop(rdev);
-	bnxt_re_stop_irq(rdev);
-	/* Move the device states to detached and  avoid sending any more
-	 * commands to HW
-	 */
-	set_bit(BNXT_RE_FLAG_ERR_DEVICE_DETACHED, &rdev->flags);
-	set_bit(ERR_DEVICE_DETACHED, &rdev->rcfw.cmdq.flags);
-}
-
-static void bnxt_re_start(void *p)
-{
-}
-
 static void bnxt_re_sriov_config(void *p, int num_vfs)
 {
 	struct bnxt_re_dev *rdev = p;
@@ -344,8 +305,6 @@ static void bnxt_re_start_irq(void *handle, struct bnxt_msix_entry *ent)
 }
 
 static struct bnxt_ulp_ops bnxt_re_ulp_ops = {
-	.ulp_stop = bnxt_re_stop,
-	.ulp_start = bnxt_re_start,
 	.ulp_sriov_config = bnxt_re_sriov_config,
 	.ulp_irq_stop = bnxt_re_stop_irq,
 	.ulp_irq_restart = bnxt_re_start_irq
@@ -1597,6 +1556,65 @@ static int bnxt_re_probe(struct auxiliary_device *adev,
 	return rc;
 }
 
+static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state)
+{
+	struct bnxt_re_dev *rdev = auxiliary_get_drvdata(adev);
+	struct bnxt *bp;
+
+	if (!rdev)
+		return 0;
+
+	mutex_lock(&bnxt_re_mutex);
+	/* L2 driver may invoke this callback during device error/crash or device
+	 * reset. Current RoCE driver doesn't recover the device in case of
+	 * error. Handle the error by dispatching fatal events to all qps
+	 * ie. by calling bnxt_re_dev_stop and release the MSIx vectors as
+	 * L2 driver want to modify the MSIx table.
+	 */
+	bp = netdev_priv(rdev->netdev);
+
+	ibdev_info(&rdev->ibdev, "Handle device suspend call");
+	/* Check the current device state from L2 structure and move the
+	 * device to detached state if FW_FATAL_COND is set.
+	 * This prevents more commands to HW during clean-up,
+	 * in case the device is already in error.
+	 */
+	if (test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state))
+		set_bit(ERR_DEVICE_DETACHED, &rdev->rcfw.cmdq.flags);
+
+	bnxt_re_dev_stop(rdev);
+	bnxt_re_stop_irq(rdev);
+	/* Move the device states to detached and  avoid sending any more
+	 * commands to HW
+	 */
+	set_bit(BNXT_RE_FLAG_ERR_DEVICE_DETACHED, &rdev->flags);
+	set_bit(ERR_DEVICE_DETACHED, &rdev->rcfw.cmdq.flags);
+	mutex_unlock(&bnxt_re_mutex);
+
+	return 0;
+}
+
+static int bnxt_re_resume(struct auxiliary_device *adev)
+{
+	struct bnxt_re_dev *rdev = auxiliary_get_drvdata(adev);
+
+	if (!rdev)
+		return 0;
+
+	mutex_lock(&bnxt_re_mutex);
+	/* L2 driver may invoke this callback during device recovery, resume.
+	 * reset. Current RoCE driver doesn't recover the device in case of
+	 * error. Handle the error by dispatching fatal events to all qps
+	 * ie. by calling bnxt_re_dev_stop and release the MSIx vectors as
+	 * L2 driver want to modify the MSIx table.
+	 */
+
+	ibdev_info(&rdev->ibdev, "Handle device resume call");
+	mutex_unlock(&bnxt_re_mutex);
+
+	return 0;
+}
+
 static const struct auxiliary_device_id bnxt_re_id_table[] = {
 	{ .name = BNXT_ADEV_NAME ".rdma", },
 	{},
@@ -1609,6 +1627,8 @@ static struct auxiliary_driver bnxt_re_driver = {
 	.probe = bnxt_re_probe,
 	.remove = bnxt_re_remove,
 	.shutdown = bnxt_re_shutdown,
+	.suspend = bnxt_re_suspend,
+	.resume = bnxt_re_resume,
 	.id_table = bnxt_re_id_table,
 };
 
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +26 -14
index bc0982c12702..0df44c14b3fc 100644
@@ -272,26 +272,31 @@ static void bnxt_ulp_put(struct bnxt_ulp *ulp)
 
 void bnxt_ulp_stop(struct bnxt *bp)
 {
+	struct bnxt_aux_dev *bnxt_aux = bp->aux_dev;
 	struct bnxt_en_dev *edev = bp->edev;
-	struct bnxt_ulp_ops *ops;
-	struct bnxt_ulp *ulp;
 
 	if (!edev)
 		return;
 
 	edev->flags |= BNXT_EN_FLAG_ULP_STOPPED;
-	ulp = edev->ulp_tbl;
-	ops = rtnl_dereference(ulp->ulp_ops);
-	if (!ops || !ops->ulp_stop)
-		return;
-	ops->ulp_stop(ulp->handle);
+	if (bnxt_aux) {
+		struct auxiliary_device *adev;
+
+		adev = &bnxt_aux->aux_dev;
+		if (adev->dev.driver) {
+			struct auxiliary_driver *adrv;
+			pm_message_t pm = {};
+
+			adrv = to_auxiliary_drv(adev->dev.driver);
+			adrv->suspend(adev, pm);
+		}
+	}
 }
 
 void bnxt_ulp_start(struct bnxt *bp, int err)
 {
+	struct bnxt_aux_dev *bnxt_aux = bp->aux_dev;
 	struct bnxt_en_dev *edev = bp->edev;
-	struct bnxt_ulp_ops *ops;
-	struct bnxt_ulp *ulp;
 
 	if (!edev)
 		return;
@@ -301,11 +306,18 @@ void bnxt_ulp_start(struct bnxt *bp, int err)
 	if (err)
 		return;
 
-	ulp = edev->ulp_tbl;
-	ops = rtnl_dereference(ulp->ulp_ops);
-	if (!ops || !ops->ulp_start)
-		return;
-	ops->ulp_start(ulp->handle);
+	if (bnxt_aux) {
+		struct auxiliary_device *adev;
+
+		adev = &bnxt_aux->aux_dev;
+		if (adev->dev.driver) {
+			struct auxiliary_driver *adrv;
+
+			adrv = to_auxiliary_drv(adev->dev.driver);
+			adrv->resume(adev);
+		}
+	}
+
 }
 
 void bnxt_ulp_sriov_cfg(struct bnxt *bp, int num_vfs)
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h +0 -2
index ed03a2da6233..f76f06413a88 100644
@@ -27,8 +27,6 @@ struct bnxt_msix_entry {
 };
 
 struct bnxt_ulp_ops {
-	void (*ulp_stop)(void *);
-	void (*ulp_start)(void *);
 	void (*ulp_sriov_config)(void *, int);
 	void (*ulp_irq_stop)(void *);
 	void (*ulp_irq_restart)(void *, struct bnxt_msix_entry *);
Signature · 1 line
2.37.1 (Apple Git-137.1)
#6 lore raw

PATCH v4 6/6 bnxt_en: Remove struct bnxt access from RoCE driver

In reply to Ajit Khaparde

From: Hongguang Gao <[email protected]>

Decouple RoCE driver from directly accessing L2's private bnxt structure. Move the fields needed by RoCE driver into bnxt_en_dev. They'll be passed to RoCE driver by bnxt_rdma_aux_device_add() function.

---
 drivers/infiniband/hw/bnxt_re/main.c          | 22 ++++++-------------
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c |  9 ++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h | 11 ++++++++++
 3 files changed, 27 insertions(+), 15 deletions(-)
drivers/infiniband/hw/bnxt_re/main.c +7 -15
index b2d9667c02af..2997b1949de9 100644
@@ -112,16 +112,14 @@ static int bnxt_re_setup_chip_ctx(struct bnxt_re_dev *rdev, u8 wqe_mode)
 {
 	struct bnxt_qplib_chip_ctx *chip_ctx;
 	struct bnxt_en_dev *en_dev;
-	struct bnxt *bp;
 
 	en_dev = rdev->en_dev;
-	bp = netdev_priv(en_dev->net);
 
 	chip_ctx = kzalloc(sizeof(*chip_ctx), GFP_KERNEL);
 	if (!chip_ctx)
 		return -ENOMEM;
-	chip_ctx->chip_num = bp->chip_num;
-	chip_ctx->hw_stats_size = bp->hw_ring_stats_size;
+	chip_ctx->chip_num = en_dev->chip_num;
+	chip_ctx->hw_stats_size = en_dev->hw_ring_stats_size;
 
 	rdev->chip_ctx = chip_ctx;
 	/* rest members to follow eventually */
@@ -129,7 +127,7 @@ 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);
+	rdev->qplib_res.is_vf = BNXT_EN_VF(en_dev);
 
 	bnxt_re_set_drv_mode(rdev, wqe_mode);
 	if (bnxt_qplib_determine_atomics(en_dev->pdev))
@@ -142,10 +140,7 @@ static int bnxt_re_setup_chip_ctx(struct bnxt_re_dev *rdev, u8 wqe_mode)
 
 static void bnxt_re_get_sriov_func_type(struct bnxt_re_dev *rdev)
 {
-	struct bnxt *bp;
-
-	bp = netdev_priv(rdev->en_dev->net);
-	if (BNXT_VF(bp))
+	if (BNXT_EN_VF(rdev->en_dev))
 		rdev->is_virtfn = 1;
 }
 
@@ -966,7 +961,6 @@ static int bnxt_re_query_hwrm_pri2cos(struct bnxt_re_dev *rdev, u8 dir,
 				      u64 *cid_map)
 {
 	struct hwrm_queue_pri2cos_qcfg_input req = {0};
-	struct bnxt *bp = netdev_priv(rdev->netdev);
 	struct hwrm_queue_pri2cos_qcfg_output resp;
 	struct bnxt_en_dev *en_dev = rdev->en_dev;
 	struct bnxt_fw_msg fw_msg;
@@ -983,7 +977,7 @@ static int bnxt_re_query_hwrm_pri2cos(struct bnxt_re_dev *rdev, u8 dir,
 	flags |= (dir & 0x01);
 	flags |= HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN;
 	req.flags = cpu_to_le32(flags);
-	req.port_id = bp->pf.port_id;
+	req.port_id = en_dev->pf_port_id;
 
 	bnxt_re_fill_fw_msg(&fw_msg, (void *)&req, sizeof(req), (void *)&resp,
 			    sizeof(resp), DFLT_HWRM_CMD_TIMEOUT);
@@ -1559,7 +1553,6 @@ static int bnxt_re_probe(struct auxiliary_device *adev,
 static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state)
 {
 	struct bnxt_re_dev *rdev = auxiliary_get_drvdata(adev);
-	struct bnxt *bp;
 
 	if (!rdev)
 		return 0;
@@ -1571,15 +1564,14 @@ static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state)
 	 * ie. by calling bnxt_re_dev_stop and release the MSIx vectors as
 	 * L2 driver want to modify the MSIx table.
 	 */
-	bp = netdev_priv(rdev->netdev);
 
 	ibdev_info(&rdev->ibdev, "Handle device suspend call");
-	/* Check the current device state from L2 structure and move the
+	/* Check the current device state from bnxt_en_dev and move the
 	 * device to detached state if FW_FATAL_COND is set.
 	 * This prevents more commands to HW during clean-up,
 	 * in case the device is already in error.
 	 */
-	if (test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state))
+	if (test_bit(BNXT_STATE_FW_FATAL_COND, &rdev->en_dev->en_state))
 		set_bit(ERR_DEVICE_DETACHED, &rdev->rcfw.cmdq.flags);
 
 	bnxt_re_dev_stop(rdev);
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +9 -0
index 0df44c14b3fc..a8357fc503bb 100644
@@ -288,6 +288,7 @@ void bnxt_ulp_stop(struct bnxt *bp)
 			pm_message_t pm = {};
 
 			adrv = to_auxiliary_drv(adev->dev.driver);
+			edev->en_state = bp->state;
 			adrv->suspend(adev, pm);
 		}
 	}
@@ -314,6 +315,7 @@ void bnxt_ulp_start(struct bnxt *bp, int err)
 			struct auxiliary_driver *adrv;
 
 			adrv = to_auxiliary_drv(adev->dev.driver);
+			edev->en_state = bp->state;
 			adrv->resume(adev);
 		}
 	}
@@ -475,6 +477,13 @@ static inline void bnxt_set_edev_info(struct bnxt_en_dev *edev, struct bnxt *bp)
 		edev->flags |= BNXT_EN_FLAG_ROCEV1_CAP;
 	if (bp->flags & BNXT_FLAG_ROCEV2_CAP)
 		edev->flags |= BNXT_EN_FLAG_ROCEV2_CAP;
+	if (bp->flags & BNXT_FLAG_VF)
+		edev->flags |= BNXT_EN_FLAG_VF;
+
+	edev->chip_num = bp->chip_num;
+	edev->hw_ring_stats_size = bp->hw_ring_stats_size;
+	edev->pf_port_id = bp->pf.port_id;
+	edev->en_state = bp->state;
 }
 
 int bnxt_rdma_aux_device_add(struct bnxt *bp)
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.h +11 -0
index f76f06413a88..a065ecda6838 100644
@@ -60,6 +60,9 @@ struct bnxt_en_dev {
 						 BNXT_EN_FLAG_ROCEV2_CAP)
 	#define BNXT_EN_FLAG_MSIX_REQUESTED	0x4
 	#define BNXT_EN_FLAG_ULP_STOPPED	0x8
+	#define BNXT_EN_FLAG_VF			0x10
+#define BNXT_EN_VF(edev)	((edev)->flags & BNXT_EN_FLAG_VF)
+
 	struct bnxt_ulp			*ulp_tbl;
 	int				l2_db_size;	/* Doorbell BAR size in
 							 * bytes mapped by L2
@@ -69,6 +72,14 @@ struct bnxt_en_dev {
 							 * bytes mapped as non-
 							 * cacheable.
 							 */
+	u16				chip_num;
+	u16				hw_ring_stats_size;
+	u16				pf_port_id;
+	unsigned long			en_state;	/* Could be checked in
+							 * RoCE driver suspend
+							 * mode only. Will be
+							 * updated in resume.
+							 */
 };
 
 static inline bool bnxt_ulp_registered(struct bnxt_en_dev *edev)
Signature · 1 line
2.37.1 (Apple Git-137.1)
#7 lore raw
In reply to Ajit Khaparde
Quoted 13 lines · Ajit Khaparde

Add auxiliary device driver for Broadcom devices. The bnxt_en driver will register and initialize an aux device if RDMA is enabled in the underlying device.
The bnxt_re driver will then probe and initialize the RoCE interfaces with the infiniband stack.

We got rid of the bnxt_en_ops which the bnxt_re driver used to communicate with bnxt_en.
Similarly We have tried to clean up most of the bnxt_ulp_ops. In most of the cases we used the functions and entry points provided by the auxiliary bus driver framework.
And now these are the minimal functions needed to support the functionality.

Quoted 2 lines

We will try to work on getting rid of the remaining if we find any other viable option in future.

I still see extra checks for something that was already checked in upper functions, for example in bnxt_re_register_netdev() you check rdev, which you already checked before.

However, the most important part is still existence of bnxt_ulp_ops, which shows completely no-go thing - SR-IOV config in RDMA code.

302 static struct bnxt_ulp_ops bnxt_re_ulp_ops = {

   303         .ulp_sriov_config = bnxt_re_sriov_config,
   304         .ulp_irq_stop = bnxt_re_stop_irq,
   305         .ulp_irq_restart = bnxt_re_start_irq

306 };

All PCI management logic and interfaces are needed to be inside eth part of your driver and only that part should implement SR-IOV config. Once user enabled SR-IOV, the PCI driver should create auxiliary devices for each VF. These device will have RDMA capabilities and it will trigger RDMA driver to bind to them.

Thanks

#8 lore raw

Leon,
We appreciate your valuable feedback.
Please see inline.

Quoted 15 lines · Leon Romanovsky
Quoted 13 lines · Ajit Khaparde

Add auxiliary device driver for Broadcom devices. The bnxt_en driver will register and initialize an aux device if RDMA is enabled in the underlying device.
The bnxt_re driver will then probe and initialize the RoCE interfaces with the infiniband stack.

We got rid of the bnxt_en_ops which the bnxt_re driver used to communicate with bnxt_en.
Similarly We have tried to clean up most of the bnxt_ulp_ops. In most of the cases we used the functions and entry points provided by the auxiliary bus driver framework.
And now these are the minimal functions needed to support the functionality.

Quoted 6 lines
Quoted 2 lines

We will try to work on getting rid of the remaining if we find any other viable option in future.

I still see extra checks for something that was already checked in upper functions, for example in bnxt_re_register_netdev() you check rdev, which you already checked before.

Sure. I will do another sweep and clean up.

Quoted 8 lines

However, the most important part is still existence of bnxt_ulp_ops, which shows completely no-go thing - SR-IOV config in RDMA code.

302 static struct bnxt_ulp_ops bnxt_re_ulp_ops = {

   303         .ulp_sriov_config = bnxt_re_sriov_config,
   304         .ulp_irq_stop = bnxt_re_stop_irq,
   305         .ulp_irq_restart = bnxt_re_start_irq
Quoted 7 lines

306 };

All PCI management logic and interfaces are needed to be inside eth part of your driver and only that part should implement SR-IOV config. Once user enabled SR-IOV, the PCI driver should create auxiliary devices for each VF. These device will have RDMA capabilities and it will trigger RDMA driver to bind to them.

I agree and once the PF creates the auxiliary devices for the VF, the RoCE Vf indeed get probed and created. But the twist in bnxt_en/bnxt_re design is that
the RoCE driver is responsible for making adjustments to the RoCE resources.

So once the VF's are created and the bnxt_en driver enables SRIOV adjusts the NIC resources for the VF, and such, it tries to call into the bnxt_re driver for the
same purpose.

1. We do something like this to the auxiliary_device structure:

include/linux/auxiliary_bus.h +2 -0
index de21d9d24a95..4e581fbf458f 100644
@@ -148,6 +148,7 @@ struct auxiliary_device {
  * @shutdown: Called at shut-down time to quiesce the device.
  * @suspend: Called to put the device to sleep mode. Usually to a power state.
  * @resume: Called to bring a device from sleep mode.
+ * @sriov_configure: Called to allow configuration of VFs .
  * @name: Driver name.
  * @driver: Core driver structure.
  * @id_table: Table of devices this driver should match on the bus.
@@ -183,6 +184,7 @@ struct auxiliary_driver {
        void (*shutdown)(struct auxiliary_device *auxdev);
        int (*suspend)(struct auxiliary_device *auxdev, pm_message_t state);
        int (*resume)(struct auxiliary_device *auxdev);
+       int (*sriov_configure)(struct auxiliary_device *auxdev, int

num_vfs); /* On PF */

        const char *name;
        struct device_driver driver;
        const struct auxiliary_device_id *id_table;

Then the bnxt_en driver could call into bnxt_re via that interface.

Please let me know what you feel.

2. While it may take care of the first function in the ulp_ops, it leaves us with two.
And that is where I will need some input if we need to absolutely get rid of the ops.

2a. We may be able to use the auxiliary_device suspend & resume with a private flag
in the driver's aux_dev pointer.
2b. Or just like (1) above, add another hook to auxiliary_driver void (*restart)(struct auxiliary_device *auxdev);
And then use the auxiliary_driver shutdown & restart with a private flag.

Note that we may get creative right now and get rid of the ulp_ops. But the bnxt_en driver having a need to update the bnxt_re driver is a part of the
design. So it will help if we can consider beyond the ulp_irq_stop, ulp_irq_restart.
2c. Maybe keep the bnxt_ulp_ops for that reason?

Thank you for your time.

Thanks
Ajit

Quoted 2 lines

Thanks

#9 lore raw
Quoted 43 lines · Ajit Khaparde

Leon,
We appreciate your valuable feedback.
Please see inline.

Quoted 15 lines · Leon Romanovsky
Quoted 13 lines · Ajit Khaparde

Add auxiliary device driver for Broadcom devices. The bnxt_en driver will register and initialize an aux device if RDMA is enabled in the underlying device.
The bnxt_re driver will then probe and initialize the RoCE interfaces with the infiniband stack.

We got rid of the bnxt_en_ops which the bnxt_re driver used to communicate with bnxt_en.
Similarly We have tried to clean up most of the bnxt_ulp_ops. In most of the cases we used the functions and entry points provided by the auxiliary bus driver framework.
And now these are the minimal functions needed to support the functionality.

Quoted 6 lines
Quoted 2 lines

We will try to work on getting rid of the remaining if we find any other viable option in future.

I still see extra checks for something that was already checked in upper functions, for example in bnxt_re_register_netdev() you check rdev, which you already checked before.

Sure. I will do another sweep and clean up.

Quoted 8 lines

However, the most important part is still existence of bnxt_ulp_ops, which shows completely no-go thing - SR-IOV config in RDMA code.

302 static struct bnxt_ulp_ops bnxt_re_ulp_ops = {

   303         .ulp_sriov_config = bnxt_re_sriov_config,
   304         .ulp_irq_stop = bnxt_re_stop_irq,
   305         .ulp_irq_restart = bnxt_re_start_irq
Quoted 7 lines

306 };

All PCI management logic and interfaces are needed to be inside eth part of your driver and only that part should implement SR-IOV config. Once user enabled SR-IOV, the PCI driver should create auxiliary devices for each VF. These device will have RDMA capabilities and it will trigger RDMA driver to bind to them.

Quoted 4 lines

I agree and once the PF creates the auxiliary devices for the VF, the RoCE Vf indeed get probed and created. But the twist in bnxt_en/bnxt_re design is that
the RoCE driver is responsible for making adjustments to the RoCE resources.

You can still do these adjustments by checking type of function that called to RDMA .probe. PCI core exposes some functions to help distinguish between PF and VFs.

Quoted 5 lines

So once the VF's are created and the bnxt_en driver enables SRIOV adjusts the NIC resources for the VF, and such, it tries to call into the bnxt_re driver for the
same purpose.

If I read code correctly, all these resources are for one PCI function.

Something like this:

bnxt_re_probe()
{
...

	if (is_virtfn(p))
		 bnxt_re_sriov_config(p);

...
}

Quoted 21 lines

1. We do something like this to the auxiliary_device structure:

include/linux/auxiliary_bus.h +2 -0
index de21d9d24a95..4e581fbf458f 100644
@@ -148,6 +148,7 @@ struct auxiliary_device {
  * @shutdown: Called at shut-down time to quiesce the device.
  * @suspend: Called to put the device to sleep mode. Usually to a power state.
  * @resume: Called to bring a device from sleep mode.
+ * @sriov_configure: Called to allow configuration of VFs .
  * @name: Driver name.
  * @driver: Core driver structure.
  * @id_table: Table of devices this driver should match on the bus.
@@ -183,6 +184,7 @@ struct auxiliary_driver {
        void (*shutdown)(struct auxiliary_device *auxdev);
        int (*suspend)(struct auxiliary_device *auxdev, pm_message_t state);
        int (*resume)(struct auxiliary_device *auxdev);
+       int (*sriov_configure)(struct auxiliary_device *auxdev, int

num_vfs); /* On PF */

Quoted 6 lines
        const char *name;
        struct device_driver driver;
        const struct auxiliary_device_id *id_table;

Then the bnxt_en driver could call into bnxt_re via that interface.

@sriov_configure callback is PCI specific and doesn't belong to aux devices.

Quoted 14 lines

Please let me know what you feel.

2. While it may take care of the first function in the ulp_ops, it leaves us with two.
And that is where I will need some input if we need to absolutely get rid of the ops.

2a. We may be able to use the auxiliary_device suspend & resume with a private flag
in the driver's aux_dev pointer.
2b. Or just like (1) above, add another hook to auxiliary_driver void (*restart)(struct auxiliary_device *auxdev);
And then use the auxiliary_driver shutdown & restart with a private flag.

Quoted 6 lines

Note that we may get creative right now and get rid of the ulp_ops. But the bnxt_en driver having a need to update the bnxt_re driver is a part of the
design. So it will help if we can consider beyond the ulp_irq_stop, ulp_irq_restart.
2c. Maybe keep the bnxt_ulp_ops for that reason?

It is nicer to get rid from bnxt_ulp_ops completely, but it is not must. To get rid from sriov_configure is the most important comment here.

Thanks

Quoted 8 lines

Thank you for your time.

Thanks
Ajit

Quoted 2 lines

Thanks

#10 lore raw
Quoted 1 line · Leon Romanovsky

::snip::

Quoted 24 lines
Quoted 9 lines
Quoted 5 lines

All PCI management logic and interfaces are needed to be inside eth part of your driver and only that part should implement SR-IOV config. Once user enabled SR-IOV, the PCI driver should create auxiliary devices for each VF. These device will have RDMA capabilities and it will trigger RDMA driver to bind to them.

I agree and once the PF creates the auxiliary devices for the VF, the RoCE Vf indeed get probed and created. But the twist in bnxt_en/bnxt_re design is that
the RoCE driver is responsible for making adjustments to the RoCE resources.

You can still do these adjustments by checking type of function that called to RDMA .probe. PCI core exposes some functions to help distinguish between PF and VFs.

Quoted 5 lines

So once the VF's are created and the bnxt_en driver enables SRIOV adjusts the NIC resources for the VF, and such, it tries to call into the bnxt_re driver for the
same purpose.

If I read code correctly, all these resources are for one PCI function.

Something like this:

Quoted 7 lines

bnxt_re_probe()
{
...

        if (is_virtfn(p))
                 bnxt_re_sriov_config(p);

...
}

I understand what you are suggesting.
But what I want is a way to do this in the context of the PF preferably before the VFs are probed. So we are trying to call the bnxt_re_sriov_config in the context of handling the PF's sriov_configure implementation. Having the ulp_ops is allowing us to avoid resource wastage and assumptions in the bnxt_re driver.

::snip::

#11 lore raw
Quoted 34 lines · Ajit Khaparde
Quoted 1 line · Leon Romanovsky

::snip::

Quoted 24 lines
Quoted 9 lines
Quoted 5 lines

All PCI management logic and interfaces are needed to be inside eth part of your driver and only that part should implement SR-IOV config. Once user enabled SR-IOV, the PCI driver should create auxiliary devices for each VF. These device will have RDMA capabilities and it will trigger RDMA driver to bind to them.

I agree and once the PF creates the auxiliary devices for the VF, the RoCE Vf indeed get probed and created. But the twist in bnxt_en/bnxt_re design is that
the RoCE driver is responsible for making adjustments to the RoCE resources.

You can still do these adjustments by checking type of function that called to RDMA .probe. PCI core exposes some functions to help distinguish between PF and VFs.

Quoted 5 lines

So once the VF's are created and the bnxt_en driver enables SRIOV adjusts the NIC resources for the VF, and such, it tries to call into the bnxt_re driver for the
same purpose.

If I read code correctly, all these resources are for one PCI function.

Something like this:

Quoted 7 lines

bnxt_re_probe()
{
...

        if (is_virtfn(p))
                 bnxt_re_sriov_config(p);

...
}

Quoted 3 lines

I understand what you are suggesting.
But what I want is a way to do this in the context of the PF preferably before the VFs are probed.

I don't understand the last sentence. You call to this sriov_config in bnxt_re driver without any protection from VFs being probed,

Quoted 4 lines

So we are trying to call the
bnxt_re_sriov_config in the context of handling the PF's sriov_configure implementation. Having the ulp_ops is allowing us to avoid resource wastage and assumptions in the bnxt_re driver.

To which resource wastage are you referring?

There are no differences if same limits will be in bnxt_en driver when RDMA bnxt device is created or in bnxt_re which will be called once RDMA device is created.

Thanks

Quoted 2 lines

::snip::

#12 lore raw
Quoted 36 lines · Leon Romanovsky
Quoted 34 lines · Ajit Khaparde
Quoted 1 line · Leon Romanovsky

::snip::

Quoted 31 lines
Quoted 9 lines
Quoted 5 lines

All PCI management logic and interfaces are needed to be inside eth part of your driver and only that part should implement SR-IOV config. Once user enabled SR-IOV, the PCI driver should create auxiliary devices for each VF. These device will have RDMA capabilities and it will trigger RDMA driver to bind to them.

I agree and once the PF creates the auxiliary devices for the VF, the RoCE Vf indeed get probed and created. But the twist in bnxt_en/bnxt_re design is that
the RoCE driver is responsible for making adjustments to the RoCE resources.

You can still do these adjustments by checking type of function that called to RDMA .probe. PCI core exposes some functions to help distinguish between PF and VFs.

Quoted 5 lines

So once the VF's are created and the bnxt_en driver enables SRIOV adjusts the NIC resources for the VF, and such, it tries to call into the bnxt_re driver for the
same purpose.

If I read code correctly, all these resources are for one PCI function.

Something like this:

bnxt_re_probe()
{
...

        if (is_virtfn(p))
                 bnxt_re_sriov_config(p);

...
}

Quoted 6 lines
Quoted 3 lines

I understand what you are suggesting.
But what I want is a way to do this in the context of the PF preferably before the VFs are probed.

I don't understand the last sentence. You call to this sriov_config in bnxt_re driver without any protection from VFs being probed,

Let me elaborate -
When a user sets num_vfs to a non-zero number, the PCI driver hook sriov_configure calls bnxt_sriov_configure(). Once pci_enable_sriov() succeeds, bnxt_ulp_sriov_cfg() is issued under bnxt_sriov_configure(). All this happens under bnxt_en.
bnxt_ulp_sriov_cfg() ultimately calls into the bnxt_re driver. Since bnxt_sriov_configure() is called only for PFs, bnxt_ulp_sriov_cfg() is called for PFs only.

Once bnxt_ulp_sriov_cfg() calls into the bnxt_re via the ulp_ops, it adjusts the QPs, SRQs, CQs, MRs, GIDs and such.

Quoted 7 lines
Quoted 5 lines

So we are trying to call the
bnxt_re_sriov_config in the context of handling the PF's sriov_configure implementation. Having the ulp_ops is allowing us to avoid resource wastage and assumptions in the bnxt_re driver.

To which resource wastage are you referring?

Essentially the PF driver reserves a set of above resources for the PF, and divides the remaining resources among the VFs.
If the calculation is based on sriov_totalvfs instead of sriov_numvfs, there can be a difference in the resources provisioned for a VF. And that is because a user may create a subset of VFs instead of the total VFs allowed in the PCI SR-IOV capability register.
I was referring to the resource wastage in that deployment scenario.

Thanks
Ajit

Quoted 11 lines

There are no differences if same limits will be in bnxt_en driver when RDMA bnxt device is created or in bnxt_re which will be called once RDMA device is created.

Thanks

Quoted 2 lines

::snip::

#13 lore raw
Quoted 53 lines · Ajit Khaparde
Quoted 36 lines · Leon Romanovsky
Quoted 34 lines · Ajit Khaparde
Quoted 1 line · Leon Romanovsky

::snip::

Quoted 31 lines
Quoted 9 lines
Quoted 5 lines

All PCI management logic and interfaces are needed to be inside eth part of your driver and only that part should implement SR-IOV config. Once user enabled SR-IOV, the PCI driver should create auxiliary devices for each VF. These device will have RDMA capabilities and it will trigger RDMA driver to bind to them.

I agree and once the PF creates the auxiliary devices for the VF, the RoCE Vf indeed get probed and created. But the twist in bnxt_en/bnxt_re design is that
the RoCE driver is responsible for making adjustments to the RoCE resources.

You can still do these adjustments by checking type of function that called to RDMA .probe. PCI core exposes some functions to help distinguish between PF and VFs.

Quoted 5 lines

So once the VF's are created and the bnxt_en driver enables SRIOV adjusts the NIC resources for the VF, and such, it tries to call into the bnxt_re driver for the
same purpose.

If I read code correctly, all these resources are for one PCI function.

Something like this:

bnxt_re_probe()
{
...

        if (is_virtfn(p))
                 bnxt_re_sriov_config(p);

...
}

Quoted 6 lines
Quoted 3 lines

I understand what you are suggesting.
But what I want is a way to do this in the context of the PF preferably before the VFs are probed.

I don't understand the last sentence. You call to this sriov_config in bnxt_re driver without any protection from VFs being probed,

Let me elaborate -
When a user sets num_vfs to a non-zero number, the PCI driver hook sriov_configure calls bnxt_sriov_configure(). Once pci_enable_sriov() succeeds, bnxt_ulp_sriov_cfg() is issued under bnxt_sriov_configure(). All this happens under bnxt_en.
bnxt_ulp_sriov_cfg() ultimately calls into the bnxt_re driver. Since bnxt_sriov_configure() is called only for PFs, bnxt_ulp_sriov_cfg() is called for PFs only.

Quoted 2 lines

Once bnxt_ulp_sriov_cfg() calls into the bnxt_re via the ulp_ops, it adjusts the QPs, SRQs, CQs, MRs, GIDs and such.

Once you called to pci_enable_sriov(), PCI core created sysfs entries and it triggers udev rules and VFs probe. Because you are calling it in bnxt_sriov_configure(), you will have inherit protection for PF with PCI lock, but not for VFs.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

So we are trying to call the
bnxt_re_sriov_config in the context of handling the PF's sriov_configure implementation. Having the ulp_ops is allowing us to avoid resource wastage and assumptions in the bnxt_re driver.

Quoted 8 lines
Quoted 1 line

To which resource wastage are you referring?

Essentially the PF driver reserves a set of above resources for the PF, and divides the remaining resources among the VFs.
If the calculation is based on sriov_totalvfs instead of sriov_numvfs, there can be a difference in the resources provisioned for a VF. And that is because a user may create a subset of VFs instead of the total VFs allowed in the PCI SR-IOV capability register.
I was referring to the resource wastage in that deployment scenario.

It is ok, set all needed limits in bnxt_en. You don't need to call to bnxt_re for that.

Quoted 15 lines

Thanks
Ajit

Quoted 11 lines

There are no differences if same limits will be in bnxt_en driver when RDMA bnxt device is created or in bnxt_re which will be called once RDMA device is created.

Thanks

Quoted 2 lines

::snip::

#14 lore raw
Quoted 4 lines · Leon Romanovsky
Quoted 2 lines · Ajit Khaparde
Quoted 1 line · Leon Romanovsky

::: snip :::

Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

So we are trying to call the
bnxt_re_sriov_config in the context of handling the PF's sriov_configure implementation. Having the ulp_ops is allowing us to avoid resource wastage and assumptions in the bnxt_re driver.

Quoted 8 lines
Quoted 1 line

To which resource wastage are you referring?

Essentially the PF driver reserves a set of above resources for the PF, and divides the remaining resources among the VFs.
If the calculation is based on sriov_totalvfs instead of sriov_numvfs, there can be a difference in the resources provisioned for a VF. And that is because a user may create a subset of VFs instead of the total VFs allowed in the PCI SR-IOV capability register.
I was referring to the resource wastage in that deployment scenario.

Quoted 2 lines

It is ok, set all needed limits in bnxt_en. You don't need to call to bnxt_re for that.

Thanks. We have removed the sriov_config callback. I will send the fresh patchset in a few minutes.

Quoted 18 lines
Quoted 16 lines

Thanks
Ajit

Quoted 11 lines

There are no differences if same limits will be in bnxt_en driver when RDMA bnxt device is created or in bnxt_re which will be called once RDMA device is created.

Thanks

Quoted 2 lines

::snip::