[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACKFLinpY29JQoBMTw6z00GwJVXLDvJTswTS=VMxki7SdX6R4Q@mail.gmail.com>
Date: Thu, 12 Sep 2024 11:29:15 -0700
From: Michael Chan <michael.chan@...adcom.com>
To: Joe Damato <jdamato@...tly.com>, Michael Chan <michael.chan@...adcom.com>,
netdev@...r.kernel.org, Pavan Chebbi <pavan.chebbi@...adcom.com>,
Michael Chan <mchan@...adcom.com>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next] tg3: Link IRQs to NAPI instances
On Thu, Sep 12, 2024 at 11:13 AM Joe Damato <jdamato@...tly.com> wrote:
>
> On Thu, Sep 12, 2024 at 11:04:02AM -0700, Michael Chan wrote:
> > Looks good, but why not just add netif_napi_set_irq() to the existing
> > loop in tg3_napi_init()? It will reduce the lines of code a bit.
> > Thanks.
>
> I made a separate function because:
> - tg3_napi_init would need two calls (once for i=0, and once in
> the loop), and
> - tg3_napi_init and tg3_napi_enable are separated in the driver,
> so I figured I'd separate the IRQ linking, too.
>
tg3_napi_enable() needs to be separated because it is called in
multiple places and tg3_napi_init() is only called once.
Even with 2 calls in tg3_napi_init(), I think it will still reduce the
lines of code. Or we can do this to do everything in the loop:
for (i = 0; i < tp->irq_cnt; i++) {
netif_napi_add(tp->dev, &tp->napi[i].napi, i ? tg3_poll_msix :
tg3_poll);
netif_set_napi_irq(...);
}
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)
Powered by blists - more mailing lists