From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v3 06/22] vhost: introduce API to fetch negotiated features Date: Fri, 31 Mar 2017 16:51:51 +0800 Message-ID: <20170331085151.GN18844@yliu-dev.sh.intel.com> References: <1490253059-28112-1-git-send-email-yuanhan.liu@linux.intel.com> <1490705142-893-1-git-send-email-yuanhan.liu@linux.intel.com> <1490705142-893-7-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, Harris James R , Liu Changpeng To: Maxime Coquelin Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 0C657FE5 for ; Fri, 31 Mar 2017 10:54:24 +0200 (CEST) Content-Disposition: inline In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Mar 31, 2017 at 09:45:11AM +0200, Maxime Coquelin wrote: > >+uint64_t > >+rte_vhost_get_negotiated_features(int vid) > >+{ > >+ struct virtio_net *dev; > >+ > >+ dev = get_device(vid); > >+ if (!dev) > >+ return 0; > It's unlikely to happen with net devices, but as this series is about > generalizing the use of this lib, couldn't we have cases where the > negotiated features is 0? Yes, I think so. > If so, shouldn't be preferable the caller passes features pointer as > argument? I thought of that. The reason I did that is to keep the semantics with rte_vhost_driver_get_feature(path). But you are right, we don't have to follow that. More importantly, we may also need change the return value of rte_vhost_driver_get_features(path): which could also fail if 'path' is not found. --yliu