]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
bonding: Fix napi poll for bonding driver
authorNeil Horman <nhorman@tuxdriver.com>
Wed, 13 Oct 2010 16:01:51 +0000 (16:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Oct 2010 15:32:08 +0000 (08:32 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/netpoll.c

index 4e98ffac3af0259bda8cbadfb9609fa6b57405a8..d79d221fd1f467ebf01f92d69aeadbaf157f5c69 100644 (file)
@@ -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);