Skip to content

Commit 02c4d6c

Browse files
chintanv133kuba-moo
authored andcommitted
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: 8acacc4 ("net: ethernet: ti: am65-cpsw: Add minimal XDP support") Reviewed-by: Siddharth Vadapalli <[email protected]> Signed-off-by: Chintan Vankar <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 849704b commit 02c4d6c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/net/ethernet/ti/am65-cpsw-nuss.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -856,8 +856,6 @@ static struct sk_buff *am65_cpsw_build_skb(void *page_addr,
856856
{
857857
struct sk_buff *skb;
858858

859-
len += AM65_CPSW_HEADROOM;
860-
861859
skb = build_skb(page_addr, len);
862860
if (unlikely(!skb))
863861
return NULL;
@@ -1344,7 +1342,7 @@ static int am65_cpsw_nuss_rx_packets(struct am65_cpsw_rx_flow *flow,
13441342
}
13451343

13461344
skb = am65_cpsw_build_skb(page_addr, ndev,
1347-
AM65_CPSW_MAX_PACKET_SIZE, headroom);
1345+
PAGE_SIZE, headroom);
13481346
if (unlikely(!skb)) {
13491347
new_page = page;
13501348
goto requeue;

0 commit comments

Comments
 (0)