From patchwork Thu Oct 15 14:01:54 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: 530746 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 546F51402BC for ; Fri, 16 Oct 2015 01:56:09 +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=HtqgEmaZ; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 5892110A45; Thu, 15 Oct 2015 07:56:08 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 1B01E10A3A for ; Thu, 15 Oct 2015 07:56:07 -0700 (PDT) Received: from bar4.cudamail.com (bar2 [192.168.15.2]) by mx3v1.cudamail.com (Postfix) with ESMTP id 15E88C42CC for ; Thu, 15 Oct 2015 08:44:13 -0600 (MDT) X-ASG-Debug-ID: 1444917746-03dc214308a3680001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar4.cudamail.com with ESMTP id iAV0QScYhK8YYDjt (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 15 Oct 2015 08:02:26 -0600 (MDT) X-Barracuda-Envelope-From: thomasfherbert@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mail-qg0-f46.google.com) (209.85.192.46) by mx3-pf3.cudamail.com with ESMTPS (RC4-SHA encrypted); 15 Oct 2015 14:02:23 -0000 Received-SPF: pass (mx3-pf3.cudamail.com: SPF record at _netblocks.google.com designates 209.85.192.46 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.192.46 X-Barracuda-RBL-IP: 209.85.192.46 Received: by qgt47 with SMTP id 47so71404378qgt.2 for ; Thu, 15 Oct 2015 07:02:23 -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=FMA2TatrCOIDbDjF79OgkpqdtCOp9QSAlJO9stmgWp0=; b=HtqgEmaZrA2DtY6iQcEm6LECcnVwqiVqeEwEn4Hv0fiV1lAOYvDbocAh+gsaq6BGp1 krU1W7n4CZilg/vkYe4i//sqdU4L7MaFPQ4z5R0Lq/eDAc55eR40ypn1EaDbmp4I+wwI 5RaCxuZDN9ppVe36i718USnbaoJgEo4EmGiDE0SZdWjrrUBndbCQQr27pPS+gLPJ5SGU TdKFtDlLQE3jdotPCejVc5uwlECLO4e0ae2c5yftaKwJ47Y7+3s17niPgQKAUblaMkP3 8MJm+0jmfCyJh3MBGdA7to3SBzIcpplePAvN2kYtzPI6zL7iV0KEa/sLZX+j8lWo1gdl W1hg== X-Received: by 10.140.239.82 with SMTP id k79mr12568283qhc.50.1444917743544; Thu, 15 Oct 2015 07:02:23 -0700 (PDT) Received: from localhost.localdomain (70-88-185-170-ubr905-ne-ma.hfc.comcastbusiness.net. [70.88.185.170]) by smtp.gmail.com with ESMTPSA id z196sm5472013qhd.22.2015.10.15.07.02.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 07:02:23 -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-V3-1014017772 X-CudaMail-DTE: 101515 X-CudaMail-Originating-IP: 209.85.192.46 Date: Thu, 15 Oct 2015 10:01:54 -0400 X-ASG-Orig-Subj: [##CM-V3-1014017772##][PATCH net-next V16 2/3] Check for vlan ethernet types for 8021.q or 802.1ad Message-Id: <1444917715-27093-3-git-send-email-thomasfherbert@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1444917715-27093-1-git-send-email-thomasfherbert@gmail.com> References: <1444917715-27093-1-git-send-email-thomasfherbert@gmail.com> X-GBUdb-Analysis: 0, 209.85.192.46, Ugly c=0.444918 p=-0.28 Source Normal X-MessageSniffer-Rules: 0-0-0-3925-c X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1444917746 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.23512 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 V16 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" --- 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..ac23521 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