Message ID | 1462347393-22354-3-git-send-email-simon.horman@netronome.com |
---|---|
State | Not Applicable |
Headers | show
Return-Path: <dev-bounces@openvswitch.org> 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 3r08xs3RQfz9t5w for <incoming@patchwork.ozlabs.org>; Wed, 4 May 2016 17:37:05 +1000 (AEST) 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=fAozbWdk; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 805AC106B6; Wed, 4 May 2016 00:36:58 -0700 (PDT) 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 7FC80106B2 for <dev@openvswitch.org>; Wed, 4 May 2016 00:36:57 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 0EFEA1E035C for <dev@openvswitch.org>; Wed, 4 May 2016 01:36:57 -0600 (MDT) X-ASG-Debug-ID: 1462347416-09eadd60402762a0001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar5.cudamail.com with ESMTP id Ec9yqYKDtfwMVjSJ (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for <dev@openvswitch.org>; Wed, 04 May 2016 01:36:56 -0600 (MDT) X-Barracuda-Envelope-From: simon.horman@netronome.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mail-pa0-f54.google.com) (209.85.220.54) by mx1-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 4 May 2016 07:36:56 -0000 Received-SPF: neutral (mx1-pf2.cudamail.com: 209.85.220.54 is neither permitted nor denied by SPF record at spf.mandrillapp.com) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.54 Received: by mail-pa0-f54.google.com with SMTP id iv1so21095524pac.2 for <dev@openvswitch.org>; Wed, 04 May 2016 00:36:56 -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:in-reply-to:references; bh=v/XP+TJsXf3pnlflFk/t9G+koxqiE1YbA42s6uXJ3Uo=; b=fAozbWdkgGNBecFRg4UChqb0lo7t9VsoWGY4O1QrdFKGSq1D23anrM0grlcc1vBcAB R7s+mJaFfST2tb6W/BBDaGnpeiIrOFMDIBRqvtfV6NvWTaSrSDSa9cFGiFKrMzETnXP5 M8f+K8zb6JnfdqZM4bZ0fo1uepBnL/NY1BhYuAc3t/sr86ErliWm44uD7opc/r+l12y3 Z4nRiIcWV7YOAYYI84AKyhCmzUv1qdAJPtL8CgrbISp/INJ37A25J4oPiyp/s+kiyz+V ypNmoOA/Kwiru4UUlRPa+VGVPVyeeUbOp9XGV9kM96hMP5AXhU7+ZA7YjWrLBfLYOpvI 0D6A== 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:in-reply-to :references; bh=v/XP+TJsXf3pnlflFk/t9G+koxqiE1YbA42s6uXJ3Uo=; b=PfgoVPVvRLeAnzsKgvoSQlUZF8ivBhjU1drRthP1CJeOg0xIWUQNKtBuxgeSmWlRPH d/v2NA87aAY628lVTzcWY+vQsnJj6mXflT1MGcNdWYD9ob3koh02xdrDUHzE5rkV80x7 l+qx6vTM7SgCGDx7OG39pXJJEG/e3LJ4hvOJpmUHJ5roNBlE76Cezuy7tg0I9zoAEgZv DNNxAwGIwaf8TZYI4SMmnTUhrn+oUMJV42sfp9dKgK1yIdUR5WqEIzBRsfgXpZS3vQEY y3fI8NKmSq5pcfR26uMiyKR5EQTFkCeRpZWUSOYZFyQ7b0n0/11fPMECjuOf/5DWgzpr YVlQ== X-Gm-Message-State: AOPr4FWTDF7x9y6fS5kxW7qBD9dh7bayb3AuR45G1VfftKryxNpf539jYg1mHKUMmq3U3t4V X-Received: by 10.66.81.70 with SMTP id y6mr9998338pax.121.1462347415558; Wed, 04 May 2016 00:36:55 -0700 (PDT) Received: from penelope.kanocho.kobe.vergenet.net (121-80-211-180f1.hyg1.eonet.ne.jp. [121.80.211.180]) by smtp.gmail.com with ESMTPSA id 1sm3513717pah.7.2016.05.04.00.36.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 May 2016 00:36:54 -0700 (PDT) X-CudaMail-Envelope-Sender: simon.horman@netronome.com X-Barracuda-Apparent-Source-IP: 121.80.211.180 From: Simon Horman <simon.horman@netronome.com> To: netdev@vger.kernel.org, dev@openvswitch.org X-CudaMail-MID: CM-E2-503001842 X-CudaMail-DTE: 050416 X-CudaMail-Originating-IP: 209.85.220.54 Date: Wed, 4 May 2016 16:36:28 +0900 X-ASG-Orig-Subj: [##CM-E2-503001842##][PATCH v9 net-next 2/7] openvswitch: set skb protocol when receiving on internal device Message-Id: <1462347393-22354-3-git-send-email-simon.horman@netronome.com> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1462347393-22354-1-git-send-email-simon.horman@netronome.com> References: <1462347393-22354-1-git-send-email-simon.horman@netronome.com> X-GBUdb-Analysis: 0, 209.85.220.54, Ugly c=0.387593 p=-0.44186 Source Normal X-MessageSniffer-Rules: 0-0-0-5399-c X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1462347416 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.29282 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: Simon Horman <simon.horman@netronome.com> Subject: [ovs-dev] [PATCH v9 net-next 2/7] openvswitch: set skb protocol when receiving on internal device X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: <dev.openvswitch.org> List-Unsubscribe: <http://openvswitch.org/mailman/options/dev>, <mailto:dev-request@openvswitch.org?subject=unsubscribe> List-Archive: <http://openvswitch.org/pipermail/dev> List-Post: <mailto:dev@openvswitch.org> List-Help: <mailto:dev-request@openvswitch.org?subject=help> List-Subscribe: <http://openvswitch.org/mailman/listinfo/dev>, <mailto:dev-request@openvswitch.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: dev-bounces@openvswitch.org Sender: "dev" <dev-bounces@openvswitch.org> |
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c index 2ee48e447b72..4ce2ad8c3a5c 100644 --- a/net/openvswitch/vport-internal_dev.c +++ b/net/openvswitch/vport-internal_dev.c @@ -48,6 +48,8 @@ static int internal_dev_xmit(struct sk_buff *skb, struct net_device *netdev) { int len, err; + skb->protocol = eth_type_trans(skb, netdev); + skb_push(skb, ETH_HLEN); len = skb->len; rcu_read_lock(); err = ovs_vport_receive(internal_dev_priv(netdev)->vport, skb, NULL);
Set skb protocol based on contents of packet. I have observed this is necessary to get actual protocol of a packet when it is injected into an internal device e.g. by libnet in which case skb protocol will be set to ETH_ALL. The motivation for this is that support for outputting to layer 3 (non-tap) GRE tunnels as implemented by a subsequent patch depends on protocol being set correctly in order to provide the protocol for the inner packet. Signed-off-by: Simon Horman <simon.horman@netronome.com> --- v9 * New patch --- net/openvswitch/vport-internal_dev.c | 2 ++ 1 file changed, 2 insertions(+)