* netif_napi_add vs. multiple netdev's
@ 2007-10-16 5:47 Benjamin Herrenschmidt
2007-10-16 16:10 ` Stephen Hemminger
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2007-10-16 5:47 UTC (permalink / raw)
To: shemminger; +Cc: netdev
Hi Stehphen !
The new netif_napi_add() function takes a netdev argument. In the EMAC
case, there is one NAPI instance working on behalf of multiple netdev's,
so that isn't very useful. For my EMAC patch (just posted to you & the
list), I'm not passing NULL, but I'm wondering what would be a good way
to handle netpoll here...
The way it's currently implemented, there's a list of NAPI's attached to
the netdev, so obviously, that won't work for my usage scenario.
I'm not sure what's the best data structure that would be suitable for
both N ndev's for 1 NAPI and 1 ndev for N NAPI's though... I could
allocate "stub" list heads and queue those up, but that's a bit gross...
Any better idea ?
Cheers,
Ben.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: netif_napi_add vs. multiple netdev's
2007-10-16 5:47 netif_napi_add vs. multiple netdev's Benjamin Herrenschmidt
@ 2007-10-16 16:10 ` Stephen Hemminger
2007-10-16 22:16 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2007-10-16 16:10 UTC (permalink / raw)
To: benh; +Cc: netdev
On Tue, 16 Oct 2007 15:47:13 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> Hi Stehphen !
>
> The new netif_napi_add() function takes a netdev argument. In the EMAC
> case, there is one NAPI instance working on behalf of multiple netdev's,
> so that isn't very useful. For my EMAC patch (just posted to you & the
> list), I'm not passing NULL, but I'm wondering what would be a good way
> to handle netpoll here...
The problem is that netpoll only has a handle to the device being used
as a netconsole, but may need to activate the NAPI poll routine to
cleanup state. Perhaps teaching netpoll about N to 1 mappings would
be better.
>
> The way it's currently implemented, there's a list of NAPI's attached to
> the netdev, so obviously, that won't work for my usage scenario.
sky2 driver has potentially 2 ports for 1 NAPI instance.
> I'm not sure what's the best data structure that would be suitable for
> both N ndev's for 1 NAPI and 1 ndev for N NAPI's though... I could
> allocate "stub" list heads and queue those up, but that's a bit gross...
The new interface doesn't change anything. The old code had the
same problem vis-a-vis netpoll.
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: netif_napi_add vs. multiple netdev's
2007-10-16 16:10 ` Stephen Hemminger
@ 2007-10-16 22:16 ` David Miller
2007-10-16 22:24 ` Benjamin Herrenschmidt
2007-10-16 23:37 ` Stephen Hemminger
0 siblings, 2 replies; 6+ messages in thread
From: David Miller @ 2007-10-16 22:16 UTC (permalink / raw)
To: shemminger; +Cc: benh, netdev
From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Tue, 16 Oct 2007 09:10:35 -0700
> On Tue, 16 Oct 2007 15:47:13 +1000
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> > The way it's currently implemented, there's a list of NAPI's attached to
> > the netdev, so obviously, that won't work for my usage scenario.
>
> sky2 driver has potentially 2 ports for 1 NAPI instance.
And it's unfortunately buggy.
For example, the sky2_suspend() code iterates over the ports
and calls sky2_down() on each one that is up.
That will call napi_disable() on the same NAPI instance if
multiple ports are up, and thus hang the machine.
This is why, Stephen, for the second time, I'm telling you
that perhaps you should put the NAPI instance into the
sky2_port struct.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: netif_napi_add vs. multiple netdev's
2007-10-16 22:16 ` David Miller
@ 2007-10-16 22:24 ` Benjamin Herrenschmidt
2007-10-16 23:37 ` Stephen Hemminger
1 sibling, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2007-10-16 22:24 UTC (permalink / raw)
To: David Miller; +Cc: shemminger, netdev
On Tue, 2007-10-16 at 15:16 -0700, David Miller wrote:
> And it's unfortunately buggy.
>
> For example, the sky2_suspend() code iterates over the ports
> and calls sky2_down() on each one that is up.
>
> That will call napi_disable() on the same NAPI instance if
> multiple ports are up, and thus hang the machine.
>
> This is why, Stephen, for the second time, I'm telling you
> that perhaps you should put the NAPI instance into the
> sky2_port struct.
Can sky2 send/mask interrupts separately per port ? The reason why I
can't do that with EMAC is why I'm doing multiple ports per NAPI
instance...
If sky2 sticks to doing like EMAC, then it probably also needs to do
like EMAC which is to have it's own port_disable/enable that use local
per-port disable bits. (It may do a real napi_disable when all ports are
disabled, I suppose, though I don't currently do it in EMAC).
Ben.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: netif_napi_add vs. multiple netdev's
2007-10-16 22:16 ` David Miller
2007-10-16 22:24 ` Benjamin Herrenschmidt
@ 2007-10-16 23:37 ` Stephen Hemminger
2007-10-16 23:50 ` David Miller
1 sibling, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2007-10-16 23:37 UTC (permalink / raw)
To: David Miller; +Cc: benh, netdev
On Tue, 16 Oct 2007 15:16:16 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <shemminger@linux-foundation.org>
> Date: Tue, 16 Oct 2007 09:10:35 -0700
>
> > On Tue, 16 Oct 2007 15:47:13 +1000
> > Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> >
> > > The way it's currently implemented, there's a list of NAPI's attached to
> > > the netdev, so obviously, that won't work for my usage scenario.
> >
> > sky2 driver has potentially 2 ports for 1 NAPI instance.
>
> And it's unfortunately buggy.
>
> For example, the sky2_suspend() code iterates over the ports
> and calls sky2_down() on each one that is up.
>
> That will call napi_disable() on the same NAPI instance if
> multiple ports are up, and thus hang the machine.
>
> This is why, Stephen, for the second time, I'm telling you
> that perhaps you should put the NAPI instance into the
> sky2_port struct.
It isn't possible, there is only one hardware IRQ, and one
common status buffer. I'll fix the suspend code, it has other
problems as well.
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-10-16 23:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-16 5:47 netif_napi_add vs. multiple netdev's Benjamin Herrenschmidt
2007-10-16 16:10 ` Stephen Hemminger
2007-10-16 22:16 ` David Miller
2007-10-16 22:24 ` Benjamin Herrenschmidt
2007-10-16 23:37 ` Stephen Hemminger
2007-10-16 23:50 ` David Miller
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).