From: Geethasowjanya Akula <gakula@marvell.com>
To: Pavan Chebbi <pavan.chebbi@broadcom.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kuba@kernel.org" <kuba@kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"jiri@resnulli.us" <jiri@resnulli.us>,
"edumazet@google.com" <edumazet@google.com>,
Sunil Kovvuri Goutham <sgoutham@marvell.com>,
Subbaraya Sundeep Bhatta <sbhatta@marvell.com>,
Hariprasad Kelam <hkelam@marvell.com>
Subject: RE: [EXTERNAL] Re: [net-next PATCH 2/4] octeontx2-pf: Add new APIs for queue memory alloc/free.
Date: Wed, 4 Sep 2024 05:35:31 +0000 [thread overview]
Message-ID: <CH0PR18MB43390396F1138E2AE7D79450CD9C2@CH0PR18MB4339.namprd18.prod.outlook.com> (raw)
In-Reply-To: <CALs4sv3KVxTFex3FHWSFjx37FahOTiMN0DJyZ0Zn9qxQZQpZow@mail.gmail.com>
>-----Original Message-----
>From: Pavan Chebbi <pavan.chebbi@broadcom.com>
>Sent: Tuesday, September 3, 2024 8:42 PM
>To: Geethasowjanya Akula <gakula@marvell.com>
>Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; kuba@kernel.org;
>davem@davemloft.net; pabeni@redhat.com; jiri@resnulli.us;
>edumazet@google.com; Sunil Kovvuri Goutham <sgoutham@marvell.com>;
>Subbaraya Sundeep Bhatta <sbhatta@marvell.com>; Hariprasad Kelam
><hkelam@marvell.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@marvell.com>
>wrote:
>>
>> Group the queue(RX/TX/CQ) memory allocation and free code to single APIs.
>>
>> Signed-off-by: Geetha sowjanya <gakula@marvell.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.
next prev parent reply other threads:[~2024-09-04 5:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 12:40 [net-next PATCH 0/4] Refactoring RVU NIC driver Geetha sowjanya
2024-09-03 12:40 ` [net-next PATCH 1/4] octeontx2-pf: Defines common API for HW resources configuration Geetha sowjanya
2024-09-03 14:55 ` Jiri Pirko
2024-09-03 14:57 ` Pavan Chebbi
2024-09-04 5:48 ` [EXTERNAL] " Geethasowjanya Akula
2024-09-04 6:18 ` Pavan Chebbi
2024-09-03 12:40 ` [net-next PATCH 2/4] octeontx2-pf: Add new APIs for queue memory alloc/free Geetha sowjanya
2024-09-03 15:12 ` Pavan Chebbi
2024-09-04 5:35 ` Geethasowjanya Akula [this message]
2024-09-03 12:40 ` [net-next PATCH 3/4] octeontx2-pf: Reuse PF max mtu value Geetha sowjanya
2024-09-03 12:40 ` [net-next PATCH 4/4] octeontx2-pf: Export common APIs Geetha sowjanya
2024-09-03 15:00 ` Jiri Pirko
2024-09-04 6:20 ` [EXTERNAL] " Geethasowjanya Akula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CH0PR18MB43390396F1138E2AE7D79450CD9C2@CH0PR18MB4339.namprd18.prod.outlook.com \
--to=gakula@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkelam@marvell.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®