lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5785632a-b112-ad84-6355-2febe52f375a@mojatatu.com>
Date:   Fri, 21 Apr 2023 11:31:56 -0300
From:   Pedro Tammela <pctammela@...atatu.com>
To:     Simon Horman <simon.horman@...igine.com>,
        Eric Dumazet <edumazet@...gle.com>
Cc:     netdev@...r.kernel.org, jhs@...atatu.com, xiyou.wangcong@...il.com,
        jiri@...nulli.us, davem@...emloft.net, kuba@...nel.org,
        pabeni@...hat.com
Subject: Re: [PATCH net-next v3 5/5] net/sched: sch_qfq: BITify two bound
 definitions

On 21/04/2023 06:30, Simon Horman wrote:
> On Fri, Apr 21, 2023 at 11:17:23AM +0200, Eric Dumazet wrote:
>> On Thu, Apr 20, 2023 at 6:50 PM Pedro Tammela <pctammela@...atatu.com> wrote:
>>>
>>> For the sake of readability, change these two definitions to BIT()
>>> macros.
>>>
>>> Acked-by: Jamal Hadi Salim <jhs@...atatu.com>
>>> Signed-off-by: Pedro Tammela <pctammela@...atatu.com>
>>> ---
>>>   net/sched/sch_qfq.c | 4 ++--
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c
>>> index dfd9a99e6257..4b9cc8a46e2a 100644
>>> --- a/net/sched/sch_qfq.c
>>> +++ b/net/sched/sch_qfq.c
>>> @@ -105,7 +105,7 @@
>>>   #define QFQ_MAX_INDEX          24
>>>   #define QFQ_MAX_WSHIFT         10
>>>
>>> -#define        QFQ_MAX_WEIGHT          (1<<QFQ_MAX_WSHIFT) /* see qfq_slot_insert */
>>> +#define        QFQ_MAX_WEIGHT          BIT(QFQ_MAX_WSHIFT) /* see qfq_slot_insert */
>>
>> I am not sure I find BIT(X) more readable in this context.
>>
>> Say MAX_WEIGHT was 0xF000, should we then use
>>
>> #define MAX_WEIGHT (BIT(15) | BIT(14) |BIT(13) | BIT(12))
> 
> Thanks Eric,
> 
> I think this is my mistake for suggesting this change.
> I agree BIT() is not so good here after all.

Fair enough,
Will remove it and repost.
Thanks for the reviews.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ