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 5FC88A054F; Tue, 18 Feb 2020 16:27:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 41C0F1C0B2; Tue, 18 Feb 2020 16:27:15 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1BF551C0B0 for ; Tue, 18 Feb 2020 16:27:13 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Feb 2020 07:27:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,456,1574150400"; d="scan'208";a="435878736" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 18 Feb 2020 07:27:13 -0800 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Feb 2020 07:27:12 -0800 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by SHSMSX602.ccr.corp.intel.com (10.109.6.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 18 Feb 2020 23:27:10 +0800 Received: from shsmsx603.ccr.corp.intel.com ([10.109.6.143]) by SHSMSX603.ccr.corp.intel.com ([10.109.6.143]) with mapi id 15.01.1713.004; Tue, 18 Feb 2020 23:27:10 +0800 From: "Wang, Yinan" To: Maxime Coquelin , "dev@dpdk.org" , "oda@valinux.co.jp" , "Bie, Tiwei" , "amorenoz@redhat.com" Thread-Topic: [PATCH 2/2] net/vhost: prevent multiple setup on reconfig Thread-Index: AQHV5mi12KH8ZmNOc0K6XhglhZuubKghEuJA Date: Tue, 18 Feb 2020 15:27:10 +0000 Message-ID: <3aa84fab91654697b594ef3316ac32b5@intel.com> References: <20200218143514.553307-1-maxime.coquelin@redhat.com> <20200218143514.553307-3-maxime.coquelin@redhat.com> In-Reply-To: <20200218143514.553307-3-maxime.coquelin@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 2/2] net/vhost: prevent multiple setup on reconfig 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" Tested-by: Yinan Wang > -----Original Message----- > From: Maxime Coquelin > Sent: 2020=1B$BG/=1B(B2=1B$B7n=1B(B18=1B$BF|=1B(B 22:35 > To: dev@dpdk.org; oda@valinux.co.jp; Wang, Yinan ; > Bie, Tiwei ; amorenoz@redhat.com > Cc: Maxime Coquelin > Subject: [PATCH 2/2] net/vhost: prevent multiple setup on reconfig >=20 > Ethdev's .dev_configure callback can be called multiple time during a dev= ice > life-time, but Vhost makes the wrong assumption that it is not the case a= nd try > to setup again the device on reconfiguration. >=20 > This patch ensures the device hasn't been already setup before proceeding= . >=20 > Fixes: 3d01b759d267 ("net/vhost: delay driver setup") >=20 > Reported-by: Yinan Wang > Signed-off-by: Maxime Coquelin > --- > drivers/net/vhost/rte_eth_vhost.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/drivers/net/vhost/rte_eth_vhost.c > b/drivers/net/vhost/rte_eth_vhost.c > index c0056bc8bf..c4643da120 100644 > --- a/drivers/net/vhost/rte_eth_vhost.c > +++ b/drivers/net/vhost/rte_eth_vhost.c > @@ -876,6 +876,11 @@ vhost_driver_setup(struct rte_eth_dev *eth_dev) > unsigned int numa_node =3D eth_dev->device->numa_node; > const char *name =3D eth_dev->device->name; >=20 > + /* Don't try to setup again if it has already been done. */ > + list =3D find_internal_resource(internal->iface_name); > + if (list) > + return 0; > + > list =3D rte_zmalloc_socket(name, sizeof(*list), 0, numa_node); > if (list =3D=3D NULL) > return -1; > -- > 2.24.1