netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Yunsheng Lin <linyunsheng@huawei.com>
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 14:35:23 -0800	[thread overview]
Message-ID: <20221209143523.03d9584b@kernel.org> (raw)
In-Reply-To: <fc37030e-6888-7a08-348d-cdcc524285ce@huawei.com>

On Fri, 9 Dec 2022 16:48:57 +0800 Yunsheng Lin wrote:
> >> 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.

Yes, we need the definition of skb_shinfo() so let's include the header.
Let's not depend on second-order includes, it makes refactoring harder.

> >> -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 */

Thanks, you can replace the comment about the function with this
comment. No need to have two comments, and mentioning descriptors
is slightly confusing because descriptor is not always equivalent
to a buffer.

      reply	other threads:[~2022-12-09 22:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08  2:43 [PATCH net-next] net: tso: inline tso_count_descs() 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
2022-12-09 22:35     ` Jakub Kicinski [this message]

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=20221209143523.03d9584b@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@openeuler.org \
    --cc=linyunsheng@huawei.com \
    --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;
as well as URLs for NNTP newsgroup(s).