From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 25A7FA00BE; Fri, 11 Feb 2022 08:12:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C283F41141; Fri, 11 Feb 2022 08:12:52 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 85B56410E5 for ; Fri, 11 Feb 2022 08:12:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644563571; x=1676099571; h=message-id:date:subject:to:cc:references:from: in-reply-to:mime-version; bh=tUN0EpwoVE66nF5Qv930mtXZ5/i6OeC/4vSvePEh8wk=; b=JYOpQ3LzH73oe23J1UHlBV+6Clgju2tYQ3jhACRYi/RWM8J6xsdrgEdt 8ED8hXidwh4ExN/c106XvTTr+WLhcRxcL+eGqypdNoQ1VuknHQJ0wcS/2 wFDyBOWuuVBS0Ces4xa0qPPXVSeBo8DQ9CfMS8dK8brznFfkjd7W8S63K aAZ7qmWd/WBtWnkikJqxv9jVI3Ft2ECe2rE7pmxQLRz+nmzgrN52a32ZH 0RWr8V76k3qKpBCNyPiBGtbfMDvPvj/CCuVNUiPsIiiK8W9lIL91eSSCw 82/DRQEIlN8sLs6VKdvJPwfZPpQ2f1RsVJHS9tjmdse1FCRMvQ/WbMFej Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="233233141" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208,217";a="233233141" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 23:12:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208,217";a="483180412" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga003.jf.intel.com with ESMTP; 10 Feb 2022 23:12:49 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 10 Feb 2022 23:12:49 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 10 Feb 2022 23:12:49 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Thu, 10 Feb 2022 23:12:49 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IhjO1kAhyIxOdIJZZIltVVKEiRrqsctNgsLqwyaBOz0JcNa+2F6/m483R8uRI8PfWvu7j+QWWAs9oc/XYRvVAWPl+9bVNOan5UIuj812hOCQbvASaPHDLs45bMHsGFOzE4hLociYdJw85BqBiBzT+e+u0FxrXtyR8Fxyq2+8E68SmaIhSt5Nz+Wdql8Ytas6Cs7PRvmnaBw28nyoinTG+ae9baSTqP7bm6Lr6PGEoBDadIMOxCKIdXjhX1GGsFO3XL5zgTXVRihmKiWYT76Jevm8tmHookRoWMZyiE02lVTzJCGSOTf2h4c8rX+q7suUZxW8qESNTzXVW83/IIMAQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H5KW9koQQU5fsS6k/Whe6ZcSeg4yRQAz/na+PKYuChg=; b=WltuOb6VgTaxkKa6cix0Pl3NuzL7lNtqScYU3dLICOIOx3AYjFxpxT40SxlguLb2drjs2KzBfoBNbpXpK29W/OHygIE83n3086YZ1p7zUctn7ja1WaTYgtI9uqejiCphaVA8cVSGT0AlMx2TjUYpSjLJpgr28mFyYT4wwSeUaka0IVwadePpi/rJ0in111UJEjMxVXNg9BSK794rJHTl/beRIC+Qgx3/FhzOPsu+HWwU1AGHFx9U7JCwosoZLw6ix3UNqbD5cisJYDRmKQA2AF/5PzX0z2ddghkkW4/FgXgwDQ9b8u2xK8AygvvMOnsvbHaQnA6w00F9GEhVWRjs8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) by BN6PR11MB1732.namprd11.prod.outlook.com (2603:10b6:404:102::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Fri, 11 Feb 2022 07:12:47 +0000 Received: from MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::417b:7df4:d3fb:2b0a]) by MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::417b:7df4:d3fb:2b0a%3]) with mapi id 15.20.4975.014; Fri, 11 Feb 2022 07:12:47 +0000 Content-Type: multipart/alternative; boundary="------------zfDWdQtA0XeU6jst1pXrIPq2" Message-ID: Date: Fri, 11 Feb 2022 12:42:37 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH] app/testpmd : fix testpmd quit error Content-Language: en-US To: , CC: , , References: <20220209104243.117334-1-wenxuanx.wu@intel.com> From: "Singh, Aman Deep" In-Reply-To: <20220209104243.117334-1-wenxuanx.wu@intel.com> X-ClientProxiedBy: BM1PR01CA0074.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::14) To MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 95d8516d-0289-49ab-4fa6-08d9ed2de7f1 X-MS-TrafficTypeDiagnostic: BN6PR11MB1732:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0sDCnE6lDXwn/2SQeQ6eLnv5ng12FQsL1yIqq7NEiR5Bp004ELVRXhNmRluyIe2lrNHV6XK4f00/rMENHe1QlAOW7CdoWUX1Z1OwApUT68mGt1ruB56xSUzvlbDpBb/Zppwv5a0V47F/C6Wwl2c4ffDceTnx64BB+68RqnF09yjNXbdUf5uQYvm1zpWCVhqr1MrqQA4xyP8CiuVRvjVvRzq+vARsFH8/g5CBUImdD135/Tgkx3p2ZiU9YahuGz3+cenPsnEhlGNvAfVX12/GdViXe0B2GoLHbknlIArL4ckDh/X8vChceKTmlt00nfoMT5tzBbRVq7vlPEgknTPLPvVPUnbcedsB2PWA4LOBbeJf+7/t+q/tvEMgmTcldpofl66tRBfwTqwFPQbdWxddZPzT7XYB7wr/pdw+XBpL3GIZFBXDhagvBzgLWYShBZ1S1KUsFde4gsy/JMbDGmw8m/hBaJ0zbmnVw9LL2mUr9vTqt6GXrlJD7sNQY9sEGN1BRKaSeOycsjPhQxSCn8pbPfjUYJLZaiHxg+dIxb01DcLxk0GkPFdqmUMyarxIvwg/ZeNeuw6OavNkGTzU22n4obIqivnvXZZMsgAJ7QGTZRsntx2Nf0Z0C+d0kzMqq5FgsN/0UoIz0ju/PfaoYXFNJr1eiFPL/6bcmT/ayVLk4XHNAdhnQ40/RihgQMYJcwueF+gifMFmwEjjmFTjSXIoVbbdkK2s7h99bbKfGQAOuV4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB0062.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(53546011)(86362001)(2616005)(6512007)(26005)(38100700002)(31696002)(6636002)(186003)(83380400001)(107886003)(6506007)(33964004)(82960400001)(508600001)(66946007)(5660300002)(6666004)(8936002)(8676002)(4326008)(66476007)(66556008)(31686004)(2906002)(316002)(36756003)(6486002)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ODJ0SXhFY2cyWkRMeUlDN3FBZDEweE03Ui8zcjNHTVVGL2tLNU9jRlRtbUo5?= =?utf-8?B?bVE5SUtSbnF4N0MzVHZtVSs0d2ltZHB0UnEwOWZ2cVlwczlHMDM5SWxENWFH?= =?utf-8?B?SzBJWU5jL3BFejFYTTJoRjdMRDZCZ040cFFsV3ArbWFlc3lnVkxUZ3h4WUxI?= =?utf-8?B?UDlYQ2RMQ1Y3VXRySFFMSFk1Z1dadzRZNEZQYUhKdUo3Vmc5K1RXTGZodFlY?= =?utf-8?B?WnFOSTBob0FGc2VkM0htc0JoWXc3S0FtYndXNmtwVFVlaWxSVFpkYXZURmZR?= =?utf-8?B?RHhLSUZjUjk3RVpRdUNEMk5rRGRWQ2lhSjBXVUpVWEV3dHJvMGI5N3ZteWs4?= =?utf-8?B?NStHQklFRE5URU4xNGE4SGJmNUpCM0NGemhIWFhhKzh6RDg2WU52aEZjUldh?= =?utf-8?B?U21LeDRMTmFkdTEwOEhiWE1PRzd2UDV3eVRMWEtHb1JkQno1QnRjVVpHd1Zj?= =?utf-8?B?cUtxR0JVejVKL3JF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CrossTenant-Network-Message-Id: 95d8516d-0289-49ab-4fa6-08d9ed2de7f1 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB0062.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 07:12:47.4360 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LUFDJ3wJrPaXKM2wKInqI317s0U80JhnEc5saTV425qZoRH/uj/r4eUn13Z7SSrZr9I/6cZLO9b8Jvc+BhqXgir65a5LLOK3F2Yc60qgM+g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1732 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --------------zfDWdQtA0XeU6jst1pXrIPq2 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Hi Wenxuan Wu, On 2/9/2022 4:12 PM, wenxuanx.wu@intel.com wrote: > From: Wenxuan Wu > > when testpmd startup with pf and vfs, it is ok when running, while > exiting, it will result in heap-free-after-use which means pf is > released but vf is still accessing. > > 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. Removing call to func eth_dev_info_get_print_err, seems like a quick fix to the problem. Can you try root causing further, where pf is released. And can the order be fixed, first free vf and then the pf. > > Fixes: 0a0821bcf312 ("app/testpmd: remove most uses of internal ethdev array") > Cc:stable@dpdk.org > > Signed-off-by: Wenxuan Wu > --- > app/test-pmd/testpmd.c | 13 ++----------- > 1 file changed, 2 insertions(+), 11 deletions(-) > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index e1da961311..7fa1944d78 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -3824,19 +3824,10 @@ 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->slave_flag == 1) > return 1; > return 0; > } --------------zfDWdQtA0XeU6jst1pXrIPq2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 7bit
Hi Wenxuan Wu,
On 2/9/2022 4:12 PM, wenxuanx.wu@intel.com wrote:
From: Wenxuan Wu <wenxuanx.wu@intel.com>

when testpmd startup with pf and vfs, it is ok when running, while
exiting, it will result in heap-free-after-use which means pf is
released but vf is still accessing.

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.
Removing call to func eth_dev_info_get_print_err, seems like a quick fix to the problem.
Can you try root causing further, where pf is released. And can the order be fixed,
first free vf and then the pf.

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 | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index e1da961311..7fa1944d78 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3824,19 +3824,10 @@ 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->slave_flag == 1)
 		return 1;
 	return 0;
 }
--------------zfDWdQtA0XeU6jst1pXrIPq2--