From: Siddharth Vadapalli <s-vadapalli@ti.com>
To: Chintan Vankar <c-vankar@ti.com>
Cc: <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<rogerq@kernel.org>, <horms@kernel.org>, <mwalle@kernel.org>,
<jacob.e.keller@intel.com>, <jpanis@baylibre.com>,
<s-vadapalli@ti.com>, <danishanwar@ti.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net: ethernet: ti: am65-cpsw-nuss: Fix skb size by accounting for skb_shared_info
Date: Wed, 25 Jun 2025 19:07:57 +0530 [thread overview]
Message-ID: <598f9e77-8212-426b-97ab-427cb8bd4910@ti.com> (raw)
In-Reply-To: <20250625112725.1096550-1-c-vankar@ti.com>
On Wed, Jun 25, 2025 at 04:57:25PM +0530, Chintan Vankar wrote:
Hello Chintan,
> While transitioning from netdev_alloc_ip_align to build_skb, memory for
nitpick: Add parantheses when referring to functions:
netdev_alloc_ip_align()
build_skb()
> skb_shared_info was not allocated. Fix this by including
Enclose structures within double quotes and preferably refer to them
in the context of an "skb":
...memory for the "skb_shared_info" member of an "skb" was not allocated...
> sizeof(skb_shared_info) in the packet length during allocation.
>
> Fixes: 8acacc40f733 ("net: ethernet: ti: am65-cpsw: Add minimal XDP support")
> Signed-off-by: Chintan Vankar <c-vankar@ti.com>
> ---
>
> This patch is based on the commit '9caca6ac0e26' of origin/main branch of
> Linux-net repository.
>
> drivers/net/ethernet/ti/am65-cpsw-nuss.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> index f20d1ff192ef..3905eec0b11e 100644
> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> @@ -857,6 +857,7 @@ static struct sk_buff *am65_cpsw_build_skb(void *page_addr,
> struct sk_buff *skb;
>
> len += AM65_CPSW_HEADROOM;
> + len += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
This could be added to the previous line itself:
len += AM65_CPSW_HEADROOM + SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
>
> skb = build_skb(page_addr, len);
> if (unlikely(!skb))
Thank you for finding the bug and fixing it.
Regards,
Siddharth.
next prev parent reply other threads:[~2025-06-25 13:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 11:27 Chintan Vankar
2025-06-25 13:37 ` Siddharth Vadapalli [this message]
2025-06-26 5:31 ` Chintan Vankar
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=598f9e77-8212-426b-97ab-427cb8bd4910@ti.com \
--to=s-vadapalli@ti.com \
--cc=andrew+netdev@lunn.ch \
--cc=c-vankar@ti.com \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=jpanis@baylibre.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mwalle@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rogerq@kernel.org \
/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®