netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v3] net: ethernet: ti: am65-cpsw-nuss: Fix skb size by accounting for skb_shared_info
@ 2025-07-07  8:52 Chintan Vankar
  2025-07-10  2:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Chintan Vankar @ 2025-07-07  8:52 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, rogerq, horms,
	mwalle, jacob.e.keller, jpanis, c-vankar
  Cc: s-vadapalli, danishanwar, netdev, linux-kernel

While transitioning from netdev_alloc_ip_align() to build_skb(), memory
for the "skb_shared_info" member of an "skb" was not allocated. Fix this
by allocating "PAGE_SIZE" as the skb length, accounting for the packet
length, headroom and tailroom, thereby including the required memory space
for skb_shared_info.

Fixes: 8acacc40f733 ("net: ethernet: ti: am65-cpsw: Add minimal XDP support")
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
---

This patch is based on the commit 'af80679632063' of origin/main branch of
Linux-net repository.

Link to v2: 
https://lore.kernel.org/r/20250626051226.2418638-1-c-vankar@ti.com/

Changes from v2 to v3: 
- Updated skb length with the PAGE_SIZE as suggested by Jakub Kicinski.

 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index f20d1ff192ef..231ca141331f 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -856,8 +856,6 @@ static struct sk_buff *am65_cpsw_build_skb(void *page_addr,
 {
 	struct sk_buff *skb;
 
-	len += AM65_CPSW_HEADROOM;
-
 	skb = build_skb(page_addr, len);
 	if (unlikely(!skb))
 		return NULL;
@@ -1344,7 +1342,7 @@ static int am65_cpsw_nuss_rx_packets(struct am65_cpsw_rx_flow *flow,
 	}
 
 	skb = am65_cpsw_build_skb(page_addr, ndev,
-				  AM65_CPSW_MAX_PACKET_SIZE, headroom);
+				  PAGE_SIZE, headroom);
 	if (unlikely(!skb)) {
 		new_page = page;
 		goto requeue;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net v3] net: ethernet: ti: am65-cpsw-nuss: Fix skb size by accounting for skb_shared_info
  2025-07-07  8:52 [PATCH net v3] net: ethernet: ti: am65-cpsw-nuss: Fix skb size by accounting for skb_shared_info Chintan Vankar
@ 2025-07-10  2:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-10  2:30 UTC (permalink / raw)
  To: Chintan Vankar
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, rogerq, horms,
	mwalle, jacob.e.keller, jpanis, s-vadapalli, danishanwar, netdev,
	linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 7 Jul 2025 14:22:01 +0530 you wrote:
> While transitioning from netdev_alloc_ip_align() to build_skb(), memory
> for the "skb_shared_info" member of an "skb" was not allocated. Fix this
> by allocating "PAGE_SIZE" as the skb length, accounting for the packet
> length, headroom and tailroom, thereby including the required memory space
> for skb_shared_info.
> 
> Fixes: 8acacc40f733 ("net: ethernet: ti: am65-cpsw: Add minimal XDP support")
> Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
> Signed-off-by: Chintan Vankar <c-vankar@ti.com>
> 
> [...]

Here is the summary with links:
  - [net,v3] net: ethernet: ti: am65-cpsw-nuss: Fix skb size by accounting for skb_shared_info
    https://git.kernel.org/netdev/net/c/02c4d6c26f1f

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-10  2:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-07  8:52 [PATCH net v3] net: ethernet: ti: am65-cpsw-nuss: Fix skb size by accounting for skb_shared_info Chintan Vankar
2025-07-10  2:30 ` patchwork-bot+netdevbpf

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).