aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorWANG Cong <amwang@redhat.com>2010-05-06 03:47:21 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-06 03:47:21 -0400
commit0e34e93177fb1f642cab080e0bde664c06c7183a (patch)
tree5353f873ab99c2cff76f12b41e9a9e2018e66b30 /include/linux
parent08259594e047170923ef11d1482648642bfe606f (diff)
netpoll: add generic support for bridge and bonding devices
This whole patchset is for adding netpoll support to bridge and bonding devices. I already tested it for bridge, bonding, bridge over bonding, and bonding over bridge. It looks fine now. To make bridge and bonding support netpoll, we need to adjust some netpoll generic code. This patch does the following things: 1) introduce two new priv_flags for struct net_device: IFF_IN_NETPOLL which identifies we are processing a netpoll; IFF_DISABLE_NETPOLL is used to disable netpoll support for a device at run-time; 2) introduce one new method for netdev_ops: ->ndo_netpoll_cleanup() is used to clean up netpoll when a device is removed. 3) introduce netpoll_poll_dev() which takes a struct net_device * parameter; export netpoll_send_skb() and netpoll_poll_dev() which will be used later; 4) hide a pointer to struct netpoll in struct netpoll_info, ditto. 5) introduce ->real_dev for struct netpoll. 6) introduce a new status NETDEV_BONDING_DESLAE, which is used to disable netconsole before releasing a slave, to avoid deadlocks. Cc: David Miller <davem@davemloft.net> Cc: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: WANG Cong <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/if.h2
-rw-r--r--include/linux/netdevice.h1
-rw-r--r--include/linux/netpoll.h5
-rw-r--r--include/linux/notifier.h1
4 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/if.h b/include/linux/if.h
index 3a9f410a296b..be350e62a905 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -71,6 +71,8 @@
71 * release skb->dst 71 * release skb->dst
72 */ 72 */
73#define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */ 73#define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */
74#define IFF_IN_NETPOLL 0x1000 /* whether we are processing netpoll */
75#define IFF_DISABLE_NETPOLL 0x2000 /* disable netpoll at run-time */
74 76
75#define IF_GET_IFACE 0x0001 /* for querying only */ 77#define IF_GET_IFACE 0x0001 /* for querying only */
76#define IF_GET_PROTO 0x0002 78#define IF_GET_PROTO 0x0002
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 98112fbddefd..69022d47d6f2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -724,6 +724,7 @@ struct net_device_ops {
724 unsigned short vid); 724 unsigned short vid);
725#ifdef CONFIG_NET_POLL_CONTROLLER 725#ifdef CONFIG_NET_POLL_CONTROLLER
726 void (*ndo_poll_controller)(struct net_device *dev); 726 void (*ndo_poll_controller)(struct net_device *dev);
727 void (*ndo_netpoll_cleanup)(struct net_device *dev);
727#endif 728#endif
728 int (*ndo_set_vf_mac)(struct net_device *dev, 729 int (*ndo_set_vf_mac)(struct net_device *dev,
729 int queue, u8 *mac); 730 int queue, u8 *mac);
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index a765ea898549..017e604d05f8 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -14,6 +14,7 @@
14 14
15struct netpoll { 15struct netpoll {
16 struct net_device *dev; 16 struct net_device *dev;
17 struct net_device *real_dev;
17 char dev_name[IFNAMSIZ]; 18 char dev_name[IFNAMSIZ];
18 const char *name; 19 const char *name;
19 void (*rx_hook)(struct netpoll *, int, char *, int); 20 void (*rx_hook)(struct netpoll *, int, char *, int);
@@ -36,8 +37,11 @@ struct netpoll_info {
36 struct sk_buff_head txq; 37 struct sk_buff_head txq;
37 38
38 struct delayed_work tx_work; 39 struct delayed_work tx_work;
40
41 struct netpoll *netpoll;
39}; 42};
40 43
44void netpoll_poll_dev(struct net_device *dev);
41void netpoll_poll(struct netpoll *np); 45void netpoll_poll(struct netpoll *np);
42void netpoll_send_udp(struct netpoll *np, const char *msg, int len); 46void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
43void netpoll_print_options(struct netpoll *np); 47void netpoll_print_options(struct netpoll *np);
@@ -47,6 +51,7 @@ int netpoll_trap(void);
47void netpoll_set_trap(int trap); 51void netpoll_set_trap(int trap);
48void netpoll_cleanup(struct netpoll *np); 52void netpoll_cleanup(struct netpoll *np);
49int __netpoll_rx(struct sk_buff *skb); 53int __netpoll_rx(struct sk_buff *skb);
54void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb);
50 55
51 56
52#ifdef CONFIG_NETPOLL 57#ifdef CONFIG_NETPOLL
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 9c5d3fad01f3..7c3609622334 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -206,6 +206,7 @@ static inline int notifier_to_errno(int ret)
206#define NETDEV_POST_TYPE_CHANGE 0x000F 206#define NETDEV_POST_TYPE_CHANGE 0x000F
207#define NETDEV_POST_INIT 0x0010 207#define NETDEV_POST_INIT 0x0010
208#define NETDEV_UNREGISTER_BATCH 0x0011 208#define NETDEV_UNREGISTER_BATCH 0x0011
209#define NETDEV_BONDING_DESLAVE 0x0012
209 210
210#define SYS_DOWN 0x0001 /* Notify of system down */ 211#define SYS_DOWN 0x0001 /* Notify of system down */
211#define SYS_RESTART SYS_DOWN 212#define SYS_RESTART SYS_DOWN