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] [thread-next>] [day] [month] [year] [list]
Message-ID: <fc37030e-6888-7a08-348d-cdcc524285ce@huawei.com>
Date:   Fri, 9 Dec 2022 16:48:57 +0800
From:   Yunsheng Lin <linyunsheng@...wei.com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     <davem@...emloft.net>, <pabeni@...hat.com>, <edumazet@...gle.com>,
        <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linuxarm@...neuler.org>, <ezequiel.garcia@...e-electrons.com>
Subject: Re: [PATCH net-next] net: tso: inline tso_count_descs()

On 2022/12/9 11:57, Jakub Kicinski wrote:
> On Thu, 8 Dec 2022 10:43:03 +0800 Yunsheng Lin wrote:
>> tso_count_descs() is a small function doing simple calculation,
>> and tso_count_descs() is used in fast path, so inline it to
>> reduce the overhead of calls.
> 
> TSO frames are large, the overhead is fine.
> I'm open to other opinions but I'd rather keep the code as is than
> deal with the influx with similar sloppily automated changes.
> 
>> diff --git a/include/net/tso.h b/include/net/tso.h
>> index 62c98a9c60f1..ab6bbf56d984 100644
>> --- a/include/net/tso.h
>> +++ b/include/net/tso.h
>> @@ -16,7 +16,13 @@ struct tso_t {
>>  	u32	tcp_seq;
>>  };
> 
> no include for skbuff.h here

Do you mean including skbuff.h explicitly in tso.h?
It seems ip.h included in tso.h has included skbuff.h.

> 
>> -int tso_count_descs(const struct sk_buff *skb);
>> +/* Calculate expected number of TX descriptors */
>> +static inline int tso_count_descs(const struct sk_buff *skb)
>> +{
>> +	/* The Marvell Way */
> 
> these comments should be rewritten as we move
> the function clearly calculates the worst case buffer count

Will change to below:
/* Calculate the worst case buffer count */

> 
>> +	return skb_shinfo(skb)->gso_segs * 2 + skb_shinfo(skb)->nr_frags;
>> +}
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ