numam-dpdk/drivers/net/virtio/virtio_user
Jianfeng Tan 57ae79a75b net/virtio_user: fix wrong sequence of messages
When virtio_user is used with VPP's native vhost user, it cannot
send/receive any packets.

The root cause is that vpp-vhost-user translates the message
VHOST_USER_SET_FEATURES as puting this device into init state,
aka, zero all related structures. However, previous code
puts this message at last in the whole initialization process,
which leads to all previous information are zeroed.

To fix this issue, we rearrange the sequence of those messages.
  - step 0, send VHOST_USER_SET_VRING_CALL so that vhost allocates
    virtqueue structures;
  - step 1, send VHOST_USER_SET_FEATURES to confirm the features;
  - step 2, send VHOST_USER_SET_MEM_TABLE to share mem regions;
  - step 3, send VHOST_USER_SET_VRING_NUM, VHOST_USER_SET_VRING_BASE,
    VHOST_USER_SET_VRING_ADDR, VHOST_USER_SET_VRING_KICK for each
    queue;
  - ...

Fixes: 37a7eb2ae8 ("net/virtio-user: add device emulation layer")

Reported-by: Zhihong Wang <zhihong.wang@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-09-28 02:18:39 +02:00
..
vhost_user.c net/virtio-user: fix string overflow 2016-07-05 13:30:24 +02:00
vhost.h net/virtio-user: fix build with icc 2016-06-30 07:46:29 +02:00
virtio_user_dev.c net/virtio_user: fix wrong sequence of messages 2016-09-28 02:18:39 +02:00
virtio_user_dev.h net/virtio-user: add multiple queues in device emulation 2016-06-22 09:47:12 +02:00