public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Thomas F Herbert <thomasfherbert@gmail•com>
To: netdev@vger•kernel.org, pshelar@nicira•com
Cc: therbert@redhat•com, dev@openvswitch•org,
	Thomas F Herbert <thomasfherbert@gmail•com>
Subject: [PATCH net-next V10 2/4] General check for vlan ethernet types
Date: Tue,  2 Jun 2015 13:50:42 -0400	[thread overview]
Message-ID: <1433267444-26025-3-git-send-email-thomasfherbert@gmail.com> (raw)
In-Reply-To: <1433267444-26025-1-git-send-email-thomasfherbert@gmail.com>

This patch adds a function to check for vlan ethernet types. There is a
use case in openvswitch and it should be useful elsewhere.

Signed-off-by: Thomas F Herbert <thomasfherbert@gmail•com>
---
 include/linux/if_vlan.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 920e445..3713454 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -627,5 +627,14 @@ static inline netdev_features_t vlan_features_check(const struct sk_buff *skb,
 
 	return features;
 }
+/**
+ * Check for legal valid vlan ether type.
+ */
+static inline bool eth_type_vlan(__be16 ethertype)
+{
+	if (ethertype == htons(ETH_P_8021Q) || ethertype == htons(ETH_P_8021AD))
+		return true;
+	return false;
+}
 
 #endif /* !(_LINUX_IF_VLAN_H_) */
-- 
2.1.0

  parent reply	other threads:[~2015-06-02 17:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 17:50 [PATCH net-next V10 0/4] openvswitch: Add support for 802.1AD Thomas F Herbert
     [not found] ` <1433267444-26025-1-git-send-email-thomasfherbert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-06-02 17:50   ` [PATCH net-next V10 1/4] openvswitch: 802.1ad uapi changes Thomas F Herbert
2015-06-02 17:50 ` Thomas F Herbert [this message]
2015-06-02 17:50 ` [PATCH net-next V10 3/4] 802.1AD: Flow handling, actions and vlan parsing Thomas F Herbert
2015-06-04 17:45   ` Pravin Shelar
     [not found]     ` <CALnjE+p8tuUFoXOFvfrp154rb80o_8XhtJ+Z8RrL1Y67kw12jw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-06-04 18:18       ` Thomas F Herbert
2015-06-04 20:39         ` Pravin Shelar
2015-06-04 22:00           ` Thomas F Herbert
2015-06-02 17:50 ` [PATCH net-next V10 4/4] 8021AD: Flow key parsing and netlink attributes Thomas F Herbert
2015-06-09  3:45   ` Pravin Shelar
2015-06-10  0:13     ` Thomas F Herbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433267444-26025-3-git-send-email-thomasfherbert@gmail.com \
    --to=thomasfherbert@gmail$(echo .)com \
    --cc=dev@openvswitch$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pshelar@nicira$(echo .)com \
    --cc=therbert@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox