From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <yuanhan.liu@linux.intel.com>
Received: from mga09.intel.com (mga09.intel.com [134.134.136.24])
 by dpdk.org (Postfix) with ESMTP id 0C657FE5
 for <dev@dpdk.org>; Fri, 31 Mar 2017 10:54:24 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=intel;
 t=1490950465; x=1522486465;
 h=date:from:to:cc:subject:message-id:references:
 mime-version:in-reply-to;
 bh=/snWmsYCHC05tez4CTirHx2Qyk3i+hLoN32WLfF07gw=;
 b=M2ioJ0dqJKEmTQI5kj3vn9/a+vVQy0uITm3RlkGY3dhIJ6l4PkzKUH4M
 prK6s42OC85DmmN3kFvVa/XnWQoJGA==;
Received: from fmsmga006.fm.intel.com ([10.253.24.20])
 by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 31 Mar 2017 01:54:23 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.36,251,1486454400"; d="scan'208";a="83033943"
Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162])
 by fmsmga006.fm.intel.com with ESMTP; 31 Mar 2017 01:54:22 -0700
Date: Fri, 31 Mar 2017 16:51:51 +0800
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: dev@dpdk.org, Harris James R <james.r.harris@intel.com>,
 Liu Changpeng <changpeng.liu@intel.com>
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>
 <be90a3db-1e87-de9c-803b-d4ba5cea3602@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <be90a3db-1e87-de9c-803b-d4ba5cea3602@redhat.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
Subject: Re: [dpdk-dev] [PATCH v3 06/22] vhost: introduce API to fetch
 negotiated features
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 31 Mar 2017 08:54:25 -0000

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