[Devel] [PATCH RHEL7 COMMIT] ms/veth: add netpoll support
Konstantin Khorenko
khorenko at virtuozzo.com
Wed Oct 21 07:15:12 PDT 2015
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.9.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.8.9
------>
commit b43914207091f5f42b613d43a6499bf330719ce6
Author: Andrew Vagin <avagin at openvz.org>
Date: Wed Oct 21 18:15:12 2015 +0400
ms/veth: add netpoll support
ML: bb446c19fefd7b4435adb12a9dd7666adc5b553a
https://jira.sw.ru/browse/PSBM-34959
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 at profihost.ag>
Cc: "David S. Miller" <davem at davemloft.net>
Cc: Neil Horman <nhorman at tuxdriver.com>
Acked-by: Neil Horman <nhorman at tuxdriver.com>
Signed-off-by: Cong Wang <xiyou.wangcong at gmail.com>
Acked-by: Neil Horman <nhorman at tuxdriver.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
drivers/net/veth.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 1d061c9..2df7170 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -314,6 +314,21 @@ static int vzethdev_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd
return -ENOTTY;
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void veth_poll_controller(struct net_device *dev)
+{
+ /* veth only receives frames when its peer sends one
+ * Since it's a synchronous operation, we are guaranteed
+ * never to have pending data when we poll for it so
+ * there is nothing to do here.
+ *
+ * We need this though so netpoll recognizes us as an interface that
+ * supports polling, which enables bridge devices in virt setups to
+ * still use netconsole
+ */
+}
+#endif /* CONFIG_NET_POLL_CONTROLLER */
+
static const struct net_device_ops veth_netdev_ops = {
.ndo_init = veth_dev_init,
.ndo_open = veth_open,
@@ -323,6 +338,9 @@ static const struct net_device_ops veth_netdev_ops = {
.ndo_get_stats64 = veth_get_stats64,
.ndo_set_mac_address = veth_mac_addr,
.ndo_do_ioctl = vzethdev_net_ioctl,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = veth_poll_controller,
+#endif
};
#define VETH_FEATURES (NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
More information about the Devel
mailing list