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 net-next 4/5] net/sched: flower: Dump the ethertype encapsulated in vlan
Date: Sat, 30 Jun 2018 09:53:16 +0000 [thread overview]
Message-ID: <20180630095317.5691-5-jianbol@mellanox.com> (raw)
In-Reply-To: <20180630095317.5691-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 e6774af..30f3e18 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -1255,6 +1255,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_u16(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
next prev parent reply other threads:[~2018-06-30 9:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-30 9:53 [PATCH net-next 0/5] Introduce matching on double vlan/QinQ headers for TC flower Jianbo Liu
2018-06-30 9:53 ` [PATCH net-next 1/5] net/flow_dissector: Save vlan ethertype from headers Jianbo Liu
2018-06-30 9:53 ` [PATCH net-next 2/5] net/sched: flower: Add support for matching on vlan ethertype Jianbo Liu
2018-06-30 9:53 ` [PATCH net-next 3/5] net/flow_dissector: Add support for QinQ dissection Jianbo Liu
2018-06-30 9:53 ` Jianbo Liu [this message]
2018-06-30 12:54 ` [PATCH net-next 4/5] net/sched: flower: Dump the ethertype encapsulated in vlan kbuild test robot
2018-06-30 9:53 ` [PATCH net-next 5/5] net/sched: flower: Add supprt for matching on QinQ vlan headers Jianbo Liu
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=20180630095317.5691-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