From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH] vhost: maintain separate virtio features field Date: Wed, 28 Mar 2018 10:53:45 +0200 Message-ID: <4959889e-28ab-8cdd-c97f-a24689c1d400@redhat.com> References: <20180305154909.216-1-tomaszx.kulasek@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, Dariusz Stojaczyk To: Tomasz Kulasek , yliu@fridaylinux.org Return-path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id D15E42BA5 for ; Wed, 28 Mar 2018 10:53:48 +0200 (CEST) In-Reply-To: <20180305154909.216-1-tomaszx.kulasek@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Tomasz, On 03/05/2018 04:49 PM, Tomasz Kulasek wrote: > There are two separate abstraction layers: > * vsocket - which represents a unix domain socket > * virtio_net - which represents a vsocket connection > > There can be many connections on the same socket. vsocket provides an > API to enable/disable particular virtio features on the fly, but it's > the virtio_net that uses these features. > > virtio_net used to rely on vsocket->features during feature negotiation, > breaking the layer encapsulation (and yet causing a deadlock - two locks > were being locked in a separate order). Now each virtio_net device has > it's own copy of vsocket features, created at the time of virtio_net > creation. > > vsocket->features have to be still present, as features can be > enabled/disabled while no virtio_net device has been created yet. > > Signed-off-by: Dariusz Stojaczyk > Signed-off-by: Tomasz Kulasek > --- > lib/librte_vhost/socket.c | 2 +- > lib/librte_vhost/vhost.c | 9 +++++---- > lib/librte_vhost/vhost.h | 8 +++++--- > lib/librte_vhost/vhost_user.c | 33 +++++++++++++++++---------------- > 4 files changed, 28 insertions(+), 24 deletions(-) Thanks for the patch. I think it is valid, but I would prefer we create a .backend_features field to represent the features that the backend supports, and keep .features for the negotiated features. Do you agree to re-post with this change? Thanks, Maxime