[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<CH0PR18MB4339D0B361321187585DB975CD9B2@CH0PR18MB4339.namprd18.prod.outlook.com>
Date: Wed, 11 Sep 2024 06:26:36 +0000
From: Geethasowjanya Akula <gakula@...vell.com>
To: Paolo Abeni <pabeni@...hat.com>,
"netdev@...r.kernel.org"
<netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
CC: "kuba@...nel.org" <kuba@...nel.org>,
"davem@...emloft.net"
<davem@...emloft.net>,
"jiri@...nulli.us" <jiri@...nulli.us>,
"edumazet@...gle.com" <edumazet@...gle.com>,
Sunil Kovvuri Goutham
<sgoutham@...vell.com>,
Subbaraya Sundeep Bhatta <sbhatta@...vell.com>,
Hariprasad Kelam <hkelam@...vell.com>
Subject: RE: [EXTERNAL] Re: [net-next PATCH v2 2/4] octeontx2-pf: Add new APIs
for queue memory alloc/free.
>-----Original Message-----
>From: Paolo Abeni <pabeni@...hat.com>
>Sent: Tuesday, September 10, 2024 3:11 PM
>To: Geethasowjanya Akula <gakula@...vell.com>; netdev@...r.kernel.org;
>linux-kernel@...r.kernel.org
>Cc: kuba@...nel.org; davem@...emloft.net; jiri@...nulli.us;
>edumazet@...gle.com; Sunil Kovvuri Goutham <sgoutham@...vell.com>;
>Subbaraya Sundeep Bhatta <sbhatta@...vell.com>; Hariprasad Kelam
><hkelam@...vell.com>
>Subject: [EXTERNAL] Re: [net-next PATCH v2 2/4] octeontx2-pf: Add new APIs
>for queue memory alloc/free.
>On 9/5/24 11:49, Geetha sowjanya wrote:
>> Group the queue(RX/TX/CQ) memory allocation and free code to single APIs.
>>
>> Signed-off-by: Geetha sowjanya <gakula@...vell.com>
>> ---
>> .../marvell/octeontx2/nic/otx2_common.h | 2 +
>> .../ethernet/marvell/octeontx2/nic/otx2_pf.c | 54 +++++++++++++------
>> 2 files changed, 40 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
>> b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
>> index a47001a2b93f..df548aeffecf 100644
>> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
>> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
>> @@ -997,6 +997,8 @@ int otx2_pool_init(struct otx2_nic *pfvf, u16 pool_id,
>> int otx2_aura_init(struct otx2_nic *pfvf, int aura_id,
>> int pool_id, int numptrs);
>> int otx2_init_rsrc(struct pci_dev *pdev, struct otx2_nic *pf);
>> +void otx2_free_queue_mem(struct otx2_qset *qset); int
>> +otx2_alloc_queue_mem(struct otx2_nic *pf);
>>
>> /* RSS configuration APIs*/
>> int otx2_rss_init(struct otx2_nic *pfvf); diff --git
>> a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
>> b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
>> index 4cfeca5ca626..6dfd6d1064ad 100644
>> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
>> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
>> @@ -1770,15 +1770,23 @@ static void otx2_dim_work(struct work_struct
>*w)
>> dim->state = DIM_START_MEASURE;
>> }
>>
>> -int otx2_open(struct net_device *netdev)
>> +void otx2_free_queue_mem(struct otx2_qset *qset) {
>> + kfree(qset->sq);
>> + qset->sq = NULL;
>> + kfree(qset->cq);
>> + qset->cq = NULL;
>> + kfree(qset->rq);
>> + qset->rq = NULL;
>> + kfree(qset->napi);
>
>It's strange that the napi ptr is not reset here. You should add a comment
>describing the reason or zero such field, too.
"qset->napi " ptr get initialized and free on otx2_open/otx2_stop.
This ptr is not referred if the interface is in down state. Hence, ptr reset is not needed.
Will add proper comment in next version.
>
>Thanks,
>
>Paolo
Powered by blists - more mailing lists