From: "Wu, WenxuanX" <wenxuanx.wu@intel.com>
To: "Yigit, Ferruh" <ferruh.yigit@intel.com>,
"Li, Xiaoyun" <xiaoyun.li@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH v2 2/2] app/testpmd:fix testpmd quit failure
Date: Wed, 9 Mar 2022 03:07:04 +0000 [thread overview]
Message-ID: <MW3PR11MB4665E019035447DF5D570EC8E50A9@MW3PR11MB4665.namprd11.prod.outlook.com> (raw)
In-Reply-To: <bf9b12fa-3132-7488-e831-bc2b49dec6eb@intel.com>
> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: 2022年3月5日 0:16
> To: Wu, WenxuanX <wenxuanx.wu@intel.com>; Li, Xiaoyun
> <xiaoyun.li@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: Re: [PATCH v2 2/2] app/testpmd:fix testpmd quit failure
>
> On 3/3/2022 1:22 PM, Wu, WenxuanX wrote:
>
> moved down, please don't top post
>
> >> -----Original Message-----
> >> From: Wu, WenxuanX <wenxuanx.wu@intel.com>
> >> Sent: 2022年2月23日 19:33
> >> To: Li, Xiaoyun <xiaoyun.li@intel.com>; Yigit, Ferruh
> >> <ferruh.yigit@intel.com>; dev@dpdk.org
> >> Cc: Wu, WenxuanX <wenxuanx.wu@intel.com>; stable@dpdk.org
> >> Subject: [PATCH v2 2/2] app/testpmd:fix testpmd quit failure
> >>
> >> 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) {
> >> 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);
> >> --
> >> 2.25.1
> >
> >
> > I found this meaning in DPDK testplan.
> > Note that currently hot-plugging of representor ports is not supported so all
> the required representors must be specified on the creation of the PF or the
> trusted VF.
> > When testpmd is started with pf and vf representors, the order of
> representor is determined on creation. So it is guaranteed that ,pf is beneath
> the vf representors, we implemented in a reverse way is acceptable just at
> present, depends on when the hot-plugging of representor is supported.
> >
>
> The patch mentions from PF and VFs, and now you are referring to port
> representor.
> Is the problem related to VF or port representor.
>
> For both, VF and port reporesentor should be closed before PF, that part is
> OK. My comment is if reversing port id traverse will fix the issue or do we
> need more complex solution.
> Like have APIs to get VF and representor ports from a given port id, and free
> them first.
This patch did fix the issue ,and was verified.But it was rejected.
next prev parent reply other threads:[~2022-03-09 3:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 10:14 [PATCH 0/2] app/testpmd: fix quit testpmd with vfs and pf wenxuanx.wu
2022-02-17 10:14 ` [PATCH 1/2] " wenxuanx.wu
2022-02-18 8:40 ` Zhang, Yuying
2022-02-18 16:58 ` Ferruh Yigit
2022-02-17 10:14 ` [PATCH 2/2] lib/ethdev: add reverse macro to quit testpmd wenxuanx.wu
2022-02-18 8:34 ` Zhang, Yuying
2022-02-18 17:04 ` Ferruh Yigit
2022-02-23 11:32 ` [PATCH 0/2] app/testpmd: fix testpmd quit with pf and vfs wenxuanx.wu
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
2022-03-03 13:22 ` Wu, WenxuanX
2022-03-04 16:15 ` Ferruh Yigit
2022-03-09 3:07 ` Wu, WenxuanX [this message]
2022-03-10 7:02 ` Wu, WenxuanX
2022-02-24 11:04 ` [PATCH 2/2] lib/ethdev: add reverse macro to quit testpmd 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=MW3PR11MB4665E019035447DF5D570EC8E50A9@MW3PR11MB4665.namprd11.prod.outlook.com \
--to=wenxuanx.wu@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=stable@dpdk.org \
--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).