From patchwork Tue Mar 15 02:52:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 597337 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3qPK1M4tKpz9sCk for ; Tue, 15 Mar 2016 13:53:09 +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=poCFxRN4; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 8BD861024D; Mon, 14 Mar 2016 19:53:08 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 913D2101FC for ; Mon, 14 Mar 2016 19:53:02 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 31B2B1620B7 for ; Mon, 14 Mar 2016 20:53:00 -0600 (MDT) X-ASG-Debug-ID: 1458010378-0b32372fb4342230001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar6.cudamail.com with ESMTP id Y8vcpaLHJSXVf9Ub (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 14 Mar 2016 20:52:58 -0600 (MDT) X-Barracuda-Envelope-From: simon.horman@netronome.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mail-pf0-f171.google.com) (209.85.192.171) by mx3-pf3.cudamail.com with ESMTPS (RC4-SHA encrypted); 15 Mar 2016 03:48:11 -0000 Received-SPF: none (mx3-pf3.cudamail.com: domain at netronome.com does not designate permitted sender hosts) X-Barracuda-RBL-Trusted-Forwarder: 209.85.192.171 Received: by mail-pf0-f171.google.com with SMTP id u190so7440456pfb.3 for ; Mon, 14 Mar 2016 19:52:57 -0700 (PDT) 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=QgjsfnatGjisYQxQGdDQF/S7OEX6+rE0qT4qz+Y0LLo=; b=poCFxRN49wftnAImJnbr9Osk3qldKyZUneYahLwt/jmXaw1jebGH/J+KJYyEy7jBY3 20WQ7ErYdrL/8oZHZudmbWSbuzJcgy9F7xtn5imz69NKA74iqutsJYV3dVHXrO2Bd0zC Ne8axG+7QCXg0GqA+elww6ehcI8D4xVW+L157f/RibIUSF+Eq5tZYSAZpN4fV8fdbV9Q w4mJoHdsUQ9cfj0OsTv8aBIG4ACm69fvDChi4yLgu+G6Z0YLXD6myPZX2pI8IsaReGPE RANlIrBujojazdoiA2Vfgq6LyR2I44L1o1oM6+BqQaj2N9i7yqMdJur4XXL06OtQufGz 7uIg== 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=QgjsfnatGjisYQxQGdDQF/S7OEX6+rE0qT4qz+Y0LLo=; b=QgO5CxGIBR7LKPO/gwLzxAubRbNU3fDW+aaB5eZsS9sOLrnpWi9A+TH9Y7NhzmMg3E p7UInFDbytxEexMbH+upbBIC+jk9JP0DXjz46zseShTomvDGyaNKGIpfU2OyZwpELCG6 OI0AGNSmwvbEq52/2boYcoFTu6ptRo5BvyYtC4WiJNt+Z6b/FuCnzRQHsNjuUoHO26G7 frtweaZc/iIZWRe3Jws74YZLh9Tknh6ne2VcFnTaBIdnAI+FrgMA4ULiebg8GtDDNRUw eKCc3Qfl9Nbbx0L7IRk1n7kc8g18lkBUhlwF/iWClXsLxBLcZsZxTc7ALzHa5dSS/Xya lBrA== X-Gm-Message-State: AD7BkJKu9jlNnZc2+dBB7uS0Hs+GA+7IAVJHX66uGziIB7vsQKbnMNjw4VL2tqPmh5NY5hr9 X-Received: by 10.98.13.216 with SMTP id 85mr34537491pfn.143.1458010377432; Mon, 14 Mar 2016 19:52:57 -0700 (PDT) Received: from reginn.isobedori.kobe.vergenet.net (p2210-ipbfp1103kobeminato.hyogo.ocn.ne.jp. [122.23.9.210]) by smtp.gmail.com with ESMTPSA id q4sm1023890pfi.94.2016.03.14.19.52.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Mar 2016 19:52:56 -0700 (PDT) X-CudaMail-Envelope-Sender: simon.horman@netronome.com X-Barracuda-Apparent-Source-IP: 122.23.9.210 From: Simon Horman To: Pravin Shelar , David Miller X-CudaMail-MID: CM-V3-313070954 X-CudaMail-DTE: 031416 X-CudaMail-Originating-IP: 209.85.192.171 Date: Tue, 15 Mar 2016 11:52:42 +0900 X-ASG-Orig-Subj: [##CM-V3-313070954##][PATCH net-next] openvswitch: allow output of MPLS packets on tunnel vports Message-Id: <1458010362-17878-1-git-send-email-simon.horman@netronome.com> X-Mailer: git-send-email 2.1.4 X-GBUdb-Analysis: 0, 209.85.192.171, Ugly c=0.401053 p=-0.265306 Source Normal X-MessageSniffer-Rules: 0-0-0-6075-c X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1458010378 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.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.27852 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 Cc: dev@openvswitch.org, netdev@vger.kernel.org Subject: [ovs-dev] [PATCH net-next] openvswitch: allow output of MPLS packets on 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" From: Simon Horman Currently output of MPLS packets on tunnel vports is not allowed by Open vSwitch. This is because historically encapsulation was done in such a way that the inner_protocol field of the skb needed to hold the inner protocol for both MPLS and tunnel encapsulation in order for GSO segmentation to be performed correctly. Since b2acd1dc3949 ("openvswitch: Use regular GRE net_device instead of vport") Open vSwitch makes use of lwt to output to tunnel netdevs which perform encapsulation. As no drivers expose support for MPLS offloads this means that GSO packets are segmented in software by validate_xmit_skb(), which is called from __dev_queue_xmit(), before tunnel encapsulation occurs. This means that the inner protocol of MPLS is no longer needed by the time encapsulation occurs and the contention on the inner_protocol field of the skb no longer occurs. Thus it is now safe to output MPLS to tunnel vports. Signed-off-by: Simon Horman --- Lightly tested with Geneve, GRE and VXLAN --- net/openvswitch/flow_netlink.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c index 58b8efc23668..689c17264221 100644 --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c @@ -2044,9 +2044,6 @@ static int validate_set(const struct nlattr *a, break; case OVS_KEY_ATTR_TUNNEL: - if (eth_p_mpls(eth_type)) - return -EINVAL; - if (masked) return -EINVAL; /* Masked tunnel set not supported. */