Netdev List
 help / color / mirror / Atom feed
From: Jianbo Liu <jianbol@mellanox.com>
To: netdev@vger.kernel.org, davem@davemloft.net, jiri@resnulli.us
Cc: Jianbo Liu <jianbol@mellanox.com>, Jiri Pirko <jiri@mellanox.com>,
	Simon Horman <simon.horman@netronome.com>,
	Andrew Lunn <andrew@lunn.ch>, Tom Herbert <tom@quantonium.net>,
	John Crispin <john@phrozen.org>, Paolo Abeni <pabeni@redhat.com>,
	Sven Eckelmann <sven.eckelmann@openmesh.com>,
	WANG Cong <xiyou.wangcong@gmail.com>,
	David Ahern <dsahern@gmail.com>,
	Jon Maloy <jon.maloy@ericsson.com>
Subject: [PATCH v2 net-next 1/5] net/flow_dissector: Save vlan ethertype from headers
Date: Fri,  6 Jul 2018 05:38:12 +0000	[thread overview]
Message-ID: <20180706053817.17712-2-jianbol@mellanox.com> (raw)
In-Reply-To: <20180706053817.17712-1-jianbol@mellanox.com>

Change vlan dissector key to save vlan tpid to support both 802.1Q
and 802.1AD ethertype.

Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
---
 include/net/flow_dissector.h | 2 +-
 net/core/flow_dissector.c    | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h
index adc24df5..8f89968 100644
--- a/include/net/flow_dissector.h
+++ b/include/net/flow_dissector.h
@@ -47,7 +47,7 @@ struct flow_dissector_key_tags {
 struct flow_dissector_key_vlan {
 	u16	vlan_id:12,
 		vlan_priority:3;
-	u16	padding;
+	__be16	vlan_tpid;
 };
 
 struct flow_dissector_key_mpls {
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 53f96e4..18cb99b 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -751,6 +751,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
 		const struct vlan_hdr *vlan;
 		struct vlan_hdr _vlan;
 		bool vlan_tag_present = skb && skb_vlan_tag_present(skb);
+		__be16 saved_vlan_tpid = proto;
 
 		if (vlan_tag_present)
 			proto = skb->protocol;
@@ -789,6 +790,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
 					(ntohs(vlan->h_vlan_TCI) &
 					 VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT;
 			}
+			key_vlan->vlan_tpid = saved_vlan_tpid;
 		}
 
 		fdret = FLOW_DISSECT_RET_PROTO_AGAIN;
-- 
2.9.5

  reply	other threads:[~2018-07-06  5:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-06  5:38 [PATCH v2 net-next 0/5] Introduce matching on double vlan/QinQ headers for TC flower Jianbo Liu
2018-07-06  5:38 ` Jianbo Liu [this message]
2018-07-06  5:38 ` [PATCH v2 net-next 2/5] net/sched: flower: Add support for matching on vlan ethertype Jianbo Liu
2018-07-06  5:38 ` [PATCH v2 net-next 3/5] net/flow_dissector: Add support for QinQ dissection Jianbo Liu
2018-07-06  5:38 ` [PATCH v2 net-next 4/5] net/sched: flower: Dump the ethertype encapsulated in vlan Jianbo Liu
2018-07-06  5:38 ` [PATCH v2 net-next 5/5] net/sched: flower: Add supprt for matching on QinQ vlan headers Jianbo Liu
2018-07-08 10:27   ` Zahari, Doychev
2018-07-09  0:28     ` Jianbo Liu
2018-07-07 11:52 ` [PATCH v2 net-next 0/5] Introduce matching on double vlan/QinQ headers for TC flower David Miller

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=20180706053817.17712-2-jianbol@mellanox.com \
    --to=jianbol@mellanox.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=jiri@mellanox.com \
    --cc=jiri@resnulli.us \
    --cc=john@phrozen.org \
    --cc=jon.maloy@ericsson.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=simon.horman@netronome.com \
    --cc=sven.eckelmann@openmesh.com \
    --cc=tom@quantonium.net \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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