diff options
| author | WANG Cong <xiyou.wangcong@gmail.com> | 2014-06-23 18:36:02 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-06-25 19:35:37 -0400 |
| commit | bb446c19fefd7b4435adb12a9dd7666adc5b553a (patch) | |
| tree | 6bdb8af244fa9e70a09621209eac7e51a895368a | |
| parent | 13ec7a6b9dad16e8d5ed4e92eb1869670db7a93f (diff) | |
veth: add netpoll support
It is trivial to add netpoll support to veth, since
it is not a stacked device, we don't need to setup and
clean up netpoll.
Reported-by: Stefan Priebe <s.priebe@profihost.ag>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | drivers/net/veth.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index b4a10bcb66a0..9b945e60530e 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
| @@ -248,6 +248,21 @@ static void veth_dev_free(struct net_device *dev) | |||
| 248 | free_netdev(dev); | 248 | free_netdev(dev); |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
| 252 | static void veth_poll_controller(struct net_device *dev) | ||
| 253 | { | ||
| 254 | /* veth only receives frames when its peer sends one | ||
| 255 | * Since it's a synchronous operation, we are guaranteed | ||
| 256 | * never to have pending data when we poll for it so | ||
| 257 | * there is nothing to do here. | ||
| 258 | * | ||
| 259 | * We need this though so netpoll recognizes us as an interface that | ||
| 260 | * supports polling, which enables bridge devices in virt setups to | ||
| 261 | * still use netconsole | ||
| 262 | */ | ||
| 263 | } | ||
| 264 | #endif /* CONFIG_NET_POLL_CONTROLLER */ | ||
| 265 | |||
| 251 | static const struct net_device_ops veth_netdev_ops = { | 266 | static const struct net_device_ops veth_netdev_ops = { |
| 252 | .ndo_init = veth_dev_init, | 267 | .ndo_init = veth_dev_init, |
| 253 | .ndo_open = veth_open, | 268 | .ndo_open = veth_open, |
| @@ -257,6 +272,9 @@ static const struct net_device_ops veth_netdev_ops = { | |||
| 257 | .ndo_get_stats64 = veth_get_stats64, | 272 | .ndo_get_stats64 = veth_get_stats64, |
| 258 | .ndo_set_rx_mode = veth_set_multicast_list, | 273 | .ndo_set_rx_mode = veth_set_multicast_list, |
| 259 | .ndo_set_mac_address = eth_mac_addr, | 274 | .ndo_set_mac_address = eth_mac_addr, |
| 275 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
| 276 | .ndo_poll_controller = veth_poll_controller, | ||
| 277 | #endif | ||
| 260 | }; | 278 | }; |
| 261 | 279 | ||
| 262 | #define VETH_FEATURES (NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \ | 280 | #define VETH_FEATURES (NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \ |
