[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180212155102.GC2153@nanopsycho>
Date: Mon, 12 Feb 2018 16:51:02 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: Jiri Pirko <jiri@...lanox.com>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
Paweł Staszewski <pstaszewski@...are.pl>
Subject: Re: Fwd: u32 ht filters
Mon, Feb 12, 2018 at 04:32:16PM CET, jiri@...nulli.us wrote:
>Sat, Feb 10, 2018 at 09:41:57PM CET, xiyou.wangcong@...il.com wrote:
>
>[...]
>
>>>>@@ -348,7 +340,7 @@ static struct tc_u_common *tc_u_common_find(const
>>>>struct tcf_proto *tp)
>>>>
>>>> h = tc_u_hash(tp);
>>>> hlist_for_each_entry(tc, &tc_u_common_hash[h], hnode) {
>>>>- if (tc->block == tp->chain->block)
>>>>+ if (tc->block->q == tp->chain->block->q)
>>>
>>> :O I don't get it. tc->block is pointer, tc->block->q is pointer. And
>>> they are different at the same time for non-shared block.
>>
>>If you look into Pawel's script, a new block is created for each class
>>therefore a different tc_u_common is created which causes the
>>ht 9:22 can't be found.
>
>But wait. Originally this code looked like this:
>static unsigned int tc_u_hash(const struct tcf_proto *tp)
>{
> struct net_device *dev = tp->q->dev_queue->dev;
> u32 qhandle = tp->q->handle;
> int ifindex = dev->ifindex;
>
> return hash_64((u64)ifindex << 32 | qhandle, U32_HASH_SHIFT);
>}
>
>static struct tc_u_common *tc_u_common_find(const struct tcf_proto *tp)
>{
> struct tc_u_common *tc;
> unsigned int h;
>
> h = tc_u_hash(tp);
> hlist_for_each_entry(tc, &tc_u_common_hash[h], hnode) {
> if (tc->q == tp->q)
> return tc;
> }
> return NULL;
>}
>
>That means that tc_u_common is identified according to tp->q. And that
>is different for every class. How that could work? I'm properly confused.
Okay, now I see what is wrong. I wrongly assumed 1:1 block:q. Will fix.
Powered by blists - more mailing lists