On Mon, Sep 22, 2025 at 02:08:47AM -0700, Pavan Chebbi wrote:
Up until now there was only one auxiliary device that bnxt
created and that was for RoCE driver. bnxt fwctl is also
going to use an aux bus device that bnxt should create.
This requires some nomenclature changes and refactoring of
the existing bnxt aux dev functions.
Make aux bus init/uninit/add/del functions generic which will
accept aux device type as a parameter. Change aux_dev_ids to
aux_dev_rdma_ids to mean it is for RoCE driver.
Also rename the 'aux_priv' and 'edev' members of struct bp to
'aux_priv_rdma' and 'edev_rdma' respectively, to mean they belong
to rdma.
Rename bnxt_aux_device_release() as bnxt_rdma_aux_device_release()
Future patches will reuse these functions to add an aux bus device
for fwctl.
Reviewed-by: Andy Gospodarek <redacted>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 23 ++--
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 4 +-
.../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 2 +-
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 102 +++++++++---------
include/linux/bnxt/ulp.h | 13 ++-
5 files changed, 77 insertions(+), 67 deletions(-)
<...>
quoted hunk ↗ jump to hunk
index 992eec874345..665850753f90 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
@@ -27,11 +27,11 @@
#include "bnxt.h"
#include "bnxt_hwrm.h"
-static DEFINE_IDA(bnxt_aux_dev_ids);
+static DEFINE_IDA(bnxt_rdma_aux_dev_ids);
I would argue that this complexity is not needed, so this and following
two patches are very questionable.
1. The desire is to generate IDs inside auxiliary_device_create() function
and not create IDA per-driver or like in this case per-auxdevice.
2. You are not expected to mix both function pointers and auxdevices
which pretends to be separate devices with separate drivers. Core code
shouldn't call to auxdevice to avoid circular dependency. Auxdevice is
expected to call to core device instead.
Thanks