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 <dariuszx.stojac...@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kula...@intel.com>
---
  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

Reply via email to