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 8EC11A0545; Mon, 20 Jun 2022 11:53:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16C0E40F19; Mon, 20 Jun 2022 11:53:35 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 6395840150; Mon, 20 Jun 2022 11:53:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655718812; x=1687254812; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=LTAQTlDW6mP38074vUcF+Z92Q1d0iuPBsSpsxnUFCqw=; b=NupAgboacaXqVy0xi8eauRKZ3z3hx2nFAsv5MKtpz1rDvN2EKWg2OTCn 6K+/WoiJ0d8CNglz1mN5+CysB7JnvmgJ0yi9YukPmfEt1QcGDQjqJdi6r dlqNdIRNsJhd+KcO7dJfPvFo26Vd7Oh9LiAgT9QsT5rqhjF4K+VkeEKOi xiDPgeH1sAJtoLXD5gyWPFBPep/1Ha9OI7Oi7OPIHh2/9krkoeuk+pzzw gKvgsgYrxALHh7LbE7WGahjJN3Q4DQvmZocp9aDpYJTfhE/RnytyEHy/i 8QN17Y1gEDmBYmSP4YE1q7TExYoTk2gZZfqJBzyHL7DnfUd2hzTsSoky2 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="268573646" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="268573646" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2022 02:53:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="654601360" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga004.fm.intel.com with ESMTP; 20 Jun 2022 02:53:31 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) 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.27; Mon, 20 Jun 2022 02:53:30 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) 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, 20 Jun 2022 02:53:30 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.108) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 20 Jun 2022 02:53:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TLMPWQvbejpPdpDO/jgHFBnE0n1txvPwOra9L/rMyjN2OqicrU7GdTW4rlA3U8thRkxsQWfK8J8BsfsQZUe5MkhPoKvgbbfptzIEGQ4n33e35DHDJy87LinFlffvRl0Cac4U6xqCl6Ka5aesHdZh4epmYT548dGl8096WC4/lMWuR3lW3FQWlyUzPJCODF6Q5f8M2E62Ia/FLHXIBuHnyJ2rbvcHj0UIEAouyhovccBOM7ff8vbSXzfnuanbgRXznpeGG8pCdkjFtvIC1NwTplMgiMOWAtakKzmy2i2fNvKYeROXZgkWrpWyL2zOqRkMUt4Ea0q+AMWFEAZQfzIx3w== 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=8hdquQo4QB5NHUXZbihoZWHLq6AxI6UuUsVRFI9SZqM=; b=aImXTEd5AjnCe5bKlZ/+svX9JT8zZ0YN7LJjFe4NLWWGd+YOiUyLhHgQTxWg0xtT9t6boj412XWS5sMvpgbEkV2cHARy62z66Vs/bdSnbihBVvNjP7uD7jDqPXkAB4x+K7FyGoPxpMxKQ5j7EpVSXa2vVIXq4qo6Yb2DpEbTameFFD6XZmbf4rRt0lEDnqmt6rPnk6w6b7qQQSrCM4j3uF4QF1ifzonoRcDWJ+Y+zdmfBtOytULOECaQrtxE/wk6qmalZO34uW3diIVyu02cBLiHs1Zunb0SN6mwAues3x1oNCgKFK/8lZMLWM0y2VwNueDeMorxZ/IGcUf4GLQ13A== 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 BN6PR11MB4163.namprd11.prod.outlook.com (2603:10b6:405:7f::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.18; Mon, 20 Jun 2022 09:53:29 +0000 Received: from CO1PR11MB4897.namprd11.prod.outlook.com ([fe80::a824:370f:1af5:3f57]) by CO1PR11MB4897.namprd11.prod.outlook.com ([fe80::a824:370f:1af5:3f57%8]) with mapi id 15.20.5353.016; Mon, 20 Jun 2022 09:53:28 +0000 From: "Wang, YuanX" To: "Xia, Chenbo" , "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: AQHYeXxzVn3Q9Vz0+k+oD4XCjhKS5a1Xuz6AgABn8DA= Date: Mon, 20 Jun 2022 09:53:28 +0000 Message-ID: References: <20220421111537.935333-1-yuanx.wang@intel.com> <20220606155543.1213665-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: 4b5ee11f-f045-4f21-50d5-08da52a2ba3c x-ms-traffictypediagnostic: BN6PR11MB4163: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: gI7/6+U4dIkXlwOLB/bkeDyAHV5glTZapTWIOLNBDz8sTf5k+9e25GiPmptBoi2legs4VzivnsMiexqxAF2B42evfxavKGFR786DqKCDKAz65STwSOLHOwXZ32+bR+eFJUUVy0/1LsGDxs2M3j5NmhkG/Qq2xLMQi3QJd6bInN6+ugYcMAJ5nCiJZACZEoXGLDlbIuP/fL1UPQ4Vz+z6qWZzpeMzTSB62XccMRAuOTt+VSVlmKMj5nNiN4uHTLVp6GMamd5qyJnpDVqUfqsRashw0NG+hUW8/ynAKrw8IgUm5WSBRphvnLDHI6k7y6XwHC7kArW8I+KlhaYA+2Dooa3Y3VadU/Es2/slkESYGReBKGuYZJG61HsKoco3J7qxQLO6OgnnlNSHzSQ8PmQv+47L+nnWoqDRSIZIwz9Kn3k+VRwaF+fg1sA7p/CGetfdzZmrv992sMRE4+CKO2/7qpH4n1NkIdrAaHSqA4NeLpKycf3z5eOxnLCPnUi6QTs1YtztC8uZENROi/Mv6utKph6ilOq1I8mh4A5UXZDltQf0cxNEobXWb7GgFTMxS3WFtlfwzLSf5XLFGPTUz3mg9FGRCjrhSBD1UxAL5zTjj7ZquzXXbq5CM8F1gbvzAncGDL+25M7ioxiGknVS+wLYDGjw/PPvGVzluuv1OVX0C4lxDHs2X4U1PVALAnm+46eGj35Kmqz63Dtb7WTMatAtxQ== 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:(13230016)(346002)(366004)(396003)(136003)(376002)(39860400002)(66556008)(54906003)(4326008)(2906002)(8676002)(66446008)(82960400001)(38070700005)(66946007)(64756008)(66476007)(76116006)(26005)(55016003)(33656002)(9686003)(71200400001)(53546011)(6506007)(7696005)(110136005)(478600001)(41300700001)(5660300002)(316002)(86362001)(186003)(8936002)(122000001)(83380400001)(38100700002)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?fCh9a1HrZc9VhbKsc5al8IkpzmtQ5+e9U3ByuQM0EiYCgKV5zIixXMiIP22l?= =?us-ascii?Q?CX4GoS2Oswgv9rkUo4uVCK6bVZX1hVblz5Rh0Ryg1kRk1TWilbSLrX23+sCT?= =?us-ascii?Q?L2yHOW4or7oj80bRIGxJW6WKmW5UtnkJnQ01KOhfqMJh8+MlJ/rzIrEdqObP?= =?us-ascii?Q?hM+HAhn3y8wF1Yt1iliZqZfNdWHnfxzYNBcT9rStDV8/WLO/0x5yffHjrTg+?= =?us-ascii?Q?ndp0u9qLQtJ63UXdthvtTeKDWk0kWv3dzbFvOWY/5Hw9IL+iJo0YJln7Eb4k?= =?us-ascii?Q?CW6ymmUkgZ+8CCtHC5yfmI/FqnXog++EwU0ReRhTsYT9WCQP5yRgd3WjQHKU?= =?us-ascii?Q?q64hvuUaIv/xc/bs+eZeIpR0OCZRxuz9dTDw9uIDwjrgR85s9jaggdlqZ2ay?= =?us-ascii?Q?Y96OD/IR20B8wEcdfrQ3HknNNbFHziVB63dj3D3WKw+nlURUiEKgnjXTkP3L?= =?us-ascii?Q?/ozeZddAmqnsCi6ndAXZNDMMh/UgOvDZcoFBLErdyoN8sJFejtxygFnitVwg?= =?us-ascii?Q?z5z+9scyzGxignS+JLzTBytx6sIdKpAj6VNNch75AUlSZPHJ8raQ1KHosEsI?= =?us-ascii?Q?XSy6hkef05q2eoir8lNlBx/W4kwK/w0W0k3KcGZS3ZAKhP5oyd2rKzjF7NJY?= =?us-ascii?Q?747CyyNy9oqF7VLMbR0uCdibBWjHa8gu/rqITkrgVj75dgg8cw5AC+VsCdpC?= =?us-ascii?Q?8VjzQYGuHZtNPkT29YLgZ1hQKtRSHjngepqyOqgnv+53CXzUp7DJvST47MdE?= =?us-ascii?Q?fHyFQ/pXrTr2dwfzTeSXYMqwN+ILXUc3laTSlE21SyevCmtciR7DzYr27RuY?= =?us-ascii?Q?HFnGej+qgcVhCiWDsy2CWj/U8fUmqvT3veWfkWY9kCN9lp2URJAT4uZwPkRr?= =?us-ascii?Q?hKL1m2VsIEpiHUHF5LFLK2b1oiUU0eXNKAKymIJPqYaLPhHs+xQK/iBx9UtL?= =?us-ascii?Q?orr32VJ/WYlHzkfScHLXOsqJGVOHdhl4hSopLPWbbI8JSgwhqzU3zektYwgg?= =?us-ascii?Q?0sIuY0S9vg5khizrdvr6Kfywjd+yxfVC/WjSJsr4f94ngLtMV5LtaLM/vM0p?= =?us-ascii?Q?EUWkdse6oULhInLCpUldgxQ8AIls/z2D4RVApyuv3lToGz81lWxWLQA3S/QX?= =?us-ascii?Q?Rnnp0KopNNrCJF34HW76kbyev9+9LGmMAfsIJ/O4bj89gq54TUQcihQjZGEH?= =?us-ascii?Q?aWX+vQrclKIApmZDmmfd9hr0IR3QkaoFqt/2jzc54zaBKxcji8gcGQG5w12L?= =?us-ascii?Q?NG+smpW/ro88wPl780mo5XNS0q3AVeo+b6lvROhz9XusmSNIwLT9fZJ3mrhB?= =?us-ascii?Q?qxG9gr8eRKKcBtEySGMeVBYUe+PH4sIY7FQLNi4xW4QNkSDcEAhZ/ccZazu3?= =?us-ascii?Q?Nu5zwjMhKmGncmgq19Ou8eVQTUY6p4CYxwjQ/ucmWG8LdvzzsStGHOylA97F?= =?us-ascii?Q?6iOLGh/KMUmKfxFxtsuZV/9uWdrR27OnrgTVXvdJ/qoWj4YZPe72ptvUc0Yh?= =?us-ascii?Q?XgdlQ1ZBIgUpBwtr+lkGg8I0sjY/LVt6ZMhHyXRtvrE0nZtgDZbOYa1Df0/N?= =?us-ascii?Q?FiwebIdbI7Gv60ycmlyfYqsau0caEuPXm5uSSouYaDD+T0DgWBvDOdpSS3H1?= =?us-ascii?Q?pb4US0w2LUp6vIfoIvHouS21tyV/F3l96FdkqdaeNzENcvZEPnT4DFsjFYBa?= =?us-ascii?Q?q24xHD2gApSwPvxCZ0XMH/e5yWkHl3NVLXenNej8J/w7vDQd01MbajtprFKn?= =?us-ascii?Q?+9sYZC80/Q=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: 4b5ee11f-f045-4f21-50d5-08da52a2ba3c X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jun 2022 09:53:28.8884 (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: 11fWsNgUgKwDJSmCPwJKAvCjomv92Yts4ri/TwJVLIdyhVthwDewNQ4LbjglyeiCRnDVPFVsNXb7+czUy6RDxQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB4163 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, June 20, 2022 11:38 AM > 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 >=20 > > -----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 > > > > 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 unmaps PCI device at secondary process uninitialization > > based on virtio_rempa_pci. > > > > Fixes: 36a7a2e7a53 ("net/virtio: move PCI device init in dedicated > > file") >=20 > This should be 12 digits, not 11 Thanks, will be fixed at the next version. Thanks, Yuan >=20 > With this fixed: >=20 > Reviewed-by: Chenbo Xia >=20 > > Cc: stable@dpdk.org > > > > Signed-off-by: Yuan Wang > > Tested-by: Wei Ling > > --- > > 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