From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <yuanhan.liu@linux.intel.com>
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id 7F0B71396
 for <dev@dpdk.org>; Thu, 16 Mar 2017 08:37:00 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=intel;
 t=1489649820; x=1521185820;
 h=date:from:to:cc:subject:message-id:references:
 mime-version:in-reply-to;
 bh=FatCm/Vao3Ou691EriHhyTb94pbk0Hb36uZRfAJ5xdE=;
 b=ATETTkxB4o1BAhyt0Cmwy8h/Jy/u6lifLFh7cQVLOgdJGB9xSBsKnnAf
 c9UHHuPyByCJQj3aWBxNlWhuuMh7MA==;
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 16 Mar 2017 00:36:59 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.36,170,1486454400"; d="scan'208";a="1123218508"
Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162])
 by fmsmga001.fm.intel.com with ESMTP; 16 Mar 2017 00:36:58 -0700
Date: Thu, 16 Mar 2017 15:35:16 +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: <20170316073516.GQ18844@yliu-dev.sh.intel.com>
References: <1488534682-3494-1-git-send-email-yuanhan.liu@linux.intel.com>
 <1488534682-3494-7-git-send-email-yuanhan.liu@linux.intel.com>
 <c220e842-dad4-0430-175b-f98c5b5a24e0@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <c220e842-dad4-0430-175b-f98c5b5a24e0@redhat.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
Subject: Re: [dpdk-dev] [PATCH 06/17] 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: Thu, 16 Mar 2017 07:37:01 -0000

On Tue, Mar 14, 2017 at 12:02:59PM +0100, Maxime Coquelin wrote:
> >+uint64_t
> >+rte_vhost_get_negotiated_features(int vid)
> >+{
> >+	struct virtio_net *dev;
> >+
> >+	dev = get_device(vid);
> >+	if (!dev)
> >+		return -1;
> >+
> >+	return dev->features;
> >+}
> Are we sure the negotiation is done when we can get the device?

Yes. However, one thing worth noting is that the features may change
after the new_device() callback. Notablely, when live migration starts
/ends, the VHOST_F_LOG_ALL will be set/cleared, respectively.

>>From that point of view, we need a new callback, something like
features_changed(), or live_migration_starts()? Or a better name?

	--yliu