bnxt_en: handle tpa_info in queue API implementation
authorDavid Wei <dw@davidwei.uk>
Wed, 4 Dec 2024 04:10:22 +0000 (20:10 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 5 Dec 2024 03:23:35 +0000 (19:23 -0800)
commitbd649c5cc958169b8a8a3e77ea926d92d472b02a
tree593fb627db19cd290234b1e8d63b78926ce3953e
parentbf1782d70ddd9f23911824e41df8d9b5244f2f30
bnxt_en: handle tpa_info in queue API implementation

Commit 7ed816be35ab ("eth: bnxt: use page pool for head frags") added a
page pool for header frags, which may be distinct from the existing pool
for the aggregation ring. Prior to this change, frags used in the TPA
ring rx_tpa were allocated from system memory e.g. napi_alloc_frag()
meaning their lifetimes were not associated with a page pool. They can
be returned at any time and so the queue API did not alloc or free
rx_tpa.

But now frags come from a separate head_pool which may be different to
page_pool. Without allocating and freeing rx_tpa, frags allocated from
the old head_pool may be returned to a different new head_pool which
causes a mismatch between the pp hold/release count.

Fix this problem by properly freeing and allocating rx_tpa in the queue
API implementation.

Signed-off-by: David Wei <dw@davidwei.uk>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20241204041022.56512-4-dw@davidwei.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c