* [Patch net-next] veth: add netpoll support
@ 2014-06-20 19:17 Cong Wang
2014-06-20 19:29 ` Neil Horman
2014-06-20 19:31 ` Sergei Shtylyov
0 siblings, 2 replies; 7+ messages in thread
From: Cong Wang @ 2014-06-20 19:17 UTC (permalink / raw)
To: netdev; +Cc: s.priebe, David S. Miller, Neil Horman, Cong Wang
It is trivial to add netpoll support to veth, since
it is not stacked device, we don't need to setup and cleanup
netpoll.
Reported-by: Stefan Priebe <s.priebe@profihost.ag>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index b4a10bc..03e781b 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -248,6 +248,13 @@ static void veth_dev_free(struct net_device *dev)
free_netdev(dev);
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void veth_poll_controller(struct net_device *dev)
+{
+ return;
+}
+#endif /* CONFIG_NET_POLL_CONTROLLER */
+
static const struct net_device_ops veth_netdev_ops = {
.ndo_init = veth_dev_init,
.ndo_open = veth_open,
@@ -257,6 +264,9 @@ static const struct net_device_ops veth_netdev_ops = {
.ndo_get_stats64 = veth_get_stats64,
.ndo_set_rx_mode = veth_set_multicast_list,
.ndo_set_mac_address = eth_mac_addr,
+#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 | \
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Patch net-next] veth: add netpoll support
2014-06-20 19:17 [Patch net-next] veth: add netpoll support Cong Wang
@ 2014-06-20 19:29 ` Neil Horman
2014-06-20 19:31 ` Sergei Shtylyov
1 sibling, 0 replies; 7+ messages in thread
From: Neil Horman @ 2014-06-20 19:29 UTC (permalink / raw)
To: Cong Wang; +Cc: netdev, s.priebe, David S. Miller
On Fri, Jun 20, 2014 at 12:17:58PM -0700, Cong Wang wrote:
> It is trivial to add netpoll support to veth, since
> it is not stacked device, we don't need to setup and cleanup
> netpoll.
>
> Reported-by: Stefan Priebe <s.priebe@profihost.ag>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>
> ---
> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> index b4a10bc..03e781b 100644
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -248,6 +248,13 @@ static void veth_dev_free(struct net_device *dev)
> free_netdev(dev);
> }
>
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +static void veth_poll_controller(struct net_device *dev)
> +{
> + return;
> +}
> +#endif /* CONFIG_NET_POLL_CONTROLLER */
> +
> static const struct net_device_ops veth_netdev_ops = {
> .ndo_init = veth_dev_init,
> .ndo_open = veth_open,
> @@ -257,6 +264,9 @@ static const struct net_device_ops veth_netdev_ops = {
> .ndo_get_stats64 = veth_get_stats64,
> .ndo_set_rx_mode = veth_set_multicast_list,
> .ndo_set_mac_address = eth_mac_addr,
> +#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 | \
>
Maybe add a comment to the function (like in the tun/tap driver to indicate why
you have a function that only returns there, and why thats importatn.
Otherwise
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch net-next] veth: add netpoll support
2014-06-20 19:17 [Patch net-next] veth: add netpoll support Cong Wang
2014-06-20 19:29 ` Neil Horman
@ 2014-06-20 19:31 ` Sergei Shtylyov
2014-06-20 20:07 ` Neil Horman
1 sibling, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2014-06-20 19:31 UTC (permalink / raw)
To: Cong Wang, netdev; +Cc: s.priebe, David S. Miller, Neil Horman
Hello.
On 06/20/2014 11:17 PM, Cong Wang wrote:
> It is trivial to add netpoll support to veth, since
> it is not stacked device, we don't need to setup and cleanup
> netpoll.
> Reported-by: Stefan Priebe <s.priebe@profihost.ag>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> ---
> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> index b4a10bc..03e781b 100644
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -248,6 +248,13 @@ static void veth_dev_free(struct net_device *dev)
> free_netdev(dev);
> }
>
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +static void veth_poll_controller(struct net_device *dev)
> +{
> + return;
Not needed.
> +}
> +#endif /* CONFIG_NET_POLL_CONTROLLER */
> +
> static const struct net_device_ops veth_netdev_ops = {
> .ndo_init = veth_dev_init,
> .ndo_open = veth_open,
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch net-next] veth: add netpoll support
2014-06-20 19:31 ` Sergei Shtylyov
@ 2014-06-20 20:07 ` Neil Horman
2014-06-20 20:15 ` Sergei Shtylyov
0 siblings, 1 reply; 7+ messages in thread
From: Neil Horman @ 2014-06-20 20:07 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: Cong Wang, netdev, s.priebe, David S. Miller
On Fri, Jun 20, 2014 at 11:31:30PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 06/20/2014 11:17 PM, Cong Wang wrote:
>
> >It is trivial to add netpoll support to veth, since
> >it is not stacked device, we don't need to setup and cleanup
> >netpoll.
>
> >Reported-by: Stefan Priebe <s.priebe@profihost.ag>
> >Cc: "David S. Miller" <davem@davemloft.net>
> >Cc: Neil Horman <nhorman@tuxdriver.com>
> >Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>
> >---
> >diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> >index b4a10bc..03e781b 100644
> >--- a/drivers/net/veth.c
> >+++ b/drivers/net/veth.c
> >@@ -248,6 +248,13 @@ static void veth_dev_free(struct net_device *dev)
> > free_netdev(dev);
> > }
> >
> >+#ifdef CONFIG_NET_POLL_CONTROLLER
> >+static void veth_poll_controller(struct net_device *dev)
> >+{
> >+ return;
>
> Not needed.
It is, a valid function poniter is how the stack determines if a given driver
supports netpoll. See the tun_poll_controller for another example
Neil
>
> >+}
> >+#endif /* CONFIG_NET_POLL_CONTROLLER */
> >+
> > static const struct net_device_ops veth_netdev_ops = {
> > .ndo_init = veth_dev_init,
> > .ndo_open = veth_open,
>
> WBR, Sergei
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch net-next] veth: add netpoll support
2014-06-20 20:07 ` Neil Horman
@ 2014-06-20 20:15 ` Sergei Shtylyov
2014-06-22 12:13 ` Neil Horman
0 siblings, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2014-06-20 20:15 UTC (permalink / raw)
To: Neil Horman; +Cc: Cong Wang, netdev, s.priebe, David S. Miller
Hello.
On 06/21/2014 12:07 AM, Neil Horman wrote:
>>> It is trivial to add netpoll support to veth, since
>>> it is not stacked device, we don't need to setup and cleanup
>>> netpoll.
>>> Reported-by: Stefan Priebe <s.priebe@profihost.ag>
>>> Cc: "David S. Miller" <davem@davemloft.net>
>>> Cc: Neil Horman <nhorman@tuxdriver.com>
>>> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>>> ---
>>> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
>>> index b4a10bc..03e781b 100644
>>> --- a/drivers/net/veth.c
>>> +++ b/drivers/net/veth.c
>>> @@ -248,6 +248,13 @@ static void veth_dev_free(struct net_device *dev)
>>> free_netdev(dev);
>>> }
>>>
>>> +#ifdef CONFIG_NET_POLL_CONTROLLER
>>> +static void veth_poll_controller(struct net_device *dev)
>>> +{
>>> + return;
>>
>> Not needed.
> It is, a valid function poniter is how the stack determines if a given driver
> supports netpoll. See the tun_poll_controller for another example
> Neil
I just said that *return* was not needed. :-)
>>
>>> +}
>>> +#endif /* CONFIG_NET_POLL_CONTROLLER */
>>> +
>>> static const struct net_device_ops veth_netdev_ops = {
>>> .ndo_init = veth_dev_init,
>>> .ndo_open = veth_open,
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch net-next] veth: add netpoll support
2014-06-20 20:15 ` Sergei Shtylyov
@ 2014-06-22 12:13 ` Neil Horman
2014-06-23 22:16 ` Cong Wang
0 siblings, 1 reply; 7+ messages in thread
From: Neil Horman @ 2014-06-22 12:13 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: Cong Wang, netdev, s.priebe, David S. Miller
On Sat, Jun 21, 2014 at 12:15:46AM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 06/21/2014 12:07 AM, Neil Horman wrote:
>
> >>>It is trivial to add netpoll support to veth, since
> >>>it is not stacked device, we don't need to setup and cleanup
> >>>netpoll.
>
> >>>Reported-by: Stefan Priebe <s.priebe@profihost.ag>
> >>>Cc: "David S. Miller" <davem@davemloft.net>
> >>>Cc: Neil Horman <nhorman@tuxdriver.com>
> >>>Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>
> >>>---
> >>>diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> >>>index b4a10bc..03e781b 100644
> >>>--- a/drivers/net/veth.c
> >>>+++ b/drivers/net/veth.c
> >>>@@ -248,6 +248,13 @@ static void veth_dev_free(struct net_device *dev)
> >>> free_netdev(dev);
> >>> }
> >>>
> >>>+#ifdef CONFIG_NET_POLL_CONTROLLER
> >>>+static void veth_poll_controller(struct net_device *dev)
> >>>+{
> >>>+ return;
> >>
> >> Not needed.
>
> >It is, a valid function poniter is how the stack determines if a given driver
> >supports netpoll. See the tun_poll_controller for another example
> >Neil
>
> I just said that *return* was not needed. :-)
>
> >>
> >>>+}
> >>>+#endif /* CONFIG_NET_POLL_CONTROLLER */
> >>>+
> >>> static const struct net_device_ops veth_netdev_ops = {
> >>> .ndo_init = veth_dev_init,
> >>> .ndo_open = veth_open,
>
> WBR, Sergei
>
>
My bad, thought you were referring to the function as a whole
Regards
Neil
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch net-next] veth: add netpoll support
2014-06-22 12:13 ` Neil Horman
@ 2014-06-23 22:16 ` Cong Wang
0 siblings, 0 replies; 7+ messages in thread
From: Cong Wang @ 2014-06-23 22:16 UTC (permalink / raw)
To: Neil Horman
Cc: Sergei Shtylyov, Linux Kernel Network Developers, s.priebe,
David S. Miller
Hi,
I will update this patch based on your comments and send out v2.
Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-06-23 22:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-20 19:17 [Patch net-next] veth: add netpoll support Cong Wang
2014-06-20 19:29 ` Neil Horman
2014-06-20 19:31 ` Sergei Shtylyov
2014-06-20 20:07 ` Neil Horman
2014-06-20 20:15 ` Sergei Shtylyov
2014-06-22 12:13 ` Neil Horman
2014-06-23 22:16 ` Cong Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).