From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 285C7A04E4; Wed, 12 Aug 2020 04:57:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4B18E1C0C0; Wed, 12 Aug 2020 04:57:53 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 385051C0BD for ; Wed, 12 Aug 2020 04:57:50 +0200 (CEST) IronPort-SDR: fnF9/UIxyE7uqaINQ/lhi3uGxiCa0VvZ0FIv+wlQCOoOdZZf/vnqyGlY/vIqeNrgHu26nV6iyL bpMNFQRrUrAA== X-IronPort-AV: E=McAfee;i="6000,8403,9710"; a="218209207" X-IronPort-AV: E=Sophos;i="5.76,302,1592895600"; d="scan'208";a="218209207" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2020 19:57:49 -0700 IronPort-SDR: iz7vsTaZSSfcAhGdltNCIe+emPV4V8eYWg7jVzett2Clv7SutFZnO3FCDlE2cnKVUb0MyvN65h /0GChUT/GaUw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,302,1592895600"; d="scan'208";a="327051882" Received: from fmsmsx603-2.cps.intel.com (HELO fmsmsx603.amr.corp.intel.com) ([10.18.84.213]) by fmsmga002.fm.intel.com with ESMTP; 11 Aug 2020 19:57:49 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) 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.1713.5; Tue, 11 Aug 2020 19:57:49 -0700 Received: from fmsmsx103.amr.corp.intel.com (10.18.124.201) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 11 Aug 2020 19:57:49 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Aug 2020 19:57:48 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.172) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Aug 2020 19:57:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=njBBX1slv7mW7ID8T3bb0qCaTsCAZWar5gmC2LuzpMFttqaYgiHs2k5CPIzuCyuy4klCdAXkEX1+kEbEypQtBGA8jBkPmIgk8YeU1nejHp3zZgWHiDtGFp/TZcc8wtCk8Qw/2FnJfHM08JrjilsbH3LwCB80TdJO5nRonIGZ7luZZN/YAVvZZeuYWHg3MIEtMXL0vb0AhfFt2ygN3I+UcfLGqLl6G346/qcuDrF9o/p5BTfVxDQA7Kt4Ft0vSA/R1mAqC8XKXUiYUE8MW6maBvyPxOc2Wd5FyPbUaAGnjNN89Ka2jn9HukGY3LzNjpJOaXKYAmvnXFo/GY8AH8IKfQ== 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-SenderADCheck; bh=xY6XSSntXvXFCZLiXCX1cUCHcfvbUVDrhyh+Td8KuVU=; b=N3pFctjQ7Bb74Nf+Sj7fLbT23DZ7sUKQZWcfVh8ltua2BUdVkhOBsiTNjQGn5cvCfUUVS1WwE1kD1j8d/plLdoJKrz1bs0ye5+nzbl+lD1ay1ORbRuQLYndqjQxAC0J7WNW2NTaOZZjSkVkyfGk/MZ6I7+cPNdxtaSGoZ6gpysWtYS4WktoLsq53hk6Fb2DtSw6Dx62CHf4QQnxsydRFFukU/vYHJBK4AFYAdIjPeKxVtQUO3eeFUtbJC6TN3M+M+tM7A34dDW56f/jbYddFbiBUY7R/i1Jm+t3Y3OpuzN9rCAldOV/qKtsy3TG0QAl90RrcIgWG5/HrRttbZoft7g== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xY6XSSntXvXFCZLiXCX1cUCHcfvbUVDrhyh+Td8KuVU=; b=CnzGvqR+zJEIYJBZ1Lx3se5QNb54PBKEVfEeZCk2NcyfxZP9U1NCyUeaNydrEENZss92IexUCid2BL6LQ7JKX04gE1H54V8K1kd7lozgCHb0uz6zh561aB1gtxsTtXtQJnG3yl+q9rGQ0wGr6Cb+hZhgfI3wRmu9aG/bapNR97Y= Received: from BY5PR11MB4054.namprd11.prod.outlook.com (2603:10b6:a03:189::26) by BYAPR11MB3208.namprd11.prod.outlook.com (2603:10b6:a03:7d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15; Wed, 12 Aug 2020 02:57:45 +0000 Received: from BY5PR11MB4054.namprd11.prod.outlook.com ([fe80::49a5:c0c2:ab26:8520]) by BY5PR11MB4054.namprd11.prod.outlook.com ([fe80::49a5:c0c2:ab26:8520%4]) with mapi id 15.20.3283.015; Wed, 12 Aug 2020 02:57:45 +0000 From: "Wu, Jingjing" To: "Yang, SteveX" , "Xing, Beilei" , "dev@dpdk.org" CC: "Yang, Qiming" Thread-Topic: [PATCH 7/7] net/iavf: fix port close Thread-Index: AQHWb7baIWJo5OykekCT70CVRDCjH6kzyC+g Date: Wed, 12 Aug 2020 02:57:44 +0000 Message-ID: References: <20200811075910.20954-1-stevex.yang@intel.com> <20200811075910.20954-8-stevex.yang@intel.com> In-Reply-To: <20200811075910.20954-8-stevex.yang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.37] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7113a1d8-21e0-4892-b947-08d83e6b7cdc x-ms-traffictypediagnostic: BYAPR11MB3208: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0UF5bNdXRYZ4OkP+T2nhjwgG9SZJZjC+TPyUOTxSDhV3X3fdOoK7/vNTHbdkxUnPgkHxVuNeuuDKvYL3wj8QERUgELPY/aWRyWrBNrrmU9a9xHeJx+2j6YVLAc+duXMt+E0IRL01SO7V2N912IqV67j6KQxAMGoBk4jgQSOab8HHYu1/VDIZMj04QhGaqT3XDiQLASY+CW+oIs9MyGU3u/ArSc9YOv/vBpmgBThEt9p/FcZwD/XB7nJe4ukuYDRQO/3K2EoC36IRDcEj3WhuHBifXlYcR2kcXVDZW5u+09kYwhDLMbVzxithFLlAtWdlkRsVfDTQeMRz25MmaKkMHA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR11MB4054.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(39860400002)(396003)(366004)(376002)(136003)(86362001)(9686003)(52536014)(5660300002)(110136005)(186003)(8936002)(83380400001)(7696005)(26005)(6506007)(53546011)(55016002)(107886003)(316002)(2906002)(71200400001)(33656002)(4326008)(76116006)(66476007)(66946007)(66556008)(64756008)(478600001)(66446008)(8676002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: OQwhaE41uQeQ5bAJEAUAHbxHZz3FPPGneN4muFFmShkB5IkIiXsUft3dT8bU9jYukwr21v8JSPJoHQYluiGD3FnUAq2aD2M9fNbTqYnbJJizqiioVr5KhiHgkAlPJPyOSn4GX9TQDqi5VTolB54tZmEL1szxXyfqIQlDf/KBC7ZEE9LKu9ukabiOyZ06BzQxwVBxqckdZ/rAKkD8fxBkIO86wPVN/YGATn3aCWdKPI5mS4yNM9MqaotpYbEVWHTdHpUtzV2IKRdjZPokxkOE18RD3jFcaIaYvx+Lfbvw8m3a6lWS72XOQZd3k1zR4RJ//lWcl3bLeaI/sEw/2uXwx6b9P49582Fot9iUsBTEo6KbCYUKWt9CqKfRK6AMoX7dIkekkPtJtZiAZ5muL8xSUe6H5FMx0d/QaV8vPo7qSDVnbw4GSai7OQlnjPFz0+WHYA+JAnpP0Lxg2ptmwwj6a6rSsIfW3dBE1Lei7T/lMfwaIX3f4AqtoYhMp3eOkjoN4EZSLS+wIoEQa90zTutTgvLCyoclcAIeW5RI3FaHSjLqvfpyM0eKEaLRv6lb0hhuVBliTTeAfR4tWALC8u2yjB+rsit8KBOz5a+WLNs6Q6f4nfLoksHwm94c85wFFE1j2LjmCws7Q+wJb8Q2ljG9PA== 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: BY5PR11MB4054.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7113a1d8-21e0-4892-b947-08d83e6b7cdc X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Aug 2020 02:57:44.8958 (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: sYK6KMY5S11rkdQTMf46VhJouR24hre4RmsoRWWa7l4mnZoguVzRJMSTk4Q4P0JjgqKMZ+cHcfNhc5Dcl7NiWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3208 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 7/7] net/iavf: fix port close X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If RTE_ETH_DEV_CLOSE_REMOVE is set, port would be released when dev_close i= s called. So it is not necessary to mark it as closed. Another concern in my mind is the REST virtchnl message is missed to send t= o PF in iavf_dev_reset. Thanks Jingjing > -----Original Message----- > From: Yang, SteveX > Sent: Tuesday, August 11, 2020 3:59 PM > To: Wu, Jingjing ; Xing, Beilei > ; dev@dpdk.org > Cc: Yang, Qiming ; Yang, SteveX > > Subject: [PATCH 7/7] net/iavf: fix port close >=20 > Port reset will call iavf_dev_uninit() to release resources. It wants to = call > iavf_dev_close() to release resources. So there will be a call conflict i= f calling > iavf_dev_reset() and iavf_dev_close() at the same time. >=20 > This patch added adapter->closed flag in iavf_dev_close() to control the > status of close. >=20 > Fixes: 83fe5e80692a ("net/iavf: move device state flag") >=20 > Signed-off-by: SteveX Yang > --- > drivers/net/iavf/iavf.h | 1 + > drivers/net/iavf/iavf_ethdev.c | 6 ++++++ > 2 files changed, 7 insertions(+) >=20 > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index > 9be8a2381..06cbe6089 100644 > --- a/drivers/net/iavf/iavf.h > +++ b/drivers/net/iavf/iavf.h > @@ -161,6 +161,7 @@ struct iavf_adapter { > bool tx_vec_allowed; > const uint32_t *ptype_tbl; > bool stopped; > + bool closed; > uint16_t fdir_ref_cnt; > }; >=20 > diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethde= v.c > index f16aff531..b58e57b07 100644 > --- a/drivers/net/iavf/iavf_ethdev.c > +++ b/drivers/net/iavf/iavf_ethdev.c > @@ -1367,6 +1367,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev) > hw->back =3D IAVF_DEV_PRIVATE_TO_ADAPTER(eth_dev->data- > >dev_private); > adapter->eth_dev =3D eth_dev; > adapter->stopped =3D 1; > + adapter->closed =3D 0; >=20 > if (iavf_init_vf(eth_dev) !=3D 0) { > PMD_INIT_LOG(ERR, "Init vf failed"); > @@ -1423,6 +1424,9 @@ iavf_dev_close(struct rte_eth_dev *dev) > struct iavf_adapter *adapter =3D > IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); >=20 > + if (adapter->closed =3D=3D 1) > + return; > + > iavf_dev_stop(dev); > iavf_flow_flush(dev, NULL); > iavf_flow_uninit(adapter); > @@ -1434,6 +1438,8 @@ iavf_dev_close(struct rte_eth_dev *dev) > rte_intr_callback_unregister(intr_handle, > iavf_dev_interrupt_handler, dev); > iavf_disable_irq0(hw); > + > + adapter->closed =3D 1; > } >=20 > static int > -- > 2.17.1