]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt: make sure we return pages to the pool
authorJakub Kicinski <kuba@kernel.org>
Wed, 11 Jan 2023 04:25:47 +0000 (20:25 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:32 +0000 (11:58 +0100)
commitf28351d4a98b0ce8f63d014277b984c3d49b9bab
treeae460cc0ffd93e3321f0a0df88115d4abcecc48e
parent3ad9edb6027608cb3996a2d87f24502c097d8e8f
bnxt: make sure we return pages to the pool

[ Upstream commit 97f5e03a4a27d27ee4fed0cdb1658c81cf2784db ]

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: 9475f5ec0f09 ("bnxt: adding bnxt_xdp_build_skb to build skb from multibuffer xdp_buff")
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Link: https://lore.kernel.org/r/20230111042547.987749-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c