[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200123070627.GB2207@nanopsycho.orion>
Date: Thu, 23 Jan 2020 08:06:27 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Paul Blakey <paulb@...lanox.com>,
Saeed Mahameed <saeedm@...lanox.com>,
Oz Shlomo <ozsh@...lanox.com>,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
Vlad Buslov <vladbu@...lanox.com>,
David Miller <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Roi Dayan <roid@...lanox.com>
Subject: Re: [PATCH net-next v2 01/13] net: sched: support skb chain ext in
tc classification path
Wed, Jan 22, 2020 at 04:29:16PM CET, kuba@...nel.org wrote:
>On Wed, 22 Jan 2020 15:52:46 +0200, Paul Blakey wrote:
>> +int tcf_classify_ingress(struct sk_buff *skb,
>> + const struct tcf_block *ingress_block,
>> + const struct tcf_proto *tp, struct tcf_result *res,
>> + bool compat_mode)
>> +{
>> + const struct tcf_proto *orig_tp = tp;
>> +
>> +#if IS_ENABLED(CONFIG_NET_TC_SKB_EXT)
>> + {
>> + struct tc_skb_ext *ext = skb_ext_find(skb, TC_SKB_EXT);
>> +
>> + if (ext && ext->chain && ingress_block) {
>> + struct tcf_chain *fchain;
>> +
>> + fchain = tcf_chain_lookup_rcu(ingress_block,
>> + ext->chain);
>> + if (!fchain)
>> + return TC_ACT_UNSPEC;
>> +
>> + tp = rcu_dereference_bh(fchain->filter_chain);
>> + }
>
>Doesn't this skb ext have to be somehow "consumed" by the first lookup?
>What if the skb finds its way to an ingress of another device?
You are right. Looks like it would be better to return TC_ACT_SHOT here.
>
>> + }
>> +#endif
>> +
>> + return tcf_classify(skb, tp, orig_tp, res, compat_mode);
>> +}
>> +EXPORT_SYMBOL(tcf_classify_ingress);
Powered by blists - more mailing lists