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 AF5A8A034C; Mon, 30 May 2022 12:03:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54E0642B75; Mon, 30 May 2022 12:03:28 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 2C21E400D6 for ; Mon, 30 May 2022 12:03:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653905006; x=1685441006; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=2/mG5AVpJ2HG7oEWRIMgP0sFAk7NyDRDF9yoNuWXJiQ=; b=LBDjQNvWa42EC+z6Vnizqogk4ypFhB1GaCDo3Z1xzx26Utav1wiWhfmL ctG3/f2PkkO5hFCgkRagHwpJafVVnEI1UPB8iYdlMo/kxLqu6/azaFcP0 qSDGGiF+HcpaymhGmGG6H6Vy/1ilp37+vO2p9mGkll/aPgZ4d6Sxm+Lyu A0I1mWjq/7x5tQEIU4wFqaylSquQp+boPOAoglvkgvdg0ZjcXWg7obf+y Mw6mhe2W6De2U6KtKLA4yo1f9eT+MJ7Iu0OzrOETzBS7t4xonvNYf0Ko1 WgD9QKVUb7H9VWBwstLnK0wj0JDBRz9vDAM3kANQh/czsGMOkitylMsnm Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10362"; a="335606375" X-IronPort-AV: E=Sophos;i="5.91,262,1647327600"; d="scan'208";a="335606375" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2022 03:03:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,262,1647327600"; d="scan'208";a="706096420" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga004.jf.intel.com with ESMTP; 30 May 2022 03:03:25 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 30 May 2022 03:03:24 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.27 via Frontend Transport; Mon, 30 May 2022 03:03:24 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 30 May 2022 03:03:24 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G426puKh0xl+FeFC140ITdJneNqgX1xeYiTDJCK2UT+/SoH5BLBg7J7KtmPi57DvJc2p9moWAbrd2IZq8fwmA2drdzwvlXKbEBuKCZWVAp02AUmnkR+9a7cOJ3F+6VHFX3AwLlwp0NIehBxsb4jHHn4hn+Sfw0qWaLOyG29Ba8aihWm2rv74HCAz18/1+OT5z+dMdtkT2GRVrYbew1YM218g6QwWLcn8WIgZrXtMDd0FrRTt5AiqU/0yoAIcReC/zbKL8qwbBEFJrOtX6QPC0seEa75N0loQ5O52BqrZPAwAgmKk9HqkJ+Rn1begUv1+JjNdUL2qUsaJAGDvnVjixA== 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=x6EvVOTdECaq+RG/YFnrCoZhPd8aHF2H+kw9BzlEr6A=; b=nkmFTfPg2AfmJF1PywG4v9ZLEAoItLaL1c0U1dTvH6gq+2XZ89wMGXzfEq57LIXhqkx18fl9EKyMM0Ltmb7yrk+gm0p28caUpbxmhiVBIF5IFnBsC7qAzAXhI76cBKURlbYBIda1SkhLH7A6QowRT7k9mrpWm25SnCVUmnyEsGLQcpB2ROzMuVQ/+6mlLuXUPUze3EfKGRza0WNPjzs9Jv/egigEtt5jSrecNHemhoUqK1KwasWC2Y8eJibBSrL99CTtV6hlFwsKQ/JlVfpj3sxSTQ87Myfq363ZQUQsMWMyxFKZRxZq+Ym0ScAHN6mpW4Z+aErqXqVoJjnM2kpx8A== 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 CO1PR11MB4897.namprd11.prod.outlook.com (2603:10b6:303:97::20) by BN6PR1101MB2290.namprd11.prod.outlook.com (2603:10b6:405:4e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Mon, 30 May 2022 10:03:22 +0000 Received: from CO1PR11MB4897.namprd11.prod.outlook.com ([fe80::1045:18ba:7fd7:93c1]) by CO1PR11MB4897.namprd11.prod.outlook.com ([fe80::1045:18ba:7fd7:93c1%5]) with mapi id 15.20.5293.019; Mon, 30 May 2022 10:03:22 +0000 From: "Wang, YuanX" To: "Xia, Chenbo" , "maxime.coquelin@redhat.com" CC: "dev@dpdk.org" , "Hu, Jiayu" , "He, Xingguang" Subject: RE: [PATCH] net/virtio: unmap PCI device in secondary process Thread-Topic: [PATCH] net/virtio: unmap PCI device in secondary process Thread-Index: AQHYVS9mw1Kk0Ppmg0GOCxzeXIuiFa029UqAgAB40aA= Date: Mon, 30 May 2022 10:03:22 +0000 Message-ID: References: <20220421111537.935333-1-yuanx.wang@intel.com> In-Reply-To: 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: 99d98dc6-7775-4838-48e8-08da4223a132 x-ms-traffictypediagnostic: BN6PR1101MB2290: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: ZsZ2RocRgBtOCL0JWZflFVoOmpbutPTWUqYOfid3bi4S8j656nQ3Wf387J+gH+O8l4iYlmnQ80UXS0xzKaPUlY9hkYzdWtTmPtL5ffsZpiy1JmPM+8DfNyUyBkFGi1E2BpbWQ42ZyHNwxGrRLxUIgq1NE/bvHDau/PIytMzH3niTAwarRwlniSd2LhHFCWEtvAyOd4KtaWy1cuDtid71kVpZvknHX+1uPXYXCapUlYiNEHiWjH6ULp6ZXYGR2/ZJ/Np3jR+4SgKDzjRArLbikzmgQq0p7UdsCB67bySuFItUrG4cKkbx7ir0MU0noaQkP3hd6VOXvEZi45Mb7/v6L8WYWfDY9qmRi8xc57e7KGc3z6WOcARzgWJl1vJrmWrAAAd+TSms42x317Xb0qJ4r6TLo55lF+G4XbxaiHXHPLle4FqkvXIL13fCDUtLxuVWSEwOvPVZtYXyEdl8I7xgH+gRIXoog5uDjY3eryIx53gravl4mD81yBLIsw18GDaTBH73DU9Pw1ob3B+zu/5KlCsT9A5jH7wFkwWrE8K0kMZw4QRJk+Le5EBzxygDIfMhwKcTLKItJd9WBxJZGLvsuH9hiw4FTXOMBGGKTzYxzRF7utG06MYH06xr9EFFy2VNnDFSdDId3jX3UPQ7z7iWQLa4+CKJyQKtrpGe32vcY9XSIhsHV6JdxC1WDn24GGcjcnwL91cEuYTpoGjRJ8oshg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR11MB4897.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(5660300002)(33656002)(52536014)(66946007)(64756008)(53546011)(66556008)(8936002)(6506007)(7696005)(86362001)(9686003)(26005)(2906002)(71200400001)(82960400001)(122000001)(38100700002)(55016003)(107886003)(186003)(83380400001)(38070700005)(110136005)(316002)(54906003)(4326008)(8676002)(66446008)(76116006)(66476007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?KBgqiWFauO6dF2U/l+CFKPczHa1ZIJ4Uxggku7uzK65xQ2dS/F4AZl+JIACc?= =?us-ascii?Q?fHod9/Jns1/ZdP6pSUX6/VDOntxKXJYtdruUp4zOMg2S6Tig0CdwrKzKGtgG?= =?us-ascii?Q?O3ORevHV1S7GHWDxny3HQt3kAtcA59pPcbtZZH4iw30Hb99dQpf1f9RAbKBr?= =?us-ascii?Q?5QOdTpAppErzyd3tlNrjRQgcSUlysR2Uk1yq6Dc1/oAT4yVT1lDVDldR2Owz?= =?us-ascii?Q?mmI3oaOEJvVbSpmWgD1CWGkMTxSASxST4Noae5zWKWGEH3HvXjR1PlOoFzCl?= =?us-ascii?Q?tLkyfOmiVp9vq9WLaTtqFKHqlMMKEEbXPeBse3FXN9KqeKBve5Xplo/p6o4U?= =?us-ascii?Q?gSteLlRvQXdOR/KutrtzTW0QQhK/1LAhFH9fsoYCi20YZ0gqpeWeSPdXGwDP?= =?us-ascii?Q?/Qx5g2LisFKJ3JH+d/pKy94suoxi028Jfusg7GIBX1gkqFkztNQWgXwqZoGe?= =?us-ascii?Q?eEr0jWskGTT4TcM7en9Av1UzMgHfEagJq2vM5i9K6aippEKwLX8dQJEEDNqz?= =?us-ascii?Q?nwstcDJHIPsGEmi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nYgari3HQMFDH+Yj060?= =?us-ascii?Q?wJuKgPTnwr3aNi2zYmedskQrTnFh58PUmMGMjT9Wrc1lotwguIWU0eDB33SJ?= =?us-ascii?Q?rtORS+D3kefHEEvHQ6aQbKdyDQk6if9idD0eLGBu597dK8RCf9/mGq9fBJO+?= =?us-ascii?Q?8cc685pzliEiNr2pURwbFsHewN5WClFjR+RdyEPSfw2Kc+wgJcPPVm3pLcyX?= =?us-ascii?Q?henw7dwdZl7/tfouvi3QIwRqK6QwgjvJmdWShEs9aL5mHO1awa6t5eISk0BO?= =?us-ascii?Q?RYomFUALb3Mr4XPVpBSbeTn07IXkwotwLpXSegsv5GdvLtXMunQ6uroXlItf?= =?us-ascii?Q?xgcEkeJs+g=3D=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: CO1PR11MB4897.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99d98dc6-7775-4838-48e8-08da4223a132 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2022 10:03:22.1473 (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: deO3OKVRUjuFzZM8MlRW2zClAxBPi0WMou0LTJf8EX//ynDgPqyIHIgPUpJoSz8miK85FiPnrWZ5sja3SC/daQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2290 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 Chenbo, > -----Original Message----- > From: Xia, Chenbo > Sent: Monday, May 30, 2022 10:49 AM > To: Wang, YuanX ; maxime.coquelin@redhat.com > Cc: dev@dpdk.org; Hu, Jiayu ; He, Xingguang > > Subject: RE: [PATCH] net/virtio: unmap PCI device in secondary process >=20 > > -----Original Message----- > > From: Wang, YuanX > > Sent: Thursday, April 21, 2022 7:16 PM > > To: maxime.coquelin@redhat.com; Xia, Chenbo > > Cc: dev@dpdk.org; Hu, Jiayu ; He, Xingguang > > ; Wang, YuanX > > Subject: [PATCH] net/virtio: unmap PCI device in secondary process > > > > In multi-process, the secondary process will remap PCI during > > initialization, but the mapping is not removed in the uninit path, the > > device is not closed, and the device busy error will be reported when > > the device is hotplugged. > > > > This patch unmap PCI device at secondary process uninitialization >=20 > unmaps >=20 > > based on virtio_rempa_pci(). >=20 > Virtio_remap_pci >=20 > > > > Fixes: 36a7a2e7a53 ("net/virtio: move PCI device init in dedicated > > file") >=20 > Miss cc-stable tag. Patch LGTM Thanks, will fix it in next version. Regards, Yuan >=20 > Thanks, > Chenbo >=20 > > > > Signed-off-by: Yuan Wang > > --- > > drivers/net/virtio/virtio_pci_ethdev.c | 12 +++++++++++- > > 1 file changed, 11 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/virtio/virtio_pci_ethdev.c > > b/drivers/net/virtio/virtio_pci_ethdev.c > > index 54645dc62e..1f6bdeddda 100644 > > --- a/drivers/net/virtio/virtio_pci_ethdev.c > > +++ b/drivers/net/virtio/virtio_pci_ethdev.c > > @@ -122,10 +122,20 @@ static int > > eth_virtio_pci_uninit(struct rte_eth_dev *eth_dev) { > > int ret; > > + struct virtio_pci_dev *dev; > > + struct virtio_hw *hw; > > PMD_INIT_FUNC_TRACE(); > > > > - if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY) > > + if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY) { > > + dev =3D eth_dev->data->dev_private; > > + hw =3D &dev->hw; > > + > > + if (dev->modern) > > + > rte_pci_unmap_device(RTE_ETH_DEV_TO_PCI(eth_dev)); > > + else > > + vtpci_legacy_ioport_unmap(hw); > > return 0; > > + } > > > > ret =3D virtio_dev_stop(eth_dev); > > virtio_dev_close(eth_dev); > > -- > > 2.25.1