diff options
author | Amerigo Wang <amwang@redhat.com> | 2011-02-17 23:43:32 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-27 16:11:50 -0800 |
commit | 8a8efa22f51b3c3f879d272914e3dbbc2041bf91 (patch) | |
tree | dc4fd5df150bec7a54b92dd70f8a1f64c0ce5b26 /drivers/net/bonding/bonding.h | |
parent | 70919e23ac35c9c244dfd73f97312894cae7d65f (diff) | |
download | blackbird-op-linux-8a8efa22f51b3c3f879d272914e3dbbc2041bf91.tar.gz blackbird-op-linux-8a8efa22f51b3c3f879d272914e3dbbc2041bf91.zip |
bonding: sync netpoll code with bridge
V4: rebase to net-next-2.6
V3: remove an useless #ifdef.
This patch unifies the netpoll code in bonding with netpoll code in bridge,
thanks to Herbert that code is much cleaner now.
Signed-off-by: WANG Cong <amwang@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r-- | drivers/net/bonding/bonding.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 31fe980e4e28..0a3e00b220b7 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h @@ -20,6 +20,7 @@ #include <linux/if_bonding.h> #include <linux/cpumask.h> #include <linux/in6.h> +#include <linux/netpoll.h> #include "bond_3ad.h" #include "bond_alb.h" @@ -198,6 +199,9 @@ struct slave { u16 queue_id; struct ad_slave_info ad_info; /* HUGE - better to dynamically alloc */ struct tlb_slave_info tlb_info; +#ifdef CONFIG_NET_POLL_CONTROLLER + struct netpoll *np; +#endif }; /* @@ -323,6 +327,22 @@ static inline unsigned long slave_last_rx(struct bonding *bond, return slave->dev->last_rx; } +#ifdef CONFIG_NET_POLL_CONTROLLER +static inline void bond_netpoll_send_skb(const struct slave *slave, + struct sk_buff *skb) +{ + struct netpoll *np = slave->np; + + if (np) + netpoll_send_skb(np, skb); +} +#else +static inline void bond_netpoll_send_skb(const struct slave *slave, + struct sk_buff *skb) +{ +} +#endif + static inline void bond_set_slave_inactive_flags(struct slave *slave) { struct bonding *bond = netdev_priv(slave->dev->master); |