Skip to content

Commit 97f5e03

Browse files
committed
bnxt: make sure we return pages to the pool
Before the commit under Fixes the page would have been released from the pool before the napi_alloc_skb() call, so normal page freeing was fine (released page == no longer in the pool). After the change we just mark the page for recycling so it's still in the pool if the skb alloc fails, we need to recycle. Same commit added the same bug in the new bnxt_rx_multi_page_skb(). Fixes: 1dc4c55 ("bnxt: adding bnxt_xdp_build_skb to build skb from multibuffer xdp_buff") Reviewed-by: Andy Gospodarek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ae9f29f commit 97f5e03

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+2
-2
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ static struct sk_buff *bnxt_rx_multi_page_skb(struct bnxt *bp,
993993
DMA_ATTR_WEAK_ORDERING);
994994
skb = build_skb(page_address(page), PAGE_SIZE);
995995
if (!skb) {
996-
__free_page(page);
996+
page_pool_recycle_direct(rxr->page_pool, page);
997997
return NULL;
998998
}
999999
skb_mark_for_recycle(skb);
@@ -1031,7 +1031,7 @@ static struct sk_buff *bnxt_rx_page_skb(struct bnxt *bp,
10311031

10321032
skb = napi_alloc_skb(&rxr->bnapi->napi, payload);
10331033
if (!skb) {
1034-
__free_page(page);
1034+
page_pool_recycle_direct(rxr->page_pool, page);
10351035
return NULL;
10361036
}
10371037

0 commit comments

Comments
 (0)