From: nhorman@tuxdriver.com
To: netdev@vger.kernel.org
Cc: bonding-devel@lists.sourceforge.net, fubar@us.ibm.com,
davem@davemloft.net, andy@greyhouse.net, amwang@redhat.com,
nhorman@tuxdriver.com
Subject: [PATCH 3/5] Fix napi poll for bonding driver
Date: Wed, 13 Oct 2010 22:01:51 -0400 [thread overview]
Message-ID: <1287021713-1750-4-git-send-email-nhorman@tuxdriver.com> (raw)
In-Reply-To: <1287021713-1750-1-git-send-email-nhorman@tuxdriver.com>
From: Neil Horman <nhorman@tuxdriver.com>
Usually the netpoll path, when preforming a napi poll can get away with just
polling all the napi instances of the configured device. Thats not the case for
the bonding driver however, as the napi instances which may wind up getting
flagged as needing polling after the poll_controller call don't belong to the
bonded device, but rather to the slave devices. Fix this by checking the device
in question for the IFF_MASTER flag, if set, we know we need to check the full
poll list for this cpu, rather than just the devices napi instance list.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
---
net/core/netpoll.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 4e98ffa..d79d221 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -156,8 +156,15 @@ static void poll_napi(struct net_device *dev)
{
struct napi_struct *napi;
int budget = 16;
+ struct softnet_data *sd = &__get_cpu_var(softnet_data);
+ struct list_head *nlist;
- list_for_each_entry(napi, &dev->napi_list, dev_list) {
+ if (dev->flags & IFF_MASTER)
+ nlist = &sd->poll_list;
+ else
+ nlist = &dev->napi_list;
+
+ list_for_each_entry(napi, nlist, dev_list) {
if (napi->poll_owner != smp_processor_id() &&
spin_trylock(&napi->poll_lock)) {
budget = poll_one_napi(dev->npinfo, napi, budget);
--
1.7.2.3
next prev parent reply other threads:[~2010-10-14 2:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-14 2:01 [PATCH] bonding: various fixes for bonding, netpoll & netconsole (v3) nhorman
2010-10-14 2:01 ` [PATCH 1/5] Fix bonding drivers improper modification of netpoll structure nhorman
2010-10-14 2:01 ` [PATCH 2/5] Fix deadlock in bonding driver resulting from internal locking when using netpoll nhorman
2010-10-14 2:01 ` nhorman [this message]
2010-10-14 2:01 ` [PATCH 4/5] Fix netconsole to not deadlock on rmmod nhorman
2010-10-14 2:01 ` [PATCH 5/5] Re-enable netpoll over bonding nhorman
2010-10-18 15:25 ` [PATCH] bonding: various fixes for bonding, netpoll & netconsole (v3) David Miller
2010-10-18 15:27 ` David Miller
2010-10-18 15:57 ` Neil Horman
2010-10-19 5:21 ` Cong Wang
2010-10-19 8:06 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2010-10-13 12:35 [PATCH] bonding: various fixes for bonding, netpoll & netconsole (v2) nhorman
2010-10-13 12:35 ` [PATCH 3/5] Fix napi poll for bonding driver nhorman
2010-10-12 21:55 [PATCH] bonding: various fixes for bonding, netpoll & netconsole nhorman
2010-10-12 21:55 ` [PATCH 3/5] Fix napi poll for bonding driver nhorman
2010-10-12 20:29 [PATCH] bonding: various fixes for bonding, netpoll & netconsole nhorman
2010-10-12 20:29 ` [PATCH 3/5] Fix napi poll for bonding driver nhorman
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=1287021713-1750-4-git-send-email-nhorman@tuxdriver.com \
--to=nhorman@tuxdriver.com \
--cc=amwang@redhat.com \
--cc=andy@greyhouse.net \
--cc=bonding-devel@lists.sourceforge.net \
--cc=davem@davemloft.net \
--cc=fubar@us.ibm.com \
--cc=netdev@vger.kernel.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 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).