[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL+tcoAfV+P3579_uM4mikMkNK4L2dMx0EuXNnTeLwZ3-7Po2Q@mail.gmail.com>
Date: Wed, 2 Jul 2025 08:47:08 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Simon Horman <horms@...nel.org>, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com, andrew+netdev@...n.ch, michael.chan@...adcom.com,
pavan.chebbi@...adcom.com, netdev@...r.kernel.org,
Jason Xing <kernelxing@...cent.com>, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH net] bnxt_en: eliminate the compile warning in
bnxt_request_irq due to CONFIG_RFS_ACCEL
On Wed, Jul 2, 2025 at 8:15 AM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Mon, 30 Jun 2025 19:47:47 +0800 Jason Xing wrote:
> > > Not for net, but it would be nice to factor the #ifdefs out of this
> > > function entirely. E.g. by using a helper to perform that part of the
> > > initialisation.
> >
> > Got it. I will cook a patch after this patch is landed on the net-next branch.
>
> Maybe we can fix it right already. The compiler should not complain if
> it sees the read:
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index f621a5bab1ea..6bbe875132b0 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -11616,11 +11616,9 @@ static void bnxt_free_irq(struct bnxt *bp)
>
> static int bnxt_request_irq(struct bnxt *bp)
> {
> + struct cpu_rmap *rmap = NULL;
> int i, j, rc = 0;
> unsigned long flags = 0;
> -#ifdef CONFIG_RFS_ACCEL
> - struct cpu_rmap *rmap;
> -#endif
Sorry, Jakub. I failed to see the positive point of this kind of
change comparatively.
>
> rc = bnxt_setup_int_mode(bp);
> if (rc) {
Probably in this position, you expect 'rmap = bp->dev->rx_cpu_rmap;'
to stay there even when CONFIG_RFS_ACCEL is off?
The report says it's 'j' that causes the complaint.
Thanks,
Jason
> @@ -11641,15 +11639,15 @@ static int bnxt_request_irq(struct bnxt *bp)
> int map_idx = bnxt_cp_num_to_irq_num(bp, i);
> struct bnxt_irq *irq = &bp->irq_tbl[map_idx];
>
> -#ifdef CONFIG_RFS_ACCEL
> - if (rmap && bp->bnapi[i]->rx_ring) {
> + if (IS_ENABLED(CONFIG_RFS_ACCEL) &&
> + rmap && bp->bnapi[i]->rx_ring) {
> rc = irq_cpu_rmap_add(rmap, irq->vector);
> if (rc)
> netdev_warn(bp->dev, "failed adding irq rmap for ring %d\n",
> j);
> j++;
> }
> -#endif
> +
> rc = request_irq(irq->vector, irq->handler, flags, irq->name,
> bp->bnapi[i]);
> if (rc)
> --
> pw-bot: cr
Powered by blists - more mailing lists