mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Geetha sowjanya <gakula@marvell.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kuba@kernel.org, davem@davemloft.net, jiri@resnulli.us,
	edumazet@google.com, sgoutham@marvell.com, sbhatta@marvell.com,
	hkelam@marvell.com
Subject: Re: [net-next PATCH v2 2/4] octeontx2-pf: Add new APIs for queue memory alloc/free.
Date: Tue, 10 Sep 2024 11:41:11 +0200	[thread overview]
Message-ID: <d58d7b9a-ae20-4c07-af17-425cbdfd861b@redhat.com> (raw)
In-Reply-To: <20240905094935.26271-3-gakula@marvell.com>

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@marvell.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.

Thanks,

Paolo


  parent reply	other threads:[~2024-09-10  9:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05  9:49 [net-next PATCH v2 0/4] Refactoring RVU NIC driver Geetha sowjanya
2024-09-05  9:49 ` [net-next PATCH v2 1/4] octeontx2-pf: Define common API for HW resources configuration Geetha sowjanya
2024-09-10  9:33   ` Paolo Abeni
2024-09-11  6:07     ` [EXTERNAL] " Geethasowjanya Akula
2024-09-05  9:49 ` [net-next PATCH v2 2/4] octeontx2-pf: Add new APIs for queue memory alloc/free Geetha sowjanya
2024-09-08  7:54   ` Pavan Chebbi
2024-09-10  9:41   ` Paolo Abeni [this message]
2024-09-11  6:26     ` [EXTERNAL] " Geethasowjanya Akula
2024-09-05  9:49 ` [net-next PATCH v2 3/4] octeontx2-pf: Reuse PF max mtu value Geetha sowjanya
2024-09-05  9:49 ` [net-next PATCH v2 4/4] octeontx2-pf: Export common APIs Geetha sowjanya

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=d58d7b9a-ae20-4c07-af17-425cbdfd861b@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.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=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®