[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <60edc790-1485-457c-b024-0314514dced8@davidwei.uk>
Date: Sat, 30 Nov 2024 14:59:42 -0800
From: David Wei <dw@...idwei.uk>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, Michael Chan <michael.chan@...adcom.com>,
Andy Gospodarek <andrew.gospodarek@...adcom.com>,
Somnath Kotur <somnath.kotur@...adcom.com>,
Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net v2 3/3] bnxt_en: handle tpa_info in queue API
implementation
On 2024-11-30 14:15, Jakub Kicinski wrote:
> On Wed, 27 Nov 2024 14:38:55 -0800 David Wei wrote:
>> + if (bp->flags & BNXT_FLAG_TPA) {
>> + rc = bnxt_alloc_one_tpa_info(bp, clone);
>> + if (rc)
>> + goto err_free_tpa_info;
>> + }
>> +
>> bnxt_init_one_rx_ring_rxbd(bp, clone);
>> bnxt_init_one_rx_agg_ring_rxbd(bp, clone);
>>
>> bnxt_alloc_one_rx_ring_skb(bp, clone, idx);
>> if (bp->flags & BNXT_FLAG_AGG_RINGS)
>> bnxt_alloc_one_rx_ring_page(bp, clone, idx);
>> + if (bp->flags & BNXT_FLAG_TPA)
>> + bnxt_alloc_one_tpa_info_data(bp, clone);
>
> Could you explain the TPA related changes in the commit message?
Got it, I'll expand on why the TPA changes are made in the commit.
> Do we need to realloc the frags now since they don't come from
> system memory?
Yes, frags now come from head_pool instead of system memory. The old
head_pool is freed and a new head_pool is allocated during a queue
reset. Therefore the old tpa_info with frags allocated from the old
head_pool must be freed as well, otherwise the driver will attempt to
return frags back to a different page pool than the one it was allocated
from. When the frags were allocated from system memory using the generic
allocators, it didn't matter since they did not have their lifetimes
tied to page pools.
Powered by blists - more mailing lists