From: Jiri Benc <jbenc@redhat.com>
To: netdev@vger.kernel.org
Cc: dev@openvswitch.org, Pravin Shelar <pshelar@nicira.com>,
Jesse Gross <jesse@nicira.com>
Subject: [PATCH net] openvswitch: disable LRO unless stated otherwise
Date: Tue, 26 May 2015 19:38:29 +0200 [thread overview]
Message-ID: <15f0c96df9cc152b05d8a5ff0c0059eb1f042cca.1432661690.git.jbenc@redhat.com> (raw)
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
next reply other threads:[~2015-05-26 17:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-26 17:38 Jiri Benc [this message]
[not found] ` <15f0c96df9cc152b05d8a5ff0c0059eb1f042cca.1432661690.git.jbenc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-26 22:03 ` [PATCH net] openvswitch: disable LRO unless stated otherwise 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15f0c96df9cc152b05d8a5ff0c0059eb1f042cca.1432661690.git.jbenc@redhat.com \
--to=jbenc@redhat.com \
--cc=dev@openvswitch.org \
--cc=jesse@nicira.com \
--cc=netdev@vger.kernel.org \
--cc=pshelar@nicira.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).