From bd2d0837abc0206ecdd3f6b9fc8c25b55b63c96b Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Tue, 17 Jul 2012 05:22:36 +0000 Subject: team: add netpoll support It's done in very similar way this is done in bonding and bridge. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller --- include/linux/if_team.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'include/linux/if_team.h') diff --git a/include/linux/if_team.h b/include/linux/if_team.h index dfa0c8e0ab84..7fd0cdeb9444 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h @@ -13,6 +13,8 @@ #ifdef __KERNEL__ +#include + struct team_pcpu_stats { u64 rx_packets; u64 rx_bytes; @@ -60,6 +62,10 @@ struct team_port { unsigned int mtu; } orig; +#ifdef CONFIG_NET_POLL_CONTROLLER + struct netpoll *np; +#endif + long mode_priv[0]; }; @@ -73,6 +79,33 @@ static inline bool team_port_txable(struct team_port *port) return port->linkup && team_port_enabled(port); } +#ifdef CONFIG_NET_POLL_CONTROLLER +static inline void team_netpoll_send_skb(struct team_port *port, + struct sk_buff *skb) +{ + struct netpoll *np = port->np; + + if (np) + netpoll_send_skb(np, skb); +} +#else +static inline void team_netpoll_send_skb(struct team_port *port, + struct sk_buff *skb) +{ +} +#endif + +static inline int team_dev_queue_xmit(struct team *team, struct team_port *port, + struct sk_buff *skb) +{ + skb->dev = port->dev; + if (unlikely(netpoll_tx_running(port->dev))) { + team_netpoll_send_skb(port, skb); + return 0; + } + return dev_queue_xmit(skb); +} + struct team_mode_ops { int (*init)(struct team *team); void (*exit)(struct team *team); -- cgit