aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bonding.h
diff options
context:
space:
mode:
authorAmerigo Wang <amwang@redhat.com>2011-02-17 18:43:32 -0500
committerDavid S. Miller <davem@davemloft.net>2011-02-27 19:11:50 -0500
commit8a8efa22f51b3c3f879d272914e3dbbc2041bf91 (patch)
treedc4fd5df150bec7a54b92dd70f8a1f64c0ce5b26 /drivers/net/bonding/bonding.h
parent70919e23ac35c9c244dfd73f97312894cae7d65f (diff)
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.h20
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 @@
20#include <linux/if_bonding.h> 20#include <linux/if_bonding.h>
21#include <linux/cpumask.h> 21#include <linux/cpumask.h>
22#include <linux/in6.h> 22#include <linux/in6.h>
23#include <linux/netpoll.h>
23#include "bond_3ad.h" 24#include "bond_3ad.h"
24#include "bond_alb.h" 25#include "bond_alb.h"
25 26
@@ -198,6 +199,9 @@ struct slave {
198 u16 queue_id; 199 u16 queue_id;
199 struct ad_slave_info ad_info; /* HUGE - better to dynamically alloc */ 200 struct ad_slave_info ad_info; /* HUGE - better to dynamically alloc */
200 struct tlb_slave_info tlb_info; 201 struct tlb_slave_info tlb_info;
202#ifdef CONFIG_NET_POLL_CONTROLLER
203 struct netpoll *np;
204#endif
201}; 205};
202 206
203/* 207/*
@@ -323,6 +327,22 @@ static inline unsigned long slave_last_rx(struct bonding *bond,
323 return slave->dev->last_rx; 327 return slave->dev->last_rx;
324} 328}
325 329
330#ifdef CONFIG_NET_POLL_CONTROLLER
331static inline void bond_netpoll_send_skb(const struct slave *slave,
332 struct sk_buff *skb)
333{
334 struct netpoll *np = slave->np;
335
336 if (np)
337 netpoll_send_skb(np, skb);
338}
339#else
340static inline void bond_netpoll_send_skb(const struct slave *slave,
341 struct sk_buff *skb)
342{
343}
344#endif
345
326static inline void bond_set_slave_inactive_flags(struct slave *slave) 346static inline void bond_set_slave_inactive_flags(struct slave *slave)
327{ 347{
328 struct bonding *bond = netdev_priv(slave->dev->master); 348 struct bonding *bond = netdev_priv(slave->dev->master);