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 A20EAA0351; Fri, 4 Mar 2022 11:12:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 822F5427A9; Fri, 4 Mar 2022 11:12:15 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 8E10B4013F for ; Fri, 4 Mar 2022 11:12:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646388733; x=1677924733; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=g1iWcn/w7IjZaYQdDrnbk5FaCg4BEbeyanc1m1ArG0s=; b=Mq35wRAk+kK/9DlWiPAbqIIDAX8/W1k6XLdQ2hwTgdQl1GGuUlNOeYc7 Mqg8ukWFKEhzm4IUdaBAWXT1zTaiD6jMfKaNettwN7VzTo3xKH5Q2QElr IhPaoi4HA+bnlRo7k4o+KkSpWM4d/4x0r30JoorzkTNa8miJQMDzrbFwP m8a+Z8KEQUy/yGW02foy2QZa/IZmLKPD8Z6Y3t+c1Ja7rvSgl3g8Wep2b Zk2sOnBB8PTZMt0YaWN8BFzelQntlmV0IAlsm7BIi9+zd6rokfyxC7ndP LKuQenO5MMtBJjJm7ydAYpy9oWj3OBMDhRWsysrd1mhdlw2EkQ3m15BCU w==; X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="317172289" X-IronPort-AV: E=Sophos;i="5.90,154,1643702400"; d="scan'208";a="317172289" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2022 02:12:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,154,1643702400"; d="scan'208";a="642465260" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga004.jf.intel.com with ESMTP; 04 Mar 2022 02:12:12 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) 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.21; Fri, 4 Mar 2022 02:12:12 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx609.amr.corp.intel.com (10.22.229.22) 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 02:12:12 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.169) by edgegateway.intel.com (134.134.137.100) 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 02:12:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KGcT0VnuYJWBDBPd3pMHep3rKT1Z1rxZKd0DIa+8RlZIC6pKOdg+W8LSi+8fsa62tu6zdrbr24Z5ZWUIPCqEtfCdIBoLMS+1Ac7DLeBLnCvH2/MDmcYsIk738OhDwO+GGnKpcxSuNfJnToVZA1ofT8h/3nFsTb7gDUCwUO5+oslcKaDAekeOeVNcO1JUL9UmERiUKIEVUjOE40x3L9//qA+PbR5L7yZz8M8RHYKpSd+XvCGbr3TLxcjBsiPvCP4wCh6QGc8Zlh5Htop++5H7FP0rQKjYgMC3hRdKaD98DSyWsMQSuu1Xxq1eR659Z7x1ufjnMjawQraRZnZuHMtDCA== 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=ibVL2F1lfe2PBVzATEa2DpkHafUXi3GlU8a09HRdh5E=; b=dmuhQf/R2vkGBcwpnJHgfk7Z89/iW7XvQD8bPM1zP4BLw6i2J3du5ZHRf34i+K0G4kPc5I2w7R8D/+O3ZPXH64CxqO6IB3qhMVICBxfDDLfReYcEi3Yo9Cp7lE+POxJ3Rju5kk1d3RE9YOFRe4ifkcL3iBisXqTba+rFkpT1tzfyV5NteE2+NNeQdNAvjoeIz4WkLM39IHS1VqaZgSUqpezjmbZMRvhBZvjHX+ri46yEowBs73dl4yhnHVdlY1xrLaSZa6AXoryNH+8bRi1Ray3TFl3booLWe0IaUcXZJGGxGCIhLelCzx9FgR3kaXDBCMKaEWwc4mrr0ufVE4i8Ig== 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 Received: from DM6PR11MB3516.namprd11.prod.outlook.com (2603:10b6:5:72::13) by SA2PR11MB5049.namprd11.prod.outlook.com (2603:10b6:806:11b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.15; Fri, 4 Mar 2022 10:12:07 +0000 Received: from DM6PR11MB3516.namprd11.prod.outlook.com ([fe80::1c27:af5d:3e9e:d172]) by DM6PR11MB3516.namprd11.prod.outlook.com ([fe80::1c27:af5d:3e9e:d172%4]) with mapi id 15.20.5017.027; Fri, 4 Mar 2022 10:12:07 +0000 From: "Zhang, Yuying" To: "Wu, WenxuanX" , "Yang, Qiming" , "Zhang, Qi Z" , "Li, Xiaoyun" , "Singh, Aman Deep" CC: "dev@dpdk.org" Subject: RE: [PATCH v2] app/testpmd : fix testpmd quit error Thread-Topic: [PATCH v2] app/testpmd : fix testpmd quit error Thread-Index: AQHYL3Ogc6Eyp6D6kk6jjh3VbIoWqayvAKJg Date: Fri, 4 Mar 2022 10:12:07 +0000 Message-ID: References: <20220304023701.499961-1-wenxuanx.wu@intel.com> In-Reply-To: <20220304023701.499961-1-wenxuanx.wu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: baa92878-d6aa-4687-20b0-08d9fdc7704e x-ms-traffictypediagnostic: SA2PR11MB5049:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr 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: RzZAT5c5rHDZOdx8awnQ/apXHVhsOEQxpBM46IMtbAUlZQ+ncDjrxsknC3JDlDqlyKhbipB92b3hW5Bf7aVfdwPGOIBAIiuwk8rRZE3rL0p/7iufRUDOEmbJWSsrH3eAtIao6YWlxf4KsJy/BVJlb+32EuhJN4N5tfDFj8EdT0JbhViFoHQNw6LA5/Y7llgYQUGv1H9sgKaa55yew0sdgkA6J0JjbKIjLZxZ2vTBwAJNsGTIP88wbF5Y+KWojjwh795J2xqFaGoInPG+RNkh0YguGDAmE4rYV3DyM4j0oVr/wa8gvogKvgOw5j00EfOXKfUjHxh9mFRySZ6JBwFQxxcaVOEYgwasVKSbN++4Z4zQchKXwJJDTo+Z6f0UbCCDKLMrGP91dFDqS0lLpr9oKfVNn3CPAp5S6CELqbpsiaLTsuf/Rwwfk5E8U2iNsQU1vKS0XIecYqIXg7X7whZ5hnXuncL3RfEfpbMtzF6Ax8RqvKf1R+KP7iKRqJ6CpRzrssikUBElaHAWwwC95H6c31vqG4guVpbAGJiOjYSoxg2KVylqSsbebO8ztKXyGipv9GcufRCSkiMsSP+7oi3MB8JKC4ZSA3UpAR51i6euub6igvY0hXMTyAHHp6Xr2Ze8gb6KsgjnBcsjMBCbj8IGvFCf9KSrswjaEkau2U8efVxxxZMhETZvAmCM9LMLZbGjjPmlExbWewskTh4p4wYcs4Wlm9hNBTmQ7/iNu2wTuqI= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3516.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(82960400001)(921005)(71200400001)(316002)(6636002)(8936002)(122000001)(66556008)(66476007)(66446008)(8676002)(76116006)(38070700005)(66946007)(4326008)(86362001)(38100700002)(64756008)(33656002)(508600001)(53546011)(110136005)(83380400001)(2906002)(186003)(5660300002)(26005)(55016003)(7696005)(9686003)(6506007)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UBBrKzeymN98SoXQ2B+xLjbYMdu0dH/dUdPofW6fFRHfLQ21/n3bjZ7nOLgi?= =?us-ascii?Q?csqeK2NAM0CHVo5yTxHKtPNoFLlTF1lxzX7qAaoiGt6z5Eq5sOxRDoF/o8tx?= =?us-ascii?Q?oVEWBetvKyiFCFKxVKBQyFocoxQZDUSM16fukmcEik1ZNp7a6WnfHg9Nc2rr?= =?us-ascii?Q?KR+xTNLaHO4rHHMTqQRX/L+J1yi5qIROz/RSTtBUaHGgImK/+4oRTPU143t8?= =?us-ascii?Q?sE3A4HIHZILZAAw9mWqxh3AkU8fOtMKoNDNu9x7FDg7XNazstUosGzPniQ9Y?= =?us-ascii?Q?n7Z7qrdeTlljopf98/V171DFsXQB1Gb48F4hv7esHLYhQn6/2RRYPTbAdgVK?= =?us-ascii?Q?fRtm4Bh1VTO5FNRK688aR7cA54uO18aooe3Au7moEnJ9Lbb9snSYccCZP0UH?= =?us-ascii?Q?0TwkvmfuBGWqTebpyb9L/LZvpkPhGU0Bl2JyzBiFGxw2MZCn1lg6d5WCOIuu?= =?us-ascii?Q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aXSLjjAn83gOLr4xYg0+V?= =?us-ascii?Q?ymkRl9yYwvR+1F2neQ55RVG+1mcgfgOfJ++p9+yAHWak6wuU2iedJbnfyyMz?= =?us-ascii?Q?ReeOrGzkqq7YybL6JKi1NUSx2LiIM+VM8TaGhoAhmNDy8/fItbqdWDftGcme?= =?us-ascii?Q?Sg1SMvUV2uTzzlQSctVYcpa3d7yYRAnPT0UaO5GJyAENS9XyOjuxO+FNiEyQ?= =?us-ascii?Q?sI6E0islgXbHPn7FTEhmxpYgU1V4PFKWLKz1j0Tktba8GEsFBgmr4TBIbFSs?= =?us-ascii?Q?wXCHbfkBFjujci9Tj3jdxIw=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3516.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: baa92878-d6aa-4687-20b0-08d9fdc7704e X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Mar 2022 10:12:07.3029 (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: cT+IdVDLZaqCOxs8SxKlKhhNR6xNIWi29l65CYzhEBrA5rIlWmYJnfv9upbxae38QO6lEIoh/L2ijc6Px+4Jyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB5049 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 Hi Wenxuan, > -----Original Message----- > From: Wu, WenxuanX > Sent: Friday, March 4, 2022 10:37 AM > To: Yang, Qiming ; Zhang, Qi Z > ; Li, Xiaoyun ; Singh, Aman > Deep ; Zhang, Yuying > > Cc: dev@dpdk.org > Subject: [PATCH v2] app/testpmd : fix testpmd quit error >=20 > From: wenxuan wu >=20 > When testpmd use func get_eth_dev_info() while related resource had been > released. >=20 > 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 erro= r. > Use ports instead to avoid this bug. >=20 > Fixes: 0a0821bcf312 ("app/testpmd: remove most uses of internal ethdev > array") > Cc: stable@dpdk.org >=20 > Signed-off-by: wenxuan wu > --- > app/test-pmd/testpmd.c | 12 +----------- > 1 file changed, 1 insertion(+), 11 deletions(-) >=20 > 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; >=20 > port =3D &ports[slave_pid]; > - ret =3D eth_dev_info_get_print_err(slave_pid, &dev_info); > - if (ret !=3D 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 =3D=3D 1)) > + if ((*port->dev_info.dev_flags & RTE_ETH_DEV_BONDED_SLAVE) || > +(port->slave_flag =3D=3D 1)) Is port->dev_info.dev_flags updated in time when the bonding status changes= ? It may use eth_dev_info_get_print_err() to update dev_info of port. > return 1; > return 0; > } > -- > 2.25.1