From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jianbo Liu Subject: [PATCH net-next 4/5] net/sched: flower: Dump the ethertype encapsulated in vlan Date: Sat, 30 Jun 2018 09:53:16 +0000 Message-ID: <20180630095317.5691-5-jianbol@mellanox.com> References: <20180630095317.5691-1-jianbol@mellanox.com> Cc: Jianbo Liu , Jamal Hadi Salim , Cong Wang To: netdev@vger.kernel.org, davem@davemloft.net, jiri@resnulli.us Return-path: Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:36822 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S936191AbeF3JyF (ORCPT ); Sat, 30 Jun 2018 05:54:05 -0400 In-Reply-To: <20180630095317.5691-1-jianbol@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 Acked-by: Jiri Pirko --- 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