[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221209143523.03d9584b@kernel.org>
Date: Fri, 9 Dec 2022 14:35:23 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Yunsheng Lin <linyunsheng@...wei.com>
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 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.
Powered by blists - more mailing lists