mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
net: ethernet: ti: am65-cpsw-nuss: Fix skb size by accounting for skb_shared_info
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: 8acacc40f7 ("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>
Link: https://patch.msgid.link/20250707085201.1898818-1-c-vankar@ti.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
849704b8b2
commit
02c4d6c26f
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user