From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 2871E11DE for ; Fri, 17 Mar 2017 06:51:15 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP; 16 Mar 2017 22:51:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,175,1486454400"; d="scan'208";a="1123882935" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga001.fm.intel.com with ESMTP; 16 Mar 2017 22:51:13 -0700 Date: Fri, 17 Mar 2017 13:49:28 +0800 From: Yuanhan Liu To: Maxime Coquelin Cc: dev@dpdk.org, Harris James R , Liu Changpeng Message-ID: <20170317054928.GE18844@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> <20170316073516.GQ18844@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Mar 2017 05:51:16 -0000 On Thu, Mar 16, 2017 at 10:22:27AM +0100, Maxime Coquelin wrote: > > > 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). Right, it will be "features_changed()" then. --yliu