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 825EDA04F6 for ; Tue, 17 Dec 2019 02:21:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 551BB2B96; Tue, 17 Dec 2019 02:21:32 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 592B3330; Tue, 17 Dec 2019 02:21:29 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Dec 2019 17:21:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,323,1571727600"; d="scan'208";a="416653418" Received: from dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.74]) by fmsmga006.fm.intel.com with ESMTP; 16 Dec 2019 17:21:27 -0800 Date: Tue, 17 Dec 2019 09:21:45 +0800 From: Tiwei Bie To: wangyunjian Cc: "dev@dpdk.org" , "maxime.coquelin@redhat.com" , "zhihong.wang@intel.com" , xudingke , "stable@dpdk.org" Message-ID: <20191217012145.GA211317@___> References: <1576458359-13848-1-git-send-email-wangyunjian@huawei.com> <20191216053315.GA133010@___> <34EFBCA9F01B0748BEB6B629CE643AE60CDB8DA7@DGGEMM533-MBX.china.huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <34EFBCA9F01B0748BEB6B629CE643AE60CDB8DA7@DGGEMM533-MBX.china.huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-stable] [PATCH] net/vhost: fix return value of vhost creates not checked X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Mon, Dec 16, 2019 at 06:38:28AM +0000, wangyunjian wrote: > > -----Original Message----- > > From: Tiwei Bie [mailto:tiwei.bie@intel.com] > > Sent: Monday, December 16, 2019 1:33 PM > > To: wangyunjian > > Cc: dev@dpdk.org; maxime.coquelin@redhat.com; zhihong.wang@intel.com; > > xudingke ; stable@dpdk.org > > Subject: Re: [PATCH] net/vhost: fix return value of vhost creates not checked > > > > On Mon, Dec 16, 2019 at 09:05:59AM +0800, Yunjian Wang wrote: > > > The function eth_dev_vhost_create() could return errors, the return > > > value need to be checked. > > > > > > Fixes: ee584e9710b9 ("vhost: add driver on top of the library") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Yunjian Wang > > > --- > > > drivers/net/vhost/rte_eth_vhost.c | 6 ++++-- > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/net/vhost/rte_eth_vhost.c > > > b/drivers/net/vhost/rte_eth_vhost.c > > > index 46f01a7..7e4faf2 100644 > > > --- a/drivers/net/vhost/rte_eth_vhost.c > > > +++ b/drivers/net/vhost/rte_eth_vhost.c > > > @@ -1455,8 +1455,10 @@ struct vhost_xstats_name_off { > > > if (dev->device.numa_node == SOCKET_ID_ANY) > > > dev->device.numa_node = rte_socket_id(); > > > > > > - eth_dev_vhost_create(dev, iface_name, queues, dev->device.numa_node, > > > - flags, disable_flags); > > > + ret = eth_dev_vhost_create(dev, iface_name, queues, > > > + dev->device.numa_node, flags, disable_flags); > > > + if (ret == -1) > > > + VHOST_LOG(ERR, "Failed to create %s", name); > > > > This will set "ret" to port id on success, but we shouldn't return port id in > > probe. > > OK, I agree. How about function eth_dev_vhost_create can return 0 on success? Sounds good to me. > > Thanks > Yunjian > > > > > > > > > out_free: > > > rte_kvargs_free(kvlist); > > > -- > > > 1.8.3.1 > > > > > >