Netdev List
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: "Jiri Pirko" <jiri@mellanox.com>,
	"Linux Kernel Network Developers" <netdev@vger.kernel.org>,
	"Paweł Staszewski" <pstaszewski@itcare.pl>
Subject: Re: Fwd: u32 ht filters
Date: Mon, 12 Feb 2018 16:32:16 +0100	[thread overview]
Message-ID: <20180212153216.GB2153@nanopsycho> (raw)
In-Reply-To: <CAM_iQpXwKmuuDaHWuJ+E60P2pr00tsVr2+p_hY++D7Vi8Hbavw@mail.gmail.com>

Sat, Feb 10, 2018 at 09:41:57PM CET, xiyou.wangcong@gmail.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.

  parent reply	other threads:[~2018-02-12 15:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9c8f997d-339c-5088-0bb5-124e9f55f02d@itcare.pl>
2018-02-07  5:09 ` Fwd: u32 ht filters Cong Wang
2018-02-07  7:01   ` Jiri Pirko
2018-02-07 23:08     ` Cong Wang
2018-02-08  7:38       ` Jiri Pirko
2018-02-10 20:41         ` Cong Wang
2018-02-12 13:23           ` Jiri Pirko
2018-02-12 15:32           ` Jiri Pirko [this message]
2018-02-12 15:51             ` Jiri Pirko

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=20180212153216.GB2153@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=jiri@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=pstaszewski@itcare.pl \
    --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