netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Sai Krishna <saikrishnag@marvell.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, sgoutham@marvell.com,
	gakula@marvell.com, richardcochran@gmail.com,
	lcherian@marvell.com, jerinj@marvell.com, hkelam@marvell.com,
	sbhatta@marvell.com
Subject: Re: [net PATCH v2 7/7] octeontx2-pf: Disable packet I/O for graceful exit
Date: Sat, 8 Apr 2023 16:29:32 +0200	[thread overview]
Message-ID: <ZDF6TC+Tm5NvfePi@corigine.com> (raw)
In-Reply-To: <20230407122344.4059-8-saikrishnag@marvell.com>

On Fri, Apr 07, 2023 at 05:53:44PM +0530, Sai Krishna wrote:
> From: Subbaraya Sundeep <sbhatta@marvell.com>
> 
> At the stage of enabling packet I/O in otx2_open, If mailbox
> timeout occurs then interface ends up in down state where as
> hardware packet I/O is enabled. Hence disable packet I/O also
> before bailing out. This patch also free the LMTST per cpu structure
> on teardown, if the lmt_info pointer is not NULL.
> 
> Fixes: 1ea0166da050 ("octeontx2-pf: Fix the device state on error")
> Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
> Signed-off-by: Sai Krishna <saikrishnag@marvell.com>

...

> @@ -709,7 +709,8 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  err_ptp_destroy:
>  	otx2_ptp_destroy(vf);
>  err_detach_rsrc:
> -	free_percpu(vf->hw.lmt_info);
> +	if (vf->hw.lmt_info)
> +		free_percpu(vf->hw.lmt_info);

free_percpu does nothing if it's argument is NULL.
So there is no need for the if clause added here.

>  	if (test_bit(CN10K_LMTST, &vf->hw.cap_flag))
>  		qmem_free(vf->dev, vf->dync_lmt);
>  	otx2_detach_resources(&vf->mbox);
> @@ -763,7 +764,8 @@ static void otx2vf_remove(struct pci_dev *pdev)
>  	otx2_shutdown_tc(vf);
>  	otx2vf_disable_mbox_intr(vf);
>  	otx2_detach_resources(&vf->mbox);
> -	free_percpu(vf->hw.lmt_info);
> +	if (vf->hw.lmt_info)
> +		free_percpu(vf->hw.lmt_info);

Ditto.

>  	if (test_bit(CN10K_LMTST, &vf->hw.cap_flag))
>  		qmem_free(vf->dev, vf->dync_lmt);
>  	otx2vf_vfaf_mbox_destroy(vf);
> -- 
> 2.25.1
> 

  reply	other threads:[~2023-04-08 14:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07 12:23 [net PATCH v2 0/7] octeontx2: Miscellaneous fixes Sai Krishna
2023-04-07 12:23 ` [net PATCH v2 1/7] octeontx2-af: Secure APR table update with the lock Sai Krishna
2023-04-08 14:33   ` Simon Horman
2023-04-10  8:25     ` Sai Krishna Gajula
2023-04-07 12:23 ` [net PATCH v2 2/7] octeontx2-af: Fix start and end bit for scan config Sai Krishna
2023-04-08 14:40   ` Simon Horman
2023-04-10  8:39     ` Sai Krishna Gajula
2023-04-07 12:23 ` [net PATCH v2 3/7] octeontx2-af: Add validation for lmac type Sai Krishna
2023-04-08 14:42   ` Simon Horman
2023-04-09 17:30   ` Leon Romanovsky
2023-04-10  6:08     ` Sai Krishna Gajula
2023-04-07 12:23 ` [net PATCH v2 4/7] octeontx2-af: Update correct mask to filter IPv4 fragments Sai Krishna
2023-04-08 14:43   ` Simon Horman
2023-04-07 12:23 ` [net PATCH v2 5/7] octeontx2-af: Fix issues with NPC field hash extract Sai Krishna
2023-04-08 15:21   ` Simon Horman
2023-04-10  8:43     ` Sai Krishna Gajula
2023-04-07 12:23 ` [net PATCH v2 6/7] octeontx2-af: Skip PFs if not enabled Sai Krishna
2023-04-08 14:56   ` Simon Horman
2023-04-14 11:58     ` Sai Krishna Gajula
2023-04-07 12:23 ` [net PATCH v2 7/7] octeontx2-pf: Disable packet I/O for graceful exit Sai Krishna
2023-04-08 14:29   ` Simon Horman [this message]
2023-04-10  8:49     ` Sai Krishna Gajula

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=ZDF6TC+Tm5NvfePi@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=kuba@kernel.org \
    --cc=lcherian@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=saikrishnag@marvell.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;
as well as URLs for NNTP newsgroup(s).