DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: <wenxuanx.wu@intel.com>, <qiming.yang@intel.com>,
	<qi.z.zhang@intel.com>,  <xiaoyun.li@intel.com>,
	<aman.deep.singh@intel.com>, <yuying.zhang@intel.com>
Cc: <dev@dpdk.org>
Subject: Re: [PATCH v2] app/testpmd : fix testpmd quit error
Date: Fri, 4 Mar 2022 16:18:57 +0000	[thread overview]
Message-ID: <2b3f014b-af62-db9b-95cc-5dfda689b6ae@intel.com> (raw)
In-Reply-To: <20220304023701.499961-1-wenxuanx.wu@intel.com>

On 3/4/2022 2:37 AM, wenxuanx.wu@intel.com wrote:
> From: wenxuan wu <wenxuanx.wu@intel.com>
> 
> When testpmd use func get_eth_dev_info() while related resource
> had been released.
> 

Is 'eth_dev_info_get_print_err()' fails at this stage?
What resource is released, the 'slave_port' itself?

And there may be another logic wrong, it shouldn't try
to detect if a released port is bonding port or not.

> Change the logic of func port_is_bonding_slave, this func
> eth_dev_info_get_print_err while pf is released would result
> in this error. Use ports instead to avoid this bug.
> 

This relies to application level stored value to decide about
port, not sure if this is reliable.

> Fixes: 0a0821bcf312 ("app/testpmd: remove most uses of internal ethdev array")
> Cc: stable@dpdk.org
> 
> Signed-off-by: wenxuan wu <wenxuanx.wu@intel.com>
> ---
>   app/test-pmd/testpmd.c | 12 +-----------
>   1 file changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index e1da961311..37038c9183 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -3824,19 +3824,9 @@ void clear_port_slave_flag(portid_t slave_pid)
>   uint8_t port_is_bonding_slave(portid_t slave_pid)
>   {
>   	struct rte_port *port;
> -	struct rte_eth_dev_info dev_info;
> -	int ret;
>   
>   	port = &ports[slave_pid];
> -	ret = eth_dev_info_get_print_err(slave_pid, &dev_info);
> -	if (ret != 0) {
> -		TESTPMD_LOG(ERR,
> -			"Failed to get device info for port id %d,"
> -			"cannot determine if the port is a bonded slave",
> -			slave_pid);
> -		return 0;
> -	}
> -	if ((*dev_info.dev_flags & RTE_ETH_DEV_BONDED_SLAVE) || (port->slave_flag == 1))
> +	if ((*port->dev_info.dev_flags & RTE_ETH_DEV_BONDED_SLAVE) || (port->slave_flag == 1))
>   		return 1;
>   	return 0;
>   }


  parent reply	other threads:[~2022-03-04 16:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04  2:37 wenxuanx.wu
2022-03-04 10:12 ` Zhang, Yuying
2022-03-04 16:18 ` Ferruh Yigit [this message]
2022-03-09 10:10   ` Wu, WenxuanX
2022-03-10 11:11     ` Ferruh Yigit

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=2b3f014b-af62-db9b-95cc-5dfda689b6ae@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=wenxuanx.wu@intel.com \
    --cc=xiaoyun.li@intel.com \
    --cc=yuying.zhang@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).