mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yunsheng Lin <linyunsheng@huawei.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: <davem@davemloft.net>, <pabeni@redhat.com>, <edumazet@google.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linuxarm@openeuler.org>, <ezequiel.garcia@free-electrons.com>
Subject: Re: [PATCH net-next] net: tso: inline tso_count_descs()
Date: Fri, 9 Dec 2022 16:48:57 +0800	[thread overview]
Message-ID: <fc37030e-6888-7a08-348d-cdcc524285ce@huawei.com> (raw)
In-Reply-To: <20221208195721.698f68b6@kernel.org>

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;
>> +}
> .
> 

  parent reply	other threads:[~2022-12-09  8:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08  2:43 Yunsheng Lin
2022-12-09  3:57 ` Jakub Kicinski
2022-12-09  3:59   ` Jakub Kicinski
2022-12-09  8:56     ` Yunsheng Lin
2022-12-09  8:48   ` Yunsheng Lin [this message]
2022-12-09 22:35     ` Jakub Kicinski

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=fc37030e-6888-7a08-348d-cdcc524285ce@huawei.com \
    --to=linyunsheng@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@openeuler.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®