From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: Fwd: u32 ht filters Date: Wed, 7 Feb 2018 15:08:36 -0800 Message-ID: References: <9c8f997d-339c-5088-0bb5-124e9f55f02d@itcare.pl> <20180207070148.GA2149@nanopsycho.orion> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cc: Jiri Pirko , Linux Kernel Network Developers , =?UTF-8?Q?Pawe=C5=82_Staszewski?= To: Jiri Pirko Return-path: Received: from mail-pg0-f54.google.com ([74.125.83.54]:39937 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899AbeBGXI5 (ORCPT ); Wed, 7 Feb 2018 18:08:57 -0500 Received: by mail-pg0-f54.google.com with SMTP id g2so908846pgn.7 for ; Wed, 07 Feb 2018 15:08:57 -0800 (PST) In-Reply-To: <20180207070148.GA2149@nanopsycho.orion> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, Feb 6, 2018 at 11:01 PM, Jiri Pirko wrote: > Wed, Feb 07, 2018 at 06:09:15AM CET, xiyou.wangcong@gmail.com wrote: >>Hi, Jiri >> >>Your commit 7fa9d974f3c2a016b9accb18f4ee2ed2a738585c >>breaks the tc script by Pawe=C5=82. Please find below for details. > > Did you do the bisection? > The commit just uses block struct instead of q, but since they > are in 1:1 relation, that should be equvivalent. So basically you still > have per-qdisc hashtables for u32. Well, at least the following fixes the problem here. But I am not sure if it is expected too for shared block among multiple qdiscs. @@ -338,7 +330,7 @@ static struct hlist_head *tc_u_common_hash; static unsigned int tc_u_hash(const struct tcf_proto *tp) { - return hash_ptr(tp->chain->block, U32_HASH_SHIFT); + return hash_ptr(tp->chain->block->q, U32_HASH_SHIFT); } static struct tc_u_common *tc_u_common_find(const struct tcf_proto *tp) @@ -348,7 +340,7 @@ static struct tc_u_common *tc_u_common_find(const struct tcf_proto *tp) h =3D tc_u_hash(tp); hlist_for_each_entry(tc, &tc_u_common_hash[h], hnode) { - if (tc->block =3D=3D tp->chain->block) + if (tc->block->q =3D=3D tp->chain->block->q) return tc; } return NULL;