netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Pavan Chebbi <pavan.chebbi@broadcom.com>
Cc: jgg@ziepe.ca, michael.chan@broadcom.com, dave.jiang@intel.com,
	saeedm@nvidia.com, Jonathan.Cameron@huawei.com,
	davem@davemloft.net, corbet@lwn.net, edumazet@google.com,
	gospo@broadcom.com, kuba@kernel.org, netdev@vger.kernel.org,
	pabeni@redhat.com, andrew+netdev@lunn.ch,
	selvin.xavier@broadcom.com
Subject: Re: [PATCH net-next 2/6] bnxt_en: Refactor aux bus functions to be generic
Date: Mon, 29 Sep 2025 22:06:01 +0300	[thread overview]
Message-ID: <20250929190601.GC324804@unreal> (raw)
In-Reply-To: <20250922090851.719913-3-pavan.chebbi@broadcom.com>

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 <gospo@broadcom.com>
> 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(-)

<...>

> 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

  reply	other threads:[~2025-09-29 19:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22  9:08 [PATCH net-next 0/6] bnxt_fwctl: fwctl for Broadcom Netxtreme devices Pavan Chebbi
2025-09-22  9:08 ` [PATCH net-next 1/6] bnxt_en: Move common definitions to include/linux/bnxt/ Pavan Chebbi
2025-09-22  9:08 ` [PATCH net-next 2/6] bnxt_en: Refactor aux bus functions to be generic Pavan Chebbi
2025-09-29 19:06   ` Leon Romanovsky [this message]
2025-10-02  8:19     ` Pavan Chebbi
2025-09-22  9:08 ` [PATCH net-next 3/6] bnxt_en: Make a lookup table for supported aux bus devices Pavan Chebbi
2025-09-22  9:08 ` [PATCH net-next 4/6] bnxt_en: Create an aux device for fwctl Pavan Chebbi
2025-09-22  9:08 ` [PATCH net-next 5/6] bnxt_fwctl: Add bnxt fwctl device Pavan Chebbi
2025-09-22  9:08 ` [PATCH net-next 6/6] bnxt_fwctl: Add documentation entries Pavan Chebbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250929190601.GC324804@unreal \
    --to=leon@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=dave.jiang@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gospo@broadcom.com \
    --cc=jgg@ziepe.ca \
    --cc=kuba@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.com \
    --cc=saeedm@nvidia.com \
    --cc=selvin.xavier@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).