vhost: add device reset status
authorChenbo Xia <chenbo.xia@intel.com>
Mon, 10 Aug 2020 13:18:02 +0000 (13:18 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 18 Sep 2020 16:55:12 +0000 (18:55 +0200)
vhost lib now does not have definition of reset status. This patch
adds the reset status definition and changes related log.

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost.h
lib/librte_vhost/vhost_user.c

index 632f66d..73a1ed8 100644 (file)
@@ -239,6 +239,7 @@ struct vhost_virtqueue {
 } __rte_cache_aligned;
 
 /* Virtio device status as per Virtio specification */
+#define VIRTIO_DEVICE_STATUS_RESET             0x00
 #define VIRTIO_DEVICE_STATUS_ACK               0x01
 #define VIRTIO_DEVICE_STATUS_DRIVER            0x02
 #define VIRTIO_DEVICE_STATUS_DRIVER_OK         0x04
index c3c924f..501218e 100644 (file)
@@ -2531,6 +2531,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg,
        }
 
        VHOST_LOG_CONFIG(INFO, "New device status(0x%08x):\n"
+                       "\t-RESET: %u\n"
                        "\t-ACKNOWLEDGE: %u\n"
                        "\t-DRIVER: %u\n"
                        "\t-FEATURES_OK: %u\n"
@@ -2538,6 +2539,7 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg,
                        "\t-DEVICE_NEED_RESET: %u\n"
                        "\t-FAILED: %u\n",
                        dev->status,
+                       (dev->status == VIRTIO_DEVICE_STATUS_RESET),
                        !!(dev->status & VIRTIO_DEVICE_STATUS_ACK),
                        !!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER),
                        !!(dev->status & VIRTIO_DEVICE_STATUS_FEATURES_OK),