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 5C04AA00C2; Mon, 30 May 2022 04:49:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F3D3340A89; Mon, 30 May 2022 04:49:17 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 9E6A440A82 for ; Mon, 30 May 2022 04:49:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653878956; x=1685414956; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=o08KNYn2J9lTOMd8cqVgHFsS5sNODu9qy3U626I98lI=; b=XhBUUngsvLEB9KgvtxL5wPiumegVqJZZlm4CHj0AG2IcMdGj4v8Zf1Bs +HDJxuugIfbIzz9kGUHdVctavJDyejSledJN4tSPpsUjMi6fxjBFAvzjm OODzG4HVIswBLcsqtmMJzCt/c02ei9JeiyczkCnvDZz9TxtyILgiCHFch fOUNPPWzXW7PbPrDYIE0HZTaytxQIa/VtZIbACuHFCub7INTYg3BwzfNS 6krU+AEP3xwIm9ye3heaI7Qkophg80V6EcD6fRqvBZ30H7AOAo8hVHhL0 ZQYFjDoEb/bIpVBhVRznVp9Wu+6zV/NS0h3I13mrrFduCKPGHso6eDPLg A==; X-IronPort-AV: E=McAfee;i="6400,9594,10362"; a="274877750" X-IronPort-AV: E=Sophos;i="5.91,261,1647327600"; d="scan'208";a="274877750" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2022 19:49:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,261,1647327600"; d="scan'208";a="903364889" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga005.fm.intel.com with ESMTP; 29 May 2022 19:49:09 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 29 May 2022 19:49:09 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.27 via Frontend Transport; Sun, 29 May 2022 19:49:09 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.172) 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; Sun, 29 May 2022 19:49:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EAPXmi6HWigYxdg6tKgHGgpvoMHkpKAhKd4la9h4KqW1hJaxfmIblaSdl/b4BgWBZaogSb2je5HkcGW95+gNmnm20yYbiYxIwlqJvPnsRsQZi/QYBRpLjQl79P7bf9GYPjAee/NLm01Mgg1SWd62t/qG0FrGOIVGkYGWgqRQqoCLkMwsYelILfkdhL5+iXUVyNbP+xWTL9h3gn+8Aym074/IEUqi+D4s1Fw8vTZHoXNZN9fHmk48eak/urUWqjQwhkqkoZ07t8XsF2sNnIXeaovO07zuVyGo0m3/cBAN5ff5OD/vuglwfY7FiwajEFhPMu3fRq+Jc5lTIt+OB77hQA== 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=QvxBXwv+WePhJItIlwkMmhVnPapIshNEDqQujpEhIds=; b=DGk/1083Zgytpdzonu2IsC/agNNMcJR614Siddif8jEcFJVgxJUDz+JAUPsZGSkXSDnNWGBmT+7Va0eTraGr4sZx5v2aXfd09Nc/1EnvPx0Mp9pX+lWeGvhTGNGZhi21ap/7ZTb3WyxG6QKYV4fO0fatUJxWeTdv1BlwV8sILqONQXPzqLwqUtYEgunkcONoJnVa7fxPWfxXjl8FbFwOm+Hsiq2f/Y45Wupc+Ynukc6r4DGhpsvrF6aNTTZgSBrKKykzngLke5Go+SBBBCWv3GcOgE4BP4iKLIJWMCHmYCm669XFboz/sMhMM91197wVtu3F1rosi7Ndp/mGkTwJzw== 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 SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by BL0PR11MB3490.namprd11.prod.outlook.com (2603:10b6:208:7e::11) 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 02:49:07 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::d4ff:ac50:621a:60e7]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::d4ff:ac50:621a:60e7%7]) with mapi id 15.20.5293.013; Mon, 30 May 2022 02:49:07 +0000 From: "Xia, Chenbo" 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 Thread-Topic: [PATCH] net/virtio: unmap PCI device in secondary process Thread-Index: AQHYVS9mENye1P54l0mkHatIAItQNK029M6w Date: Mon, 30 May 2022 02:49:07 +0000 Message-ID: References: <20220421111537.935333-1-yuanx.wang@intel.com> In-Reply-To: <20220421111537.935333-1-yuanx.wang@intel.com> Accept-Language: en-US, zh-CN 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: 38cb2c5d-5918-4f2f-4322-08da41e6f744 x-ms-traffictypediagnostic: BL0PR11MB3490: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: 3xKfsdgLQG7L8Ydttw/JbITVfbnYhO8/2PNYrxZTJ7/P78qJK6+XBRG90QpgPPemwnr3/riQx8jTbRyTvcgLuzp+7ShftP51+Ltk0PR7S+vKvwIpLypHJzfVpAuaJSLAvEfgI2KSuUhaihgJaGvlMhXFth+mdJWdhW3XnIN5ifjYeFvpUoGlgJW7lYZrAlt08mmEhhGQvYsWjaU7tPinRmJR7T6s845YLH8pmHHuncxOkVPI1PrC3QkkP1HeqaKTl8YYUn7QHAL/NoywZch0YJrVsjqo2Y+GqtPcekOCo4QfMKgep8ei+gIgenUXLbhhW4ya7bNvrxO43kpPWkay6eybRBYmS4fLkNi8U6VpQIRG7EUmaM7tQOBZGFHr90BzYJnk7S0mT/PVn14UgyocmXtTVnSPYhGRIJ2NhISagfeRBGMtmIrkqax+2cTvU1jSkUoea556VkNh+Zw+/J7QSdSLnrs72+8hpfZrC3MBu+ylUaEGescmfdUUF6661yay9GaXbejyHKShANrvJxjzjSbjSh23DQuyvj/8c8YhNwZiCEcbpF9EveM+Iy2AJZxXp30aSTQZhbLQEEb67cR9B4e52GIL5OzgFrGz3ngBKB/4i6fjJLwOB5wN5L7Mymfzpl/hjee1p8SYgbJCApiYZe32I0ufKZczXo474hqmWjRFtrC64iqLEVHG75swusF8mBo7/kBPXvOp1oXE13A8qw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(9686003)(107886003)(38100700002)(38070700005)(53546011)(122000001)(71200400001)(7696005)(6506007)(55016003)(26005)(186003)(76116006)(52536014)(508600001)(5660300002)(86362001)(66946007)(66446008)(66556008)(66476007)(64756008)(2906002)(8676002)(82960400001)(54906003)(83380400001)(4326008)(110136005)(8936002)(33656002)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?pwYPxWglS75PCr0icB6Mz6T8L7BYFSYH1F73+gKtM8HiyQFDZN3z5Xqd5Xe5?= =?us-ascii?Q?e++JMHJpHj297GRhC22ZBjYbCbDXxelLbWFz5aHHx9cUF1JsVNIYZeE4iwey?= =?us-ascii?Q?wxQDP275la3Uq/JnbcU420moYfOHOHhWVU7qZHySn3ZvMVFA0sx0wES4GuzP?= =?us-ascii?Q?XA+JHuOTAc+vfZtwtkk1W7VetksaGcxnqQ9XgFRhVZDOtGvGntp7EWdk6HSd?= =?us-ascii?Q?HyA0CuI+MNyNOpMl0PyZNakM67XVHlTpfd4Ty295vZ8BcPB0MuzJlEaT+n4V?= =?us-ascii?Q?3XOtbgTrxFQNdZqEMuYX+R51e5/deuXBg7qIUwLhCdanzfzBE2TATFjNNrQa?= =?us-ascii?Q?r3xLT1+sY7JwRjMf/eYS3v9EG4/4I3WAVsWJk9pB2bn+6CV7StEUktkUz7Rz?= =?us-ascii?Q?CCRpnUxznpQlT33g6fKQOpIQ3NSYkHjcQrbr/GdNnqmtcS1UNO32joxowM6X?= =?us-ascii?Q?bh/6ctyHD7v3/limsedgn9liU5ojXkOP2sYHT1Sd7WlpJM29c+OA02Y4j+1R?= =?us-ascii?Q?U3t4DAtbsGG1RNZ1AyfqVI49ZIUVGIslsgwPlNs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cgp825/PF0YB6zhgwQCqAZSr33uJJTPbSzye4lf/ALMleM3rDM/mSbR?= =?us-ascii?Q?djD8yhnmaSNwKohDulYySzVH0ow3qav4qxClacnCfLhcssia06TuJFS7/Va9?= =?us-ascii?Q?FvQTYA1O1gUdb4wgA+g+nzO60ANb+6j0OOhQh634nZulyxBpoqVwmnTE9/Uc?= =?us-ascii?Q?PmjYTFH1TRmuNqwD3Di3fj70kAk33rs2uBWIEM+kLlVAs8+EkhJm+O80lzbT?= =?us-ascii?Q?194XNUdqt5o+2VC+60jxbt++CMwQwK4PW/Q4Ra+wSVZdBfXfHFF+G5QA2t1C?= =?us-ascii?Q?gGng3aL3GA=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: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 38cb2c5d-5918-4f2f-4322-08da41e6f744 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2022 02:49:07.2607 (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: 1S0JoJFE46WTtqlG/ckX9hqFlzoSfWLZp+WWxHYAawMmYyAR2C9gGzfAokWtZAMZvnbllA2fxGGYz6ZxOs3ILQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB3490 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 > -----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 >=20 > 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. >=20 > This patch unmap PCI device at secondary process uninitialization unmaps > based on virtio_rempa_pci(). Virtio_remap_pci >=20 > Fixes: 36a7a2e7a53 ("net/virtio: move PCI device init in dedicated file") Miss cc-stable tag. Patch LGTM Thanks, Chenbo >=20 > Signed-off-by: Yuan Wang > --- > drivers/net/virtio/virtio_pci_ethdev.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) >=20 > 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(); >=20 > - 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; > + } >=20 > ret =3D virtio_dev_stop(eth_dev); > virtio_dev_close(eth_dev); > -- > 2.25.1