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>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>
Subject: [PATCH v2 net-next 4/5] net/sched: flower: Dump the ethertype encapsulated in vlan
Date: Fri,  6 Jul 2018 05:38:15 +0000	[thread overview]
Message-ID: <20180706053817.17712-5-jianbol@mellanox.com> (raw)
In-Reply-To: <20180706053817.17712-1-jianbol@mellanox.com>

Currently the encapsulated ethertype is not dumped as it's the same as
TCA_FLOWER_KEY_ETH_TYPE keyvalue. But the dumping result is inconsistent
with input, we add dumping it with TCA_FLOWER_KEY_VLAN_ETH_TYPE.

Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
---
 net/sched/cls_flower.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index da9ec30..e93b13d 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -1313,6 +1313,10 @@ static int fl_dump(struct net *net, struct tcf_proto *tp, void *fh,
 	if (fl_dump_key_vlan(skb, &key->vlan, &mask->vlan))
 		goto nla_put_failure;
 
+	if (mask->vlan.vlan_tpid &&
+	    nla_put_be16(skb, TCA_FLOWER_KEY_VLAN_ETH_TYPE, key->basic.n_proto))
+		goto nla_put_failure;
+
 	if ((key->basic.n_proto == htons(ETH_P_IP) ||
 	     key->basic.n_proto == htons(ETH_P_IPV6)) &&
 	    (fl_dump_key_val(skb, &key->basic.ip_proto, TCA_FLOWER_KEY_IP_PROTO,
-- 
2.9.5

  parent 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 ` [PATCH v2 net-next 1/5] net/flow_dissector: Save vlan ethertype from headers Jianbo Liu
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 ` Jianbo Liu [this message]
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-5-jianbol@mellanox.com \
    --to=jianbol@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --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