From patchwork Thu Oct 1 03:32:59 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: 524710 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 C651E140D57 for ; Thu, 1 Oct 2015 13:34:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=EKAMF8Dx; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 1336F10A20; Wed, 30 Sep 2015 20:34:03 -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 2CC7010A1E for ; Wed, 30 Sep 2015 20:34:02 -0700 (PDT) Received: from bar4.cudamail.com (bar2 [192.168.15.2]) by mx3v1.cudamail.com (Postfix) with ESMTP id F39FD61837C for ; Wed, 30 Sep 2015 21:34:00 -0600 (MDT) X-ASG-Debug-ID: 1443670439-03dc212cd8097f0001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar4.cudamail.com with ESMTP id 1zX0Te7Q2Gfk42G0 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 30 Sep 2015 21:33:59 -0600 (MDT) X-Barracuda-Envelope-From: thomasfherbert@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mail-qg0-f52.google.com) (209.85.192.52) by mx3-pf3.cudamail.com with ESMTPS (RC4-SHA encrypted); 1 Oct 2015 03:33:58 -0000 Received-SPF: pass (mx3-pf3.cudamail.com: SPF record at _netblocks.google.com designates 209.85.192.52 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.192.52 X-Barracuda-RBL-IP: 209.85.192.52 Received: by qgev79 with SMTP id v79so53821227qge.0 for ; Wed, 30 Sep 2015 20:33:57 -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=AANXrZVTHUwfeD1lNn3cdt8waObcCa98qojvUrAlsls=; b=EKAMF8DxHG3M6+bO1wLXvQrgrtzeUKnBhZ0ygSCTleQ4kjGIdFFdn8ryPGyhLpv+mO PJ7P/slvbUUJBxhEdB10XsH7TO1a5DpWVe2x+cKwyRM9c0NNeVcNu2H4p2QBkCEboZLW XGnOlez6+8gVYM1qhjpxXd0YeITtZ2itCZVyKqSuZq55mvP7GpuO5tMULWTetVncgYyV NO7Dais8HahYAf1AifU4MEMYXtlFrV74BpG4tOfF9A8MqJvcgAqbpP6Kub727CahRmkb IilQijKKEbtkiUBbSerAMuZWccBSVTq+fuoFJxeJBcKQCKVeZfz1tE25V19LrSItC5hl PO7Q== X-Received: by 10.140.42.77 with SMTP id b71mr9276438qga.78.1443670437868; Wed, 30 Sep 2015 20:33:57 -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 i83sm1614411qkh.25.2015.09.30.20.33.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Sep 2015 20:33:57 -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-929085196 X-CudaMail-DTE: 093015 X-CudaMail-Originating-IP: 209.85.192.52 Date: Wed, 30 Sep 2015 23:32:59 -0400 X-ASG-Orig-Subj: [##CM-V3-929085196##][PATCH net-next V14 2/3] openvswitch: Check for vlan ethernet types for 8021.q or 802.1ad Message-Id: <1443670380-4245-3-git-send-email-thomasfherbert@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1443670380-4245-1-git-send-email-thomasfherbert@gmail.com> References: <1443670380-4245-1-git-send-email-thomasfherbert@gmail.com> X-GBUdb-Analysis: 0, 209.85.192.52, Ugly c=0.44896 p=-0.410256 Source Normal X-MessageSniffer-Rules: 0-0-0-4048-c X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1443670439 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.23066 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 V14 2/3] openvswitch: 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 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 67ce5bd..88d1be4 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -627,6 +627,23 @@ 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)): + return true; + case (htons(ETH_P_8021AD)): + return true; + default: + return false; + } +} /** * compare_vlan_header - Compare two vlan headers