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 CE5D9A034D for ; Wed, 23 Feb 2022 13:10:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C50B1426DE; Wed, 23 Feb 2022 13:10:10 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 13CCE41170; Wed, 23 Feb 2022 13:10:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645618208; x=1677154208; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=QAeE9j9RtxhrWSzq1gEcAsg+bE2zj3VW3BE3iiI5FoM=; b=f2y8jgyJYbcFy6eO7/zWVYsFFYuWeu0YN/H1k82rN/hypCmIU2RAcwcr 4bQalzz6gWpWy2FhHcgv8p+APxDst760kGGTExAWOwlcZeY3HL6JMNL0Q hDL7Y73sCDITJc9hiBaI7zrWu/NWGSLLwbS21xIn1Tiyl4jpMSO8/sKae qkkyxxBZ/7D1bGiJXJO3dkDSDUxK4yHUJPznMB5V/08RdcO5qjALi8GGT KcmFYv73b0g109sqMYopa0HI7aNqd+MVc3UYlZ1ZL93JHxoWhnfkkFz+H Ya20ILyG/suI8X/cv254KF4MRTIm/DpohBKJheeZBJq26CZd9HkBRgAGn A==; X-IronPort-AV: E=McAfee;i="6200,9189,10266"; a="249531989" X-IronPort-AV: E=Sophos;i="5.88,390,1635231600"; d="scan'208";a="249531989" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 04:10:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,390,1635231600"; d="scan'208";a="573794948" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga001.jf.intel.com with ESMTP; 23 Feb 2022 04:10:06 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 23 Feb 2022 04:10:06 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 23 Feb 2022 04:10:06 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Wed, 23 Feb 2022 04:10:06 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.168) 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.20; Wed, 23 Feb 2022 04:10:05 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NZqWBDQYDWnoljGByhBC0KsQFj0Qmc4j4UF2CnREQ1fN+MyOrf6+dlD94vjlWk7IBm329jCmh+6dP33nsW/NkTFc1P4XmLfYAc3aVrHCtIn9Fvkte2rnsIiHO9e3n0vbFj/o+46poI+xtMOAyBGlnB61nP1yyfoAp2/pjNXnOW3Wby4XtuctvcXY8smRZmyKIM2KgbhrC034OsccEB1PaDOmcz6QfVfNa/EwIyaVRr5WKnlhbDsrCwvFUJHoEWCvdDjlX1DaXcpAuHfwq8BMRr57FOVQVN6M0ExYIF/L8RLWYXXoTQhMFOwIRw60EjoTOzIWY5UojYibcagWg0d1ag== 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=k1txc4wiZq/LTYw0rWOF2extKurEZk0FJcz88M9gqwE=; b=Wn8sqn+n62nRBTElc+RnC98SIo8H28YkXNH6o53rBTkFjHbcG2dZI8243qTEVVAzdbBGYlWShggrmOuZEGswaNiyrHU7sJV2Ys578jjGJ4aS/oGi7yEBXpEIJhIIMaoQ7buXwJvpoodCyQu6h9lFzp6g41HOSCz5zjWeQD4d+2f9Zf4WqiySBWS6Ir99Hgqe+hIBvSXLRIME14cTldAoTf5omV7pmMOC6E7Sd3flvMh7ch3GrcXwaq0ZPPn5vTUJFrNHdyaGnjgRiWkFds8K5fzC7MmSJDCgIKY7d3yEs24JVFoL5uL1w0Lalc/Fo+1Zb9/AlDpwdfjVlkYqq5bMMA== 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 BL1PR11MB5302.namprd11.prod.outlook.com (2603:10b6:208:312::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Wed, 23 Feb 2022 12:10:04 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2%4]) with mapi id 15.20.4995.027; Wed, 23 Feb 2022 12:10:04 +0000 Message-ID: <1b505422-c6ee-ae53-e472-4bdd413c7ace@intel.com> Date: Wed, 23 Feb 2022 12:09:58 +0000 Subject: Re: [PATCH v2 2/2] app/testpmd:fix testpmd quit failure Content-Language: en-US To: , , CC: References: <20220223113251.723692-1-wenxuanx.wu@intel.com> <20220223113251.723692-3-wenxuanx.wu@intel.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20220223113251.723692-3-wenxuanx.wu@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0216.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a5::23) 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: 5b5a2d76-08e7-466c-4563-08d9f6c56c99 X-MS-TrafficTypeDiagnostic: BL1PR11MB5302: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: ygOctDRyEcI8nUZj17I+HXjESf7tTIIY5abBdyzfr2joHmPxsUVjTSFnIK+ps5pEx2k3f2jnAeuZv1ekmIp2MAJUQHLmEtDve8voJwAC+T3rqG1jcwt5X+NfIK2gRmaQWHaFEHvE/X5e/uV9cPL3QptLU5aYfp8dP4/o5vap37F+1KK/TmOX7f/wpVgMsT9xpcEoC8ljLLgQpa0JfGiPqhNv2fTsY0fjXF0Q869otvD5fBfmGYCi7OC40KG+8Qo6Bn9RZq0Lxm2U3grUeWZseMp/4d+0Wg2FIWB53A+jUWJnlLrTS3OtBEvAUUn6tiRRupruIP23krEciGJDJM+gk4NmjL4WgYWBUulZpZjgmrcE6cdBXNRtS4YC6J1EkXQ/RHlMPvOHNhPMzn+gD32nfNi8v3ll5pFfgaFgpIAbHwU4rwKP6DT4wbomNpi5Z1mH6r+gou8FHNhwvlMb9I78VlwnOAUXGq4M9s9AhjZ3iSuf52kn7UuuNZ0em0mdI0WeELJ1NLYoa1iLJa8MkLJizs3K2oVIdSRSoAj9nDDxrTcM6F+UGAlCJuuRZ0LxK0ohlW+EYluwNWhJFLH434emkhqgc+gY3icSVTIChIc56sZH+av6nQzmDkAo0lBbtrjLZWSpt626lEnm0HmBD/zbYQGXanxn4+qhTwzZEQOkhvrcV1mGWdVRIAMT2oPZfrp1gRBrXl4gefX9Uxu045GpbA== 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)(508600001)(86362001)(5660300002)(8936002)(6506007)(44832011)(31696002)(66946007)(2616005)(6666004)(26005)(36756003)(31686004)(316002)(82960400001)(6486002)(38100700002)(4326008)(66476007)(66556008)(83380400001)(2906002)(186003)(53546011)(450100002)(6512007)(8676002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eURWOWNPYVJtUU85ZEpGR1dUMlAwU2RVY05ZczNKS2Zxb1ZzZGJDTmNCaVRt?= =?utf-8?B?N1VmRnFHNGVGSG0xS285bEFMNDRUc2NVSXBSZFVwdTZSQVh6UkF4akxleS83?= =?utf-8?B?eDk1dFo2SnRzWlY0YVV5cHBkWWx2THdiTEpLWjZyQWNPN01KVHRCd2daTDdU?= =?utf-8?B?TzE0OTRCVCtEaXAzejh1Wm1MOXE4a2NUbHZqVStZVDUzN1M0bmpPWDBFQ0I2?= =?utf-8?B?bG1CbXlOaFc1ZXNoQ2xLTjRhd0pTZzl2NDdLMjg2cVRZN3RnMDZUK1J5SENE?= =?utf-8?B?Y0c5ckVkTHNoc0E1TjcxdEdOSGhTazhuS1lDeVZqZzB5WHhhUzhNYzJVZU1H?= =?utf-8?B?bnNwNTFVWUNubEcrV0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KA=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5b5a2d76-08e7-466c-4563-08d9f6c56c99 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2022 12:10:04.3890 (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: m5TLjVr2DTdjRnEL7cwE6HNV8y7cdNlrXYohvclWKcEMm5w1Ex11Kay3EddwALLUtwPORWm+4KILfZNkdLn7/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5302 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 2/23/2022 11:32 AM, wenxuanx.wu@intel.com wrote: > 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) { 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);