lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <CH0PR18MB43390396F1138E2AE7D79450CD9C2@CH0PR18MB4339.namprd18.prod.outlook.com>
Date: Wed, 4 Sep 2024 05:35:31 +0000
From: Geethasowjanya Akula <gakula@...vell.com>
To: Pavan Chebbi <pavan.chebbi@...adcom.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "davem@...emloft.net"
	<davem@...emloft.net>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "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 2/4] octeontx2-pf: Add new APIs
 for queue memory alloc/free.



>-----Original Message-----
>From: Pavan Chebbi <pavan.chebbi@...adcom.com>
>Sent: Tuesday, September 3, 2024 8:42 PM
>To: Geethasowjanya Akula <gakula@...vell.com>
>Cc: netdev@...r.kernel.org; linux-kernel@...r.kernel.org; kuba@...nel.org;
>davem@...emloft.net; pabeni@...hat.com; 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 2/4] octeontx2-pf: Add new APIs for
>queue memory alloc/free.
>
>On Tue, Sep 3, 2024 at 6:12 PM Geetha sowjanya <gakula@...vell.com>
>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  | 56 +++++++++++++------
>>  2 files changed, 41 insertions(+), 17 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..68addc975113 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);
>> +}
>> +EXPORT_SYMBOL(otx2_free_queue_mem);
>> +int otx2_alloc_queue_mem(struct otx2_nic *pf)
>>  {
>> -       struct otx2_nic *pf = netdev_priv(netdev);
>> -       struct otx2_cq_poll *cq_poll = NULL;
>>         struct otx2_qset *qset = &pf->qset;
>> -       int err = 0, qidx, vec;
>> -       char *irq_name;
>> +       struct otx2_cq_poll *cq_poll;
>> +       int err = -ENOMEM;
>I don't see 'err' getting set to anything else. Can avoid the variable
>and directly return -ENOMEM everywhere?
Will fix it in next version.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ