From patchwork Fri Feb 12 19:25:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 582285 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 497CC14076E for ; Sat, 13 Feb 2016 06:26:11 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b=Sb0Q3jdg; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id E59DD10BF7; Fri, 12 Feb 2016 11:26:09 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 35BC710BF4 for ; Fri, 12 Feb 2016 11:26:09 -0800 (PST) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 88B681E07BD for ; Fri, 12 Feb 2016 12:26:08 -0700 (MST) X-ASG-Debug-ID: 1455305167-09eadd61311c26b0001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar5.cudamail.com with ESMTP id pyPNZ0PbckWM9ujC (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 12 Feb 2016 12:26:07 -0700 (MST) X-Barracuda-Envelope-From: simon.horman@netronome.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO mail-lf0-f45.google.com) (209.85.215.45) by mx3-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 12 Feb 2016 19:26:01 -0000 Received-SPF: none (mx3-pf2.cudamail.com: domain at netronome.com does not designate permitted sender hosts) X-Barracuda-Apparent-Source-IP: 209.85.215.45 X-Barracuda-RBL-IP: 209.85.215.45 Received: by mail-lf0-f45.google.com with SMTP id 78so57810079lfy.3 for ; Fri, 12 Feb 2016 11:26:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=ol0Sr8Ia14cJo2CQr9l/KRw/9s4Rw7CHElkut2OqB1s=; b=Sb0Q3jdg2WCAvElCQDKxmPRAHbWRLPDTUdYTP96S6s2chPSNu8PHqdd31twwi1Y2TO JwiuI5ECu811BeBktB/zQxNfLcZK26gGXwWcAVEXIPTIXn/gTMNy6K2xJur5oLkbUPvJ iYUVsOW4mQS9nNvK/K0Fhcl9NmJm0+e65K4djTExBOrJ0P32bbTLjs8/aNYHInunuKey 2n0YHtj9SaDZ7jdXwkgBuAuNtj28RTENAWGmovvGnm8exgf/J1+XuQTaZj3iAKQpg3jW +lX5qOd9zTVuFWx2ynjSiMFwm7C49J6TUxYyRIrIIeFHiRhOj1tSBMXulxKQQT1kXaIi 7xKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ol0Sr8Ia14cJo2CQr9l/KRw/9s4Rw7CHElkut2OqB1s=; b=edomCZXIqin+yNxzPN4LlNKUlb4nniQDjpbF59AAXfunB6SXRswxOD5z2+hwulxR2/ t+OriR8+2lDHRGYibBE+PChNJvyXd4SwenzN5zYciGSZoRDoAuURjUgb0Zqc381OFIDA 0CBQ4PI1vMQESUcHH0mHgK3Cmkaxpi3wHeNqoLgzLqzStrYpAlV1TWMibRZOkHxrb3Ze AUFIR+Kc7JDLBXIpFkuNph/08vQgIG1vu1MdP6meW2Rms67pFH4of80ADnyPM+0wqZLp HHqHBIEdq5eTr81kffcLCZVHgq0Xaki/k1vIPXQOYjlAErQ/CsWi/tTKIiBV1EyzeKgX fuDA== X-Gm-Message-State: AG10YOR5H6vdYyNxrEFJom9ZGpJIZBBD86vMoNc+1Lxx+cdY8XzuwW3ROfNdrIzZbYZnLHV7 X-Received: by 10.25.139.6 with SMTP id n6mr1200196lfd.61.1455305159626; Fri, 12 Feb 2016 11:25:59 -0800 (PST) Received: from penelope.kubiwireless.com (45-45-71-217.dyn.estpak.ee. [217.71.45.45]) by smtp.gmail.com with ESMTPSA id h198sm2072010lfb.47.2016.02.12.11.25.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Feb 2016 11:25:58 -0800 (PST) X-CudaMail-Envelope-Sender: simon.horman@netronome.com From: Simon Horman To: netdev@vger.kernel.org X-CudaMail-MID: CM-V2-211041391 X-CudaMail-DTE: 021216 X-CudaMail-Originating-IP: 209.85.215.45 Date: Fri, 12 Feb 2016 20:25:33 +0100 X-ASG-Orig-Subj: [##CM-V2-211041391##][PATCH/RFC] openvswitch: loosen restriction of output of MPLS to tunnel vports Message-Id: <1455305133-23285-1-git-send-email-simon.horman@netronome.com> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 X-GBUdb-Analysis: 0, 209.85.215.45, Ugly c=0.387593 p=-0.44186 Source Normal X-MessageSniffer-Rules: 0-0-0-5577-c X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1455305167 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC0_MISMATCH_TO, BSF_SC5_MJ1963, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.26982 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: dev@openvswitch.org, Simon Horman Subject: [ovs-dev] [PATCH/RFC] openvswitch: loosen restriction of output of MPLS to tunnel vports X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" 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 --- 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)