From patchwork Mon Oct 26 00:11:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas F Herbert X-Patchwork-Id: 535638 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id A5A34141352 for ; Mon, 26 Oct 2015 11:13:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=W3JYvQgx; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id ACD7610654; Sun, 25 Oct 2015 17:13:39 -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 AB03D10650 for ; Sun, 25 Oct 2015 17:13:38 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 2A9481E0377 for ; Sun, 25 Oct 2015 18:13:38 -0600 (MDT) X-ASG-Debug-ID: 1445818417-09eadd4c93314410001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar5.cudamail.com with ESMTP id BCtrxbVVJly0kxgP (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 25 Oct 2015 18:13:37 -0600 (MDT) X-Barracuda-Envelope-From: thomasfherbert@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mail-qg0-f44.google.com) (209.85.192.44) by mx1-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 26 Oct 2015 00:13:37 -0000 Received-SPF: pass (mx1-pf2.cudamail.com: SPF record at _netblocks.google.com designates 209.85.192.44 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.192.44 X-Barracuda-RBL-IP: 209.85.192.44 Received: by qgeo38 with SMTP id o38so108357652qge.0 for ; Sun, 25 Oct 2015 17:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ppCwS2ZqEwdhItg6FAwy6mQhGGbCxoqHrb9CkUZhdss=; b=W3JYvQgxOOoRf6EqVuF9sfkBege4G4aEYzdiyemYlxEbrpoJGSsCQ9g8SU2v3LIalq uqKDHwzTsf3uaqTH6dCOQ/Pf43vWx6h+4fc6BtLh15u42wRX8oN1/dM2i4EdzasoJxd7 13nyrqbe2CEZIsEfmrbAZ9hBR5APFC/mS57bB4vIQN/P6VcEndVt9u1w+XPQN0pXcPxJ AnGO70VvJMR0uDomiAd2mPHsc8p1CFblr2XddVHPuONRaD7MUQESdO98SKrosL16JtKz 9xj+JFek1uND0JjbASg09UTIT9Hwx9eEO1iqMazlI4zA/W4tXYp1Zju5wdsYNVAWwrpL 2Y5Q== X-Received: by 10.140.19.13 with SMTP id 13mr38438921qgg.97.1445818415074; Sun, 25 Oct 2015 17:13:35 -0700 (PDT) Received: from localhost.localdomain (pool-173-53-26-105.rcmdva.fios.verizon.net. [173.53.26.105]) by smtp.gmail.com with ESMTPSA id 20sm146931qhg.13.2015.10.25.17.13.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Oct 2015 17:13:34 -0700 (PDT) X-CudaMail-Envelope-Sender: thomasfherbert@gmail.com From: Thomas F Herbert To: netdev@vger.kernel.org, pshelar@nicira.com X-CudaMail-MID: CM-E2-1024026946 X-CudaMail-DTE: 102515 X-CudaMail-Originating-IP: 209.85.192.44 Date: Sun, 25 Oct 2015 20:11:25 -0400 X-ASG-Orig-Subj: [##CM-E2-1024026946##][PATCH net-next V17 2/3] Check for vlan ethernet types for 8021.q or 802.1ad Message-Id: <1445818286-4870-3-git-send-email-thomasfherbert@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1445818286-4870-1-git-send-email-thomasfherbert@gmail.com> References: <1445818286-4870-1-git-send-email-thomasfherbert@gmail.com> X-GBUdb-Analysis: 0, 209.85.192.44, Ugly c=0.387593 p=-0.255814 Source Normal X-MessageSniffer-Rules: 0-0-0-3999-c X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1445818417 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.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_SC5_MJ1963, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.23813 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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, therbert@redhat.com Subject: [ovs-dev] [PATCH net-next V17 2/3] Check for vlan ethernet types for 8021.q or 802.1ad 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" Signed-off-by: Thomas F Herbert --- include/linux/if_vlan.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 67ce5bd..d2494b5 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -627,6 +627,22 @@ static inline netdev_features_t vlan_features_check(const struct sk_buff *skb, return features; } +/** + * eth_type_vlan - check for valid vlan ether type. + * @ethertype: ether type to check + * + * Returns true if the ether type is a vlan ether type. + */ +static inline bool eth_type_vlan(__be16 ethertype) +{ + switch (ethertype) { + case htons(ETH_P_8021Q): + case htons(ETH_P_8021AD): + return true; + default: + return false; + } +} /** * compare_vlan_header - Compare two vlan headers