[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c84c5177-2d1b-467f-805b-5cb979edc30a@davidwei.uk>
Date: Thu, 28 Nov 2024 16:43:40 -0800
From: David Wei <dw@...idwei.uk>
To: Somnath Kotur <somnath.kotur@...adcom.com>
Cc: netdev@...r.kernel.org, Michael Chan <michael.chan@...adcom.com>,
Andy Gospodarek <andrew.gospodarek@...adcom.com>,
Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net v2 3/3] bnxt_en: handle tpa_info in queue API
implementation
On 2024-11-27 19:46, Somnath Kotur wrote:
> On Thu, Nov 28, 2024 at 4:09 AM David Wei <dw@...idwei.uk> wrote:
>>
>> 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. Add support for this head_pool in the queue
>> API.
>>
>> Signed-off-by: David Wei <dw@...idwei.uk>
>> ---
>> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 25 ++++++++++++++++++++---
>> 1 file changed, 22 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
>> index 9b079bce1423..08c7d3049562 100644
>> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
>> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
>> @@ -15382,15 +15382,25 @@ static int bnxt_queue_mem_alloc(struct net_device *dev, void *qmem, int idx)
>> goto err_free_rx_agg_ring;
>> }
>>
>> + 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);
>>
>> return 0;
>>
>> +err_free_tpa_info:
>> + bnxt_free_one_tpa_info(bp, clone);
>> err_free_rx_agg_ring:
>> bnxt_free_ring(bp, &clone->rx_agg_ring_struct.ring_mem);
>> err_free_rx_ring:
>> @@ -15398,9 +15408,11 @@ static int bnxt_queue_mem_alloc(struct net_device *dev, void *qmem, int idx)
>> err_rxq_info_unreg:
>> xdp_rxq_info_unreg(&clone->xdp_rxq);
>> err_page_pool_destroy:
>> - clone->page_pool->p.napi = NULL;
>> page_pool_destroy(clone->page_pool);
>> + if (clone->page_pool != clone->head_pool)
> Just curious, why is this check needed everywhere? Is there a case
> where the 2 page pools can be the same ? I thought either there is a
> page_pool for the header frags or none at all ?
Yes, frags are always allocated now from head_pool, which is by default
the same as page_pool.
If bnxt_separate_head_pool() then they are different.
Powered by blists - more mailing lists