From: "Nambiar, Amritha" <amritha.nambiar@intel.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
alexander.h.duyck@intel.com, jakub.kicinski@netronome.com,
sridhar.samudrala@intel.com, jhs@mojatatu.com,
jesse.brandeburg@intel.com, xiyou.wangcong@gmail.com
Subject: Re: [net-next, RFC PATCH] net: sched: cls_range: Introduce Range classifier
Date: Fri, 14 Sep 2018 18:31:22 -0700 [thread overview]
Message-ID: <c2f10515-b484-2965-ac1f-c46ad9705bd3@intel.com> (raw)
In-Reply-To: <20180914095813.GL25110@nanopsycho>
On 9/14/2018 2:58 AM, Jiri Pirko wrote:
> Thu, Sep 13, 2018 at 10:52:06PM CEST, amritha.nambiar@intel.com wrote:
>
> [...]
>
>> +static struct cls_range_filter *range_lookup(struct cls_range_head *head,
>> + struct range_flow_key *key,
>> + struct range_flow_key *mkey,
>> + bool is_skb)
>> +{
>> + struct cls_range_filter *filter, *next_filter;
>> + struct range_params range;
>> + int ret;
>> + size_t cmp_size;
>> +
>> + list_for_each_entry_safe(filter, next_filter, &head->filters, flist) {
>
> This really should be list_for_each_entry_rcu()
>
> also, as I wrote in the previous email, this should be done in
> cls_flower. Look at fl_lookup() it looks-up hashtable. You just need to
> add linked list traversal and range comparison to that function for the
> hit in the hashtable.
>
I see. Will integrate the range comparison into cls_flower.
>
>> + if (!is_skb) {
>> + /* Existing filter comparison */
>> + cmp_size = sizeof(filter->mkey);
>> + } else {
>> + /* skb classification */
>> + ret = range_compare_params(&range, filter, key,
>> + RANGE_PORT_DST);
>> + if (ret < 0)
>> + continue;
>> +
>> + ret = range_compare_params(&range, filter, key,
>> + RANGE_PORT_SRC);
>> + if (ret < 0)
>> + continue;
>> +
>> + /* skb does not have min and max values */
>> + cmp_size = RANGE_KEY_MEMBER_OFFSET(tp_min);
>> + }
>> + if (!memcmp(mkey, &filter->mkey, cmp_size))
>> + return filter;
>> + }
>> + return NULL;
>
> [...]
>
next prev parent reply other threads:[~2018-09-15 6:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-13 20:52 [net-next,RFC PATCH] Introduce TC Range classifier Amritha Nambiar
2018-09-13 20:52 ` [net-next, RFC PATCH] net: sched: cls_range: Introduce " Amritha Nambiar
2018-09-14 9:58 ` Jiri Pirko
2018-09-15 1:31 ` Nambiar, Amritha [this message]
2018-09-14 21:06 ` Cong Wang
2018-09-14 9:49 ` [net-next,RFC PATCH] Introduce TC " Jiri Pirko
2018-09-14 21:09 ` Cong Wang
2018-09-15 1:29 ` Nambiar, Amritha
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=c2f10515-b484-2965-ac1f-c46ad9705bd3@intel.com \
--to=amritha.nambiar@intel.com \
--cc=alexander.h.duyck@intel.com \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=jesse.brandeburg@intel.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=sridhar.samudrala@intel.com \
--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;
as well as URLs for NNTP newsgroup(s).