From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <maxime.coquelin@redhat.com>
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28])
 by dpdk.org (Postfix) with ESMTP id 244141075
 for <dev@dpdk.org>; Thu, 16 Mar 2017 10:22:34 +0100 (CET)
Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com
 [10.5.11.14])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.redhat.com (Postfix) with ESMTPS id 3DDBA1C13C2;
 Thu, 16 Mar 2017 09:22:34 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3DDBA1C13C2
Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com;
 dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com;
 spf=pass smtp.mailfrom=maxime.coquelin@redhat.com
DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3DDBA1C13C2
Received: from [10.36.116.177] (ovpn-116-177.ams2.redhat.com [10.36.116.177])
 by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C7585DC1D;
 Thu, 16 Mar 2017 09:22:32 +0000 (UTC)
To: Yuanhan Liu <yuanhan.liu@linux.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>
 <20170316073516.GQ18844@yliu-dev.sh.intel.com>
Cc: dev@dpdk.org, Harris James R <james.r.harris@intel.com>,
 Liu Changpeng <changpeng.liu@intel.com>
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Message-ID: <de40ac38-a79a-6154-a39d-c5ed6804ec6b@redhat.com>
Date: Thu, 16 Mar 2017 10:22:27 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <20170316073516.GQ18844@yliu-dev.sh.intel.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
 (mx1.redhat.com [10.5.110.29]); Thu, 16 Mar 2017 09:22:34 +0000 (UTC)
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 09:22:34 -0000



On 03/16/2017 08:35 AM, Yuanhan Liu wrote:
> 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.

Good point.

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

I would name it features_changed() to be future-proof (even if I don't
foresee other cases than live migration right now).

Thanks,
Maxime