netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>, netdev@vger.kernel.org
Subject: Re: [Patch net-next v2 4/4] net_sched: kill u32_node pointer in Qdisc
Date: Fri, 25 Aug 2017 14:37:40 +0200	[thread overview]
Message-ID: <20170825123740.GF2023@nanopsycho> (raw)
In-Reply-To: <c54bd7cc-ab56-6aac-2e24-85e9e8e1c708@mojatatu.com>

Fri, Aug 25, 2017 at 02:29:57PM CEST, jhs@mojatatu.com wrote:
>On 17-08-24 07:51 PM, Cong Wang wrote:
>> It is ugly to hide a u32-filter-specific pointer inside Qdisc,
>> this breaks the TC layers:
>> 
>> 1. Qdisc is a generic representation, should not have any specific
>>     data of any type
>> 
>> 2. Qdisc layer is above filter layer, should only save filters in
>>     the list of struct tcf_proto.
>> 
>> This pointer is used as the head of the chain of u32 hash tables,
>> that is struct tc_u_hnode, because u32 filter is very special,
>> it allows to create multiple hash tables within one qdisc and
>> across multiple u32 filters.
>> 
>> Instead of using this ugly pointer, we can just save it in a global
>> hash table key'ed by (dev ifindex, qdisc handle), therefore we can
>> still treat it as a per qdisc basis data structure conceptually.
>> 
>> Of course, because of network namespaces, this key is not unique
>> at all, but it is fine as we already have a pointer to Qdisc in
>> struct tc_u_common, we can just compare the pointers when collision.
>> 
>> And this only affects slow paths, has no impact to fast path,
>> thanks to the pointer ->tp_c.
>> 
>> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
>> Cc: Jiri Pirko <jiri@resnulli.us>
>> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>
>Nice work. should open the doors for Jiri now.

One of the doors, couple more left :)

>
>Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
>
>cheers,
>jamal

  reply	other threads:[~2017-08-25 12:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24 23:51 [Patch net-next v2 0/4] net_sched: clean up tc classes and u32 filter Cong Wang
2017-08-24 23:51 ` [Patch net-next v2 1/4] net_sched: get rid of more forward declarations Cong Wang
2017-08-25  8:45   ` Jiri Pirko
2017-08-25 11:51   ` Jamal Hadi Salim
2017-08-24 23:51 ` [Patch net-next v2 2/4] net_sched: introduce tclass_del_notify() Cong Wang
2017-08-25  8:54   ` Jiri Pirko
2017-08-25 11:51   ` Jamal Hadi Salim
2017-08-24 23:51 ` [Patch net-next v2 3/4] net_sched: remove tc class reference counting Cong Wang
2017-08-25  9:00   ` Jiri Pirko
2017-08-25  9:18     ` Florian Westphal
2017-08-25  9:36       ` Jiri Pirko
2017-08-25  9:41   ` Jiri Pirko
2017-08-25 12:28   ` Jamal Hadi Salim
2017-08-24 23:51 ` [Patch net-next v2 4/4] net_sched: kill u32_node pointer in Qdisc Cong Wang
2017-08-25  9:06   ` Jiri Pirko
2017-08-25 12:29   ` Jamal Hadi Salim
2017-08-25 12:37     ` Jiri Pirko [this message]
2017-08-26  0:20 ` [Patch net-next v2 0/4] net_sched: clean up tc classes and u32 filter 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=20170825123740.GF2023@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=jhs@mojatatu.com \
    --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;
as well as URLs for NNTP newsgroup(s).