Commit 9ac543c0 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'aux-bus-v11' of https://github.com/ajitkhaparde1/linux

Ajit Khaparde says:

====================
bnxt: 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.

* 'aux-bus-v11' of https://github.com/ajitkhaparde1/linux:
  bnxt_en: Remove runtime interrupt vector allocation
  RDMA/bnxt_re: Remove the sriov config callback
  bnxt_en: Remove struct bnxt access from RoCE driver
  bnxt_en: Use auxiliary bus calls over proprietary calls
  bnxt_en: Use direct API instead of indirection
  bnxt_en: Remove usage of ulp_id
  RDMA/bnxt_re: Use auxiliary driver interface
  bnxt_en: Add auxiliary driver support
====================

Link: https://lore.kernel.org/r/20230202033809.3989-1-ajit.khaparde@broadcom.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents c21adf25 30343221
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -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,10 +125,10 @@ 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;
	struct bnxt_msix_entry		msix_entries[BNXT_RE_MAX_MSIX];
	int				num_msix;

	int				id;
@@ -194,5 +187,4 @@ static inline struct device *rdev_to_dev(struct bnxt_re_dev *rdev)
		return  &rdev->ibdev.dev;
	return NULL;
}

#endif
+225 −410

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -213,6 +213,7 @@ config BNXT
	select NET_DEVLINK
	select PAGE_POOL
	select DIMLIB
	select AUXILIARY_BUS
	help
	  This driver supports Broadcom NetXtreme-C/E 10/25/40/50 gigabit
	  Ethernet cards.  To compile this driver as a module, choose M here:
+6 −4
Original line number Diff line number Diff line
@@ -2414,7 +2414,6 @@ static int bnxt_async_event_process(struct bnxt *bp,
	}
	bnxt_queue_sp_work(bp);
async_event_process_exit:
	bnxt_ulp_async_events(bp, cmpl);
	return 0;
}

@@ -5538,7 +5537,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);
@@ -13181,6 +13180,8 @@ static void bnxt_remove_one(struct pci_dev *pdev)
	if (BNXT_PF(bp))
		bnxt_sriov_disable(bp);

	bnxt_rdma_aux_device_uninit(bp);

	bnxt_ptp_clear(bp);
	pci_disable_pcie_error_reporting(pdev);
	unregister_netdev(dev);
@@ -13776,11 +13777,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:
@@ -13824,7 +13827,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);

+8 −0
Original line number Diff line number Diff line
@@ -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>
@@ -1631,6 +1632,12 @@ struct bnxt_fw_health {
#define BNXT_FW_IF_RETRY		10
#define BNXT_FW_SLOT_RESET_RETRY	4

struct bnxt_aux_priv {
	struct auxiliary_device aux_dev;
	struct bnxt_en_dev *edev;
	int id;
};

enum board_idx {
	BCM57301,
	BCM57302,
@@ -1852,6 +1859,7 @@ struct bnxt {
#define BNXT_CHIP_P4_PLUS(bp)			\
	(BNXT_CHIP_P4(bp) || BNXT_CHIP_P5(bp))

	struct bnxt_aux_priv	*aux_priv;
	struct bnxt_en_dev	*edev;

	struct bnxt_napi	**bnapi;
Loading