netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@netronome.com>
To: netdev@vger.kernel.org
Cc: dev@openvswitch.org, Pravin Shelar <pshelar@nicira.com>,
	Simon Horman <simon.horman@netronome.com>
Subject: [PATCH/RFC] openvswitch: loosen restriction of output of MPLS to tunnel vports
Date: Fri, 12 Feb 2016 20:25:33 +0100	[thread overview]
Message-ID: <1455305133-23285-1-git-send-email-simon.horman@netronome.com> (raw)

If an skb was not MPLS initially then it may be GSO and in that case if it
became MPLS then GSO can't be performed because both MPLS and tunnels make
use of the inner_protocol field of struct skbuff in order to allow GSO to
be performed in the inner packet.

On the other hand if an skb was MPLS initially then it will not be GSO,
as there is no support for GRO for MPLS. Thus in this case it is safe
to allow output of MPLS on tunnel vports.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 net/openvswitch/flow_netlink.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
index d1bd4a45ca2d..a574796f35d2 100644
--- a/net/openvswitch/flow_netlink.c
+++ b/net/openvswitch/flow_netlink.c
@@ -2038,7 +2038,13 @@ static int validate_set(const struct nlattr *a,
 		break;
 
 	case OVS_KEY_ATTR_TUNNEL:
-		if (eth_p_mpls(eth_type))
+		/* If an skb was not MPLS initially then it may be GSO
+		 * and in that case if it became MPLS then GSO can't be
+		 * performed because both MPLS and tunnels make use
+		 * of the inner_protocol field of struct skbuff in order
+		 * to allow GSO to be performed in the inner packet.
+		 */
+		if (!eth_p_mpls(flow_key->eth.type) && eth_p_mpls(eth_type))
 			return -EINVAL;
 
 		if (masked)
-- 
2.7.0.rc3.207.g0ac5344

             reply	other threads:[~2016-02-12 19:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12 19:25 Simon Horman [this message]
2016-02-16 22:53 ` [PATCH/RFC] openvswitch: loosen restriction of output of MPLS to tunnel vports Jesse Gross
     [not found]   ` <CAEh+42g5GXduCgr0WCyAKvSO6LeATFuZoWU2aR0sfNDbJqG=6Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-19  7:59     ` Simon Horman
2016-02-19 15:45       ` Jesse Gross

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=1455305133-23285-1-git-send-email-simon.horman@netronome.com \
    --to=simon.horman@netronome.com \
    --cc=dev@openvswitch.org \
    --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).