Re: [PATCH v4 fwctl 2/5] fwctl/bnxt_en: Refactor aux bus functions to be more generic
From: Leon Romanovsky
Date: Mon Feb 02 2026 - 03:35:48 EST
On Fri, Jan 30, 2026 at 08:41:43AM -0800, 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.
>
> Convert 'aux_priv' and 'edev' members of struct bnxt into
> arrays where each element contains supported auxbus device's
> data. Move struct bnxt_aux_priv from bnxt.h to ulp.h because
> that is where it belongs. Make aux bus init/uninit/add/del
> functions more generic which will loop through all the aux
> device types. Make bnxt_ulp_start/stop functions (the only
> other common functions applicable to any aux device) loop
> through the aux devices to update their config and states.
> Make callers of bnxt_ulp_start() call it only when there
> are no errors.
>
> Also, as an improvement in code, bnxt_register_dev() can skip
> unnecessary dereferencing of edev from bp, instead use the
> edev pointer from the function parameter.
>
> Future patches will reuse these functions to add an aux bus
> device for fwctl.
>
> Reviewed-by: Andy Gospodarek <gospo@xxxxxxxxxxxx>
> Signed-off-by: Pavan Chebbi <pavan.chebbi@xxxxxxxxxxxx>
> ---
> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 47 ++-
> drivers/net/ethernet/broadcom/bnxt/bnxt.h | 19 +-
> .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 8 +-
> .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 2 +-
> drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 339 +++++++++++-------
> include/linux/bnxt/ulp.h | 25 +-
> 6 files changed, 273 insertions(+), 167 deletions(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx>