patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: <wenxuanx.wu@intel.com>, <xiaoyun.li@intel.com>, <dev@dpdk.org>
Cc: <stable@dpdk.org>
Subject: Re: [PATCH v2 2/2] app/testpmd:fix testpmd quit failure
Date: Wed, 23 Feb 2022 12:09:58 +0000	[thread overview]
Message-ID: <1b505422-c6ee-ae53-e472-4bdd413c7ace@intel.com> (raw)
In-Reply-To: <20220223113251.723692-3-wenxuanx.wu@intel.com>

On 2/23/2022 11:32 AM, wenxuanx.wu@intel.com wrote:
> From: wenxuan wu <wenxuanx.wu@intel.com>
> 
> When testpmd start ed with 1 pf and 2 vfs, testpmd quited while vfs
> were still alive would result in failure. Root cause is that pf had
> been released already but vfs were still accessing by func
> rte_eth_dev_info_get, which would result in heap-free-after-use error.
> 
> By quitting our ports in reverse order to avoid this.And the order is
> guaranteed that vf are created after pfs.
> 
> Fixes: d3a274ce9dee ("app/testpmd: handle SIGINT and SIGTERM")
> Cc: stable@dpdk.org
> 
> Signed-off-by: wenxuan wu <wenxuanx.wu@intel.com>
> ---
>   app/test-pmd/testpmd.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index e1da961311..698b6d8cc4 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -3384,12 +3384,12 @@ pmd_test_exit(void)
>   #endif
>   	if (ports != NULL) {
>   		no_link_check = 1;
> -		RTE_ETH_FOREACH_DEV(pt_id) {
> +		RTE_ETH_FOREACH_DEV_REVERSE(pt_id) {

The main problem with this patch was this logic,
can you please check comment on previous version?

>   			printf("\nStopping port %d...\n", pt_id);
>   			fflush(stdout);
>   			stop_port(pt_id);
>   		}
> -		RTE_ETH_FOREACH_DEV(pt_id) {
> +		RTE_ETH_FOREACH_DEV_REVERSE(pt_id) {
>   			printf("\nShutting down port %d...\n", pt_id);
>   			fflush(stdout);
>   			close_port(pt_id);


  reply	other threads:[~2022-02-23 12:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <de87ae03-a26a-a9d3-da70-424335777371@intel.com>
     [not found] ` <20220223113251.723692-1-wenxuanx.wu@intel.com>
2022-02-23 11:32   ` [PATCH v2 1/2] lib/ethdev: add reverse macro to quit testpmd wenxuanx.wu
2022-02-23 11:32   ` [PATCH v2 2/2] app/testpmd:fix testpmd quit failure wenxuanx.wu
2022-02-23 12:09     ` Ferruh Yigit [this message]
2022-03-01  7:28     ` [PATCH v3] app/testpmd: fix heap-free-before-use when quit wenxuanx.wu
2022-03-02  7:20     ` wenxuanx.wu
2022-03-02  8:06     ` wenxuanx.wu
2022-03-02  8:34     ` wenxuanx.wu
2022-03-03 13:22     ` [PATCH v2 2/2] app/testpmd:fix testpmd quit failure Wu, WenxuanX
2022-03-04 16:15       ` Ferruh Yigit
2022-03-09  3:07         ` Wu, WenxuanX
2022-03-10  7:02           ` Wu, WenxuanX

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=1b505422-c6ee-ae53-e472-4bdd413c7ace@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=wenxuanx.wu@intel.com \
    --cc=xiaoyun.li@intel.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).