* [PATCH net] openvswitch: disable LRO unless stated otherwise
@ 2015-05-26 17:38 Jiri Benc
[not found] ` <15f0c96df9cc152b05d8a5ff0c0059eb1f042cca.1432661690.git.jbenc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Jiri Benc @ 2015-05-26 17:38 UTC (permalink / raw)
To: netdev; +Cc: dev, Pravin Shelar, Jesse Gross
Currently, openvswitch tries to disable LRO from the user space. This does
not work correctly when the device added is a vlan interface, though.
Instead of dealing with possibly complex stacked cross name space relations
in the user space, do the same as bridging does and call dev_disable_lro in
the kernel.
As there are use cases of openvswitch setup that can keep LRO enabled and
there's a planned feature to optimize such use cases (and stop disabling LRO
unconditionally from the user space daemon), allow the user space to
override this when adding the interface.
Signed-off-by: Jiri Benc <jbenc@redhat.com>
---
include/uapi/linux/openvswitch.h | 9 +++++++++
net/openvswitch/vport-netdev.c | 3 +++
2 files changed, 12 insertions(+)
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index bbd49a0c46c7..3832953a4f27 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -252,6 +252,15 @@ enum ovs_vport_attr {
#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
+/* OVS_VPORT_ATTR_OPTIONS attributes for netdev vports.
+ */
+enum {
+ OVS_NETDEV_ATTR_KEEP_LRO, /* flag */
+ __OVS_NETDEV_ATTR_MAX
+};
+
+#define OVS_NETDEV_ATTR_MAX (__OVS_NETDEV_ATTR_MAX - 1)
+
enum {
OVS_VXLAN_EXT_UNSPEC,
OVS_VXLAN_EXT_GBP, /* Flag or __u32 */
diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c
index 4776282c6417..04391b6cfb9a 100644
--- a/net/openvswitch/vport-netdev.c
+++ b/net/openvswitch/vport-netdev.c
@@ -125,6 +125,9 @@ static struct vport *netdev_create(const struct vport_parms *parms)
if (err)
goto error_master_upper_dev_unlink;
+ if (!parms->options ||
+ !nla_find_nested(parms->options, OVS_NETDEV_ATTR_KEEP_LRO))
+ dev_disable_lro(netdev_vport->dev);
dev_set_promiscuity(netdev_vport->dev, 1);
netdev_vport->dev->priv_flags |= IFF_OVS_DATAPATH;
rtnl_unlock();
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <15f0c96df9cc152b05d8a5ff0c0059eb1f042cca.1432661690.git.jbenc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH net] openvswitch: disable LRO unless stated otherwise [not found] ` <15f0c96df9cc152b05d8a5ff0c0059eb1f042cca.1432661690.git.jbenc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2015-05-26 22:03 ` Pravin Shelar [not found] ` <CALnjE+o-rHrcrmbwb4n4Py5smH3M8oOS-EBCGF2Rc0-e_Y1rmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Pravin Shelar @ 2015-05-26 22:03 UTC (permalink / raw) To: Jiri Benc; +Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org, netdev On Tue, May 26, 2015 at 10:38 AM, Jiri Benc <jbenc@redhat.com> wrote: > Currently, openvswitch tries to disable LRO from the user space. This does > not work correctly when the device added is a vlan interface, though. > Instead of dealing with possibly complex stacked cross name space relations > in the user space, do the same as bridging does and call dev_disable_lro in > the kernel. > > As there are use cases of openvswitch setup that can keep LRO enabled and > there's a planned feature to optimize such use cases (and stop disabling LRO > unconditionally from the user space daemon), allow the user space to > override this when adding the interface. > OVS interface for generic networking device operation looks odd. have you considered adding new device ioctl to do this? > Signed-off-by: Jiri Benc <jbenc@redhat.com> > --- > include/uapi/linux/openvswitch.h | 9 +++++++++ > net/openvswitch/vport-netdev.c | 3 +++ > 2 files changed, 12 insertions(+) > > diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h > index bbd49a0c46c7..3832953a4f27 100644 > --- a/include/uapi/linux/openvswitch.h > +++ b/include/uapi/linux/openvswitch.h > @@ -252,6 +252,15 @@ enum ovs_vport_attr { > > #define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1) > > +/* OVS_VPORT_ATTR_OPTIONS attributes for netdev vports. > + */ > +enum { > + OVS_NETDEV_ATTR_KEEP_LRO, /* flag */ > + __OVS_NETDEV_ATTR_MAX > +}; > + > +#define OVS_NETDEV_ATTR_MAX (__OVS_NETDEV_ATTR_MAX - 1) > + > enum { > OVS_VXLAN_EXT_UNSPEC, > OVS_VXLAN_EXT_GBP, /* Flag or __u32 */ _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CALnjE+o-rHrcrmbwb4n4Py5smH3M8oOS-EBCGF2Rc0-e_Y1rmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH net] openvswitch: disable LRO unless stated otherwise [not found] ` <CALnjE+o-rHrcrmbwb4n4Py5smH3M8oOS-EBCGF2Rc0-e_Y1rmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2015-05-27 8:50 ` Jiri Benc 2015-05-27 13:24 ` [ovs-dev] " Flavio Leitner 0 siblings, 1 reply; 5+ messages in thread From: Jiri Benc @ 2015-05-27 8:50 UTC (permalink / raw) To: Pravin Shelar; +Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org, netdev On Tue, 26 May 2015 15:03:56 -0700, Pravin Shelar wrote: > OVS interface for generic networking device operation looks odd. have > you considered adding new device ioctl to do this? New ioctls for networking configuration are generally not allowed. The preferred way to configure networking is netlink. And as this is very much ovs specific (all other users of dev_disable_lro such as bridging want to do this unconditionally), ovs netlink is the correct place to put this to. Jiri -- Jiri Benc _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ovs-dev] [PATCH net] openvswitch: disable LRO unless stated otherwise 2015-05-27 8:50 ` Jiri Benc @ 2015-05-27 13:24 ` Flavio Leitner 2015-05-27 15:56 ` David Miller 0 siblings, 1 reply; 5+ messages in thread From: Flavio Leitner @ 2015-05-27 13:24 UTC (permalink / raw) To: dev; +Cc: Pravin Shelar, netdev, Jiri Benc On Wed, May 27, 2015 at 10:50:21AM +0200, Jiri Benc wrote: > On Tue, 26 May 2015 15:03:56 -0700, Pravin Shelar wrote: > > OVS interface for generic networking device operation looks odd. have > > you considered adding new device ioctl to do this? > > New ioctls for networking configuration are generally not allowed. The > preferred way to configure networking is netlink. And as this is very > much ovs specific (all other users of dev_disable_lro such as bridging > want to do this unconditionally), ovs netlink is the correct place to > put this to. Exactly. Team, Bonding, bridge, and when you enable forwarding on a networking device gets LRO automatically disabled in the kernel. I suggest to always disable LRO in the kernel as the other examples do until there is a real need in OVS to benefit from LRO to implement such API change. fbl ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ovs-dev] [PATCH net] openvswitch: disable LRO unless stated otherwise 2015-05-27 13:24 ` [ovs-dev] " Flavio Leitner @ 2015-05-27 15:56 ` David Miller 0 siblings, 0 replies; 5+ messages in thread From: David Miller @ 2015-05-27 15:56 UTC (permalink / raw) To: fbl; +Cc: dev, pshelar, netdev, jbenc From: Flavio Leitner <fbl@sysclose.org> Date: Wed, 27 May 2015 10:24:14 -0300 > On Wed, May 27, 2015 at 10:50:21AM +0200, Jiri Benc wrote: >> On Tue, 26 May 2015 15:03:56 -0700, Pravin Shelar wrote: >> > OVS interface for generic networking device operation looks odd. have >> > you considered adding new device ioctl to do this? >> >> New ioctls for networking configuration are generally not allowed. The >> preferred way to configure networking is netlink. And as this is very >> much ovs specific (all other users of dev_disable_lro such as bridging >> want to do this unconditionally), ovs netlink is the correct place to >> put this to. > > Exactly. Team, Bonding, bridge, and when you enable forwarding on a > networking device gets LRO automatically disabled in the kernel. > > I suggest to always disable LRO in the kernel as the other examples > do until there is a real need in OVS to benefit from LRO to implement > such API change. Agreed, just turn off LRO by default and don't add a new interface to turn it back on until we actually need it. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-05-27 15:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-26 17:38 [PATCH net] openvswitch: disable LRO unless stated otherwise Jiri Benc
[not found] ` <15f0c96df9cc152b05d8a5ff0c0059eb1f042cca.1432661690.git.jbenc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-26 22:03 ` Pravin Shelar
[not found] ` <CALnjE+o-rHrcrmbwb4n4Py5smH3M8oOS-EBCGF2Rc0-e_Y1rmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-27 8:50 ` Jiri Benc
2015-05-27 13:24 ` [ovs-dev] " Flavio Leitner
2015-05-27 15:56 ` David Miller
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).