From: Andrew Gallatin <gallatin@myri.com>
To: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: David Miller <davem@davemloft.net>,
joonwpark81@gmail.com, auke-jan.h.kok@intel.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
jgarzik@pobox.com, jesse.brandeburg@intel.com
Subject: Re: [RFC] net: napi fix
Date: Thu, 13 Dec 2007 14:02:25 -0500 [thread overview]
Message-ID: <476181C1.3060204@myri.com> (raw)
In-Reply-To: <20071213102233.3727e9a0@freepuppy.rosehill>
Stephen Hemminger wrote:
> On Thu, 13 Dec 2007 06:19:38 -0800 (PST)
> David Miller <davem@davemloft.net> wrote:
>
>> From: Andrew Gallatin <gallatin@myri.com>
>> Date: Thu, 13 Dec 2007 09:13:54 -0500
>>
>>> If the netif_running() check is indeed required to make a device break
>>> out of napi polling and respond to an ifconfig down, then I think the
>>> netif_running() check should be moved up into net_rx_action() to avoid
>>> potential for driver complexity and bugs like the ones you found.
>> That, or something like it, definitely sounds reasonable and much
>> better than putting the check into every driver :-)
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> It is not possible to do netif_running() check in generic code as currently
> written because of the case of devices where a single NAPI object is
> being used to handle two devices. The association between napi and netdevice
> is M to N. There are cases like niu that have multiple NAPI's and one
> netdevice; and devices like sky2 that can have one NAPI and 2 netdevice's.
Ah, now I see. I forgot that not every device has a 1:1::napi:netdev
relationship.
Could we make an optional *dev_state field in the napi structure.
It would be initialized to __LINK_STATE_START. Devices which have
a 1:1 NAPI:netdevice relationship would set it to &netdev->state.
The generic code would then do a test_bit(__LINK_STATE_START,
napi->dev_state), and 1:1 drivers could remove this check.
M:N drivers would pay for a useless (to them) test_bit, and would
have to provide their own netif_running check to get termination
under heavy load.
Just an idea, perhaps there is a better way which is less hacky.
Or perhaps we should just leave things as is.
Drew
next prev parent reply other threads:[~2007-12-13 19:11 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-12 17:29 [RFC] net: napi fix Andrew Gallatin
2007-12-12 17:38 ` David Miller
2007-12-12 17:40 ` Andrew Gallatin
2007-12-12 18:41 ` Kok, Auke
2007-12-13 7:41 ` Joonwoo Park
2007-12-13 14:13 ` Andrew Gallatin
2007-12-13 14:19 ` David Miller
2007-12-13 16:45 ` Kok, Auke
2007-12-13 18:22 ` Stephen Hemminger
2007-12-13 19:02 ` Andrew Gallatin [this message]
2007-12-13 19:09 ` David Miller
2007-12-13 19:35 ` Stephen Hemminger
2007-12-13 20:38 ` David Miller
2007-12-14 2:06 ` Joonwoo Park
2007-12-13 13:49 ` Jarek Poplawski
2007-12-13 13:50 ` David Miller
2007-12-13 14:14 ` Jarek Poplawski
2007-12-13 20:16 ` Jarek Poplawski
2007-12-13 20:37 ` David Miller
2007-12-13 20:41 ` Stephen Hemminger
2007-12-13 21:55 ` Jarek Poplawski
2007-12-13 22:28 ` Jarek Poplawski
2007-12-13 22:34 ` David Miller
2007-12-13 22:58 ` Jarek Poplawski
2007-12-20 9:52 ` Robert Olsson
2007-12-20 11:22 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2007-12-12 4:01 [PATCH 6/7] [NETDEV]: tehuti Fix possible causing oops of net_rx_action Joonwoo Park
2007-12-12 5:39 ` Stephen Hemminger
2007-12-12 5:46 ` [RFC] net: napi fix Stephen Hemminger
2007-12-12 6:05 ` Joonwoo Park
2007-12-12 15:22 ` David Miller
2007-12-12 15:21 ` David Miller
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=476181C1.3060204@myri.com \
--to=gallatin@myri.com \
--cc=auke-jan.h.kok@intel.com \
--cc=davem@davemloft.net \
--cc=jesse.brandeburg@intel.com \
--cc=jgarzik@pobox.com \
--cc=joonwpark81@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.