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 D9ED8A034F for ; Fri, 4 Mar 2022 17:16:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C6227427D7; Fri, 4 Mar 2022 17:16:01 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id BD267427A9; Fri, 4 Mar 2022 17:15:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646410560; x=1677946560; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=0nLQoyGbrcDJsEjRKLJ+uDrN9Kv2MHLiDU+pQH9IUYE=; b=X1intuTrr9sFJ7Lva3ekqMCWubJBZaKTj+NvTIC3DFJL6gQK6oSqjzAJ X2CP2jTf/BK6UKuUjJjlqV91lspy6PatTH8lukIV0GB3mq1eVWefSVQnO A4PeZRcHkUVc+lWg/ZLGJ4ScmmQVsnssRJHCB+6AIaLI+nOtRXpqGOoeI klVaVAsoWtFzg00qYmsctUNu4zaLENplew14Bp0BKINLTGvcodoELXHO5 J8Qnoja3BcirlYi40vVjC3m+M9TY+JIIeCWfPRi7B2b01Ok5r1KDz5AnY P7zfAvwlGa7aRmi1vmu2nOjDffuFP8rCxFpRcDuMJXGO7iWc0lxteH6ZL w==; X-IronPort-AV: E=McAfee;i="6200,9189,10276"; a="251581039" X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="251581039" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2022 08:15:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="552273613" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga008.jf.intel.com with ESMTP; 04 Mar 2022 08:15:58 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Fri, 4 Mar 2022 08:15:57 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Fri, 4 Mar 2022 08:15:57 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Fri, 4 Mar 2022 08:15:57 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Fri, 4 Mar 2022 08:15:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HoFlqhhWOfjdKke++WtXMVzZhF31Skw/LLkue2ubcFaooIlSZqR20MvvOfaVsXdrWOfBb/antNEwyCv/k1BAE8VJl7SrSB4vDYseerTbovCGTIQaXLR/mgoD3QCLh80qe18dOTibe5c05G/thaiQnsBcHJ0sFYYpgOT477Qi4dg4qe2QbOgg7EMSw2mhEsjBJGXernYqm0qJSdgBklcr0JMWqqgbixBZ0OYpwF6ONIALpKBYMiknioP1TMTw8wGkmVKHN6uZbvl1zPmTvvh/wcA75RXU8dErwAMqFXSroh/eI540tElwFiaU8qU5R+MuBGnV01qeuJtcOFGzUcrWjw== 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=Gh+72Yadp4OrGwnS/OmjheFOCUZAlRCS87cKFUIf4wc=; b=koS9CxgPGdWEQ1Mat1sKNmDg4j/Zgx4lYsolG1PlArxHvzTFMKLXM0SMh2fX7IAyzcQKOexgrl2ABLpDHgs/+gqO2H2C0zqEFa3xY0+DtnnEitPGGfr1iQiru85wMhY5Ac2RmNkJm2PaTOHFsO1nvpXBGoOhFfjLdTgfDPFcO20rAAxRK5uRJSdVwphpSc/KC04Ze0xRVCnR27G2S5DapUofZMQs8rj7HbfaAZ4I/eMqH/jOAgZXS1IPzlDqpj21Je6mQI7DiFzLbsd4M62UCFqzf4UB9beZRsSx14W0naS3P2hPb7eQZry3j3uunz2F9zNClqDH+xt4ZBflj55D6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by BN9PR11MB5404.namprd11.prod.outlook.com (2603:10b6:408:11d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Fri, 4 Mar 2022 16:15:54 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd21:6fbe:8308:2ecf]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd21:6fbe:8308:2ecf%7]) with mapi id 15.20.5038.017; Fri, 4 Mar 2022 16:15:54 +0000 Message-ID: Date: Fri, 4 Mar 2022 16:15:49 +0000 Content-Language: en-US To: "Wu, WenxuanX" , "Li, Xiaoyun" , "dev@dpdk.org" CC: "stable@dpdk.org" References: <20220223113251.723692-1-wenxuanx.wu@intel.com> <20220223113251.723692-3-wenxuanx.wu@intel.com> From: Ferruh Yigit Subject: Re: [PATCH v2 2/2] app/testpmd:fix testpmd quit failure X-User: ferruhy In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DU2PR04CA0294.eurprd04.prod.outlook.com (2603:10a6:10:28c::29) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b9aecff3-e079-48f2-166b-08d9fdfa423f X-MS-TrafficTypeDiagnostic: BN9PR11MB5404:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ekc6lcbjqdOSpmSdWC0LYBmHlQpQ9xcePTSRlL+NJBeGBq17uKwvoyi0+blKTGu6qlTs3d7uisc1HBIwNKZUIgT9Ygl54LRgnwwb6eUxLN0WRTEREo2b0ww43OJr/huTknesJupy90bK4DhIgq5sAZyVamCo8ICSfksavMFWIYMmUFDhCdC+4eX7w1eBrCS8gIyVipB9u+ZxgAzsAHAE3umUSWStH7NhwBGwNuhLuBtTcldAm2msaYODnOzIN7gHkHSR9ejXH0gw8Efb/BRbGVrwXgJeTBMp1Xa+VSABMHwbsjqu9p9QAZeJI9G4PS/QojdgqcnydFl1vj1KZx9U9/nm7oDJmLLW537yBSVv8NwG4yFprRKqTNNaVzSFi2uGo4dLp7HO6c3v7kjbYZ7nz1enw/8luEy8x8IBICCpOBMrFitUC64T9NRbnLj/Q3tf41bTgu0ghlvKcVqKoImy9McmlNg4TXKeZNTo5A8cR/cEVdI51KaBch1LVMPWaTIHhOfkZAxgfmew6jSqQp8IPriVnptZQPTAvkH7NAJTlJnUxxestb926FNvQziI+gM82oOONeIjaoaDP56oGEDQ0ChE1oYwXp7pFFPqCZ2Iyyiak08gDLRuBKi5lnXxYNO46wLooelGMsk5tu3YC6OeK8HlYx+TstWVwCDV+2QJRqPVJcgSSTMAWLvfO4BXVIEz/qI3i+zXqdiNkqLduuUPRA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(36756003)(4326008)(8676002)(316002)(450100002)(66946007)(31696002)(66476007)(6506007)(6512007)(6666004)(26005)(83380400001)(53546011)(2616005)(186003)(2906002)(66556008)(110136005)(6486002)(508600001)(5660300002)(38100700002)(82960400001)(31686004)(8936002)(44832011)(86362001)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aUdaSDNrS2xRUVJ6ZEhuc0FpdkNLcHFNaTRnZG5TZUQ3WVRWSE54S2pOanQr?= =?utf-8?B?MDI1enRPL1Fub0hBTnlkYXZNYzZPeG1laUJrVjdZMTdHNERzTERkc2NrWXBj?= =?utf-8?B?clBwajBkMThjZ2JHU0s2c0U5U2lKTTY5TExiazc5RWsrbkd6VkZGV3lSSklk?= =?utf-8?B?QWc0YnpCTkVqc1ZwT09RV0tpOWdUUEk1NGsyeis0SHBMdXJOSkswQ1ZWdG94?= =?utf-8?B?bkZhdE5FWTlaYXh4M3JQd2FBRlVhYkRRWitpMWYycjhNdUpVTUFiMmptRFVR?= =?utf-8?B?NWh6SVJXb25SbXcwTVh1UUhGMVFqenJqcG5Md1RCWkdPVlZXYi84TjlGRXph?= =?utf-8?B?UjRBWjAxanBjTUVBTFZmWkcvZE1UaHJQZnRBSlQ0MTJ0UUVSQ3BWV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MYRI0f8=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: b9aecff3-e079-48f2-166b-08d9fdfa423f X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2022 16:15:54.7386 (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: UZF0K4R0jfTPv/KSkZu1kdLQic0+UUFoeCHXGAu+RhT0B44/SzpCm67X5+/hlpfBCME2N7DydPW7xaixV3xoWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5404 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 3/3/2022 1:22 PM, Wu, WenxuanX wrote: moved down, please don't top post >> -----Original Message----- >> From: Wu, WenxuanX >> Sent: 2022年2月23日 19:33 >> To: Li, Xiaoyun ; Yigit, Ferruh >> ; dev@dpdk.org >> Cc: Wu, WenxuanX ; stable@dpdk.org >> Subject: [PATCH v2 2/2] app/testpmd:fix testpmd quit failure >> >> From: wenxuan wu >> >> 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 >> --- >> 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.