Subject: Re: [PATCH net-next v1 2/3] bnxt_en: split rx ring helpers out from ring helpers

From: Simon Horman <[email-masked]>
Date: Fri, 14 Jun 2024 21:01:56 +0100

On Mon, Jun 10, 2024 at 07:33:23PM -0700, David Wei wrote:
> To prepare for queue API implementation, split rx ring functions out
> from ring helpers. These new helpers will be called from queue API
> implementation.
> 
> Signed-off-by: David Wei <[email-masked]>
> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt.c | 302 ++++++++++++++--------
>  1 file changed, 195 insertions(+), 107 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c

...

> +static int bnxt_init_one_rx_ring(struct bnxt *bp, int ring_nr)
> +{
> +	struct bnxt_rx_ring_info *rxr;
> +	struct bnxt_ring_struct *ring;
> +
> +	rxr = &bp->rx_ring[ring_nr];
> +	ring = &rxr->rx_ring_struct;

Hi David,

A minor nit from my side.
ring is set but otherwise unused in this function.

Flagged by W=1 builds with gcc-13 and clang-18.

> +	bnxt_init_one_rx_ring_rxbd(bp, rxr);
> +
> +	netif_queue_set_napi(bp->dev, ring_nr, NETDEV_QUEUE_TYPE_RX,
> +			     &rxr->bnapi->napi);
> +
> +	if (BNXT_RX_PAGE_MODE(bp) && bp->xdp_prog) {
> +		bpf_prog_add(bp->xdp_prog, 1);
> +		rxr->xdp_prog = bp->xdp_prog;
> +	}
> +
> +	bnxt_init_one_rx_agg_ring_rxbd(bp, rxr);
>  
>  	return bnxt_alloc_one_rx_ring(bp, ring_nr);
>  }

...