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 B805CA0543; Mon, 20 Jun 2022 05:37:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B8AD4067C; Mon, 20 Jun 2022 05:37:54 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 1C30840150; Mon, 20 Jun 2022 05:37:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655696273; x=1687232273; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=O6zR9Huy+Fnq27vxstxVi0gCUPzFV8bzF4S/Pm1x4iA=; b=MTsbNuJR5eSx1OOmTR0N1j9xmr1IT6ojJwLF70g5DSpufrgNgYP8QX5W 4IHu/wTMucbVW5IyfTwJEJn8Pgvbk7EA2emY3SwEEfd3XOm3FwQ4ZtmLy R/NxSXI1hSzgzC0WsZUuhuemzmReTaht3Ezy4TtJIYkO0jPfoH1qKf0NI gxXiGHNH2K/0YiErQjyX9Au+T1PDf0BI2svBtfIvnTZA9EF2HWWbYCIeB bpytjUfjOkwOJU/MZDVMfI8Tu3IB/Fc3JT3AwLO0Lz/ZOo3r+aFCCv0ta JUAt1MKWyWuI27hatWJ0vfICHhJMz5qrA6aFb5ag3kaMxf7HhWRkcYmBd A==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="260223148" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="260223148" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2022 20:37:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="642906437" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga008.fm.intel.com with ESMTP; 19 Jun 2022 20:37:50 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) 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, 19 Jun 2022 20:37:50 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 19 Jun 2022 20:37:50 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.27 via Frontend Transport; Sun, 19 Jun 2022 20:37:49 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) 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.27; Sun, 19 Jun 2022 20:37:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UQZFApPYLSxQH8TbiDCpI1e3ng4Wpozo50+Onj2W7Ujwple4vCjVI5Ap/oewCqQZm/bzWXKa4b0WdQ8FeiydFgm0cF0yT3gr/5bKkGw6ehvOJm/m6L4xRV0opL5hqpX3M5JVxvoAeFrsaOVfp1XomHb7yAg3XJGzEcKtjdfL2V650hF8foSl18LswZHQKK0wGOgMZR1tQ3xSCiO/ODUtbytYWyj1VzMek2ASBRY99+IIrZOYoVqHn8Qw6vaTQsmMqek8EGJX5ADe6OvRy9l3/KqQbbaeup8v8crLatSF+fMOfuPox/voet9IHnC77ThnwzmZ4ldWOZJn+5hTrBpdLg== 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=ROv4y7rgf0iS8vT2bR7ydpYnkP0DVApiRq0hJnyDNvI=; b=VE96MdpJhym0qda5o0gPtyPno2k3daoBFJ0z0d4fRVGUSPBO86cWy91QZpZG3+GwmJQJirEBLgFFwTUffM8xbwMXHtVwD03OQxlS52ZdDsm7AHYvFE4yvrlAHVhTXzl3SP7cDYV528tg/LCVhngyp/QDCJU0jSKsF+nl9plBuTcOEypMGb+GydTFMXIHrfHEluaGoSzfTOV3Cv6ZTfHGm7k4C5J+spayoZtmzq2gyNgSCyn9W3QsBshD/Zr4x4YXZmaO/kSS/VU39L0IC5uKMXV/6n1N/dM1zuXvD6RimSf5P+6DY5UicOErv0t1G67IX/HEqb7XRBDfe0XiIQadLA== 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 CY4PR11MB2021.namprd11.prod.outlook.com (2603:10b6:903:2e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.17; Mon, 20 Jun 2022 03:37:48 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54a0:2dbc:18b7:2aa9]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54a0:2dbc:18b7:2aa9%7]) with mapi id 15.20.5353.021; Mon, 20 Jun 2022 03:37:48 +0000 From: "Xia, Chenbo" To: "Wang, YuanX" , "maxime.coquelin@redhat.com" , "dev@dpdk.org" CC: "Hu, Jiayu" , "He, Xingguang" , "Ling, WeiX" , "stable@dpdk.org" Subject: RE: [PATCH v2] net/virtio: unmap PCI device in secondary process Thread-Topic: [PATCH v2] net/virtio: unmap PCI device in secondary process Thread-Index: AQHYeXxzM76fpCa+JkG23AXd5RNSVa1XuxKw Date: Mon, 20 Jun 2022 03:37:47 +0000 Message-ID: References: <20220421111537.935333-1-yuanx.wang@intel.com> <20220606155543.1213665-1-yuanx.wang@intel.com> In-Reply-To: <20220606155543.1213665-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: ed95222c-a62f-42c4-35c6-08da526e3edd x-ms-traffictypediagnostic: CY4PR11MB2021: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: HmC4ljZ4gesUEODQfMDiqXJd5TmF62nZLkuJUIOEngAxkBtXljD+p8aqGzMqggBcLW9NQLEkArRtPh6DTHLuRfMPq+4dhfwUH9IGwuHykTmz7tVQHLwpncKEDOsCJ7oVQqGqzbWfIgL0HzCVdIiyrex0+1BNdGpvD1mD/h0gCez4nuhNgVFG439nNgcdLC0xVLbKVg5pFNv198dUOpO7wKXYCFHMdrrpuMDQDkMQ2l7oXQLU8Ig7GT0o0bujWM2VQbl+VQp47bQfmieGauScpSlyKK+15Fb7ul9HwuSmog/VGzH2TJPiUvIhvp2Hzaj1t0q8WMylpHAg2wjglD4rrvAcTav1NDn+aAm/R5vfJPO08UkXgiRJlAj+VSAFTIhEve5KwScylzfxBvJgXh+qxsfF9tyxw7J95vq9jgWbfB4qQY1jRivPg68okkdFujj1fMK60j500L6792TJmWRPblh7b8Ou5SoruDq0pXftGiVHKszUmmHxlDbTlyuWdRuLy1NkCMUIql6NYStCK2hVWB2PlPTE58OoN0+/yYx+MJrAis7RL7IUqjTVNVp2cpPlWf5imlrejL21NJVKSKYRrWSI8aJCCEMC3Fi4y+zw6zO5gJgXe/AsSLRHwHYJ+X+d017K3GNQyRI5ABnaImYLvvRFUAvzG14HQUVPm76GQETSVKz0X/rEEagU8llhHIhpoMTBRP+3Ndvz8yafXCF55g== 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:(13230016)(366004)(122000001)(9686003)(498600001)(55016003)(82960400001)(316002)(110136005)(54906003)(8936002)(26005)(33656002)(8676002)(71200400001)(6506007)(53546011)(7696005)(86362001)(83380400001)(64756008)(4326008)(66556008)(76116006)(66946007)(66446008)(66476007)(186003)(5660300002)(52536014)(2906002)(38070700005)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?4ljh9decQZY5dz8vlBS73OGp6+2If7Scp+KXGVZslkD/tuUY7BWevviIdlmj?= =?us-ascii?Q?TVlg1GfcvBlcQfz5BKKVULOgE52bL0trGFBgT8hjhK5zoWUGsu0ORkyY/olZ?= =?us-ascii?Q?mtLDx/3J+0Kis129A1SlH0FNMu5QXicGmahv8A1sJHXhKgo/QYoq20pde82k?= =?us-ascii?Q?xqoNzy+h7lUgCjY6gOk9MMZfRrNpKYKB/2L7NnH5gFVEFS1cAxulqL22KZka?= =?us-ascii?Q?B8sNt/1WYqn/LZt7hzFU/EYyGzXeSeMoMpq9TpenTLT7+QyBdZO25bKExTcp?= =?us-ascii?Q?ih/szwyLkur2PnKVx+uL9QqP3oFur0SWsYf+cOhOMsbBcFtqhBd9xjU1apij?= =?us-ascii?Q?9bR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?us-ascii?Q?MPABSCLIcQisCBDSHvP3tJ2mGfS6bT0GfnewsbeKe0mTDdNDJFwOIE3klxmt?= =?us-ascii?Q?s9FxSBvodoLHGhJqFvMx4pNjGRPWYVXAy18XXlFXxJSFG5Prp14hfObet7J4?= =?us-ascii?Q?54gedt6jpo7xdbbI+8TdMezX0C1BBxLH88Hapdmvtle+Dk4tTqceh58UrRTn?= =?us-ascii?Q?a/AHJRyGl1gblq5wmxAa8RUgh0KS9c9HQSG73RdZHu+zstJpbP1LDUsyxxpc?= =?us-ascii?Q?tWkVvCbHoEYfSvK+J6FleolPaDAwLlZSfxCKnrBM0SCiVKisa6WSkhqa+8c4?= =?us-ascii?Q?Mm5uLZRGTOSDAfsyO1borTYcIM9/TYoHHrU8hNB97IxqI0AEzuLZwtWMTpXh?= =?us-ascii?Q?CEgQjuGq/xq09PHiseZSil/lizX6ylnwjNP4ftGxDnzMQ+CMo8Yf04nFCo/4?= =?us-ascii?Q?ehV9/lt67RTqTmFgIslKmpkGUJP7SrlnWIXEQebRMmOUbPxDR8Brkuy+GiTp?= =?us-ascii?Q?HY7yQWtnQA=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: ed95222c-a62f-42c4-35c6-08da526e3edd X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jun 2022 03:37:48.0286 (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: 6Am1zIF4U6s7pj3V9IW+JFayqeTXmcPE4LXAShNRYpaj37vpuia7IOhwuGUXQQ5B7zNi2ORsGnxrcKjBXBeSew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB2021 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: Monday, June 6, 2022 11:56 PM > To: maxime.coquelin@redhat.com; Xia, Chenbo ; > dev@dpdk.org > Cc: Hu, Jiayu ; He, Xingguang ; > Ling, WeiX ; Wang, YuanX ; > stable@dpdk.org > Subject: [PATCH v2] 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 unmaps PCI device at secondary process uninitialization > based on virtio_rempa_pci. >=20 > Fixes: 36a7a2e7a53 ("net/virtio: move PCI device init in dedicated file") This should be 12 digits, not 11 With this fixed: Reviewed-by: Chenbo Xia > Cc: stable@dpdk.org >=20 > Signed-off-by: Yuan Wang > Tested-by: Wei Ling > --- > 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