vhost: support async dequeue for split ring
[dpdk.git] / lib / vhost / socket.c
index ad3471d..baf6c33 100644 (file)
@@ -8,7 +8,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/queue.h>
@@ -43,6 +42,7 @@ struct vhost_user_socket {
        bool linearbuf;
        bool async_copy;
        bool net_compliant_ol_flags;
+       bool stats_enabled;
 
        /*
         * The "supported_features" indicates the feature bits the
@@ -228,7 +228,7 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)
        vhost_set_ifname(vid, vsocket->path, size);
 
        vhost_setup_virtio_net(vid, vsocket->use_builtin_virtio_net,
-               vsocket->net_compliant_ol_flags);
+               vsocket->net_compliant_ol_flags, vsocket->stats_enabled);
 
        vhost_attach_vdpa_device(vid, vsocket->vdpa_dev);
 
@@ -864,12 +864,13 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
        vsocket->linearbuf = flags & RTE_VHOST_USER_LINEARBUF_SUPPORT;
        vsocket->async_copy = flags & RTE_VHOST_USER_ASYNC_COPY;
        vsocket->net_compliant_ol_flags = flags & RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS;
+       vsocket->stats_enabled = flags & RTE_VHOST_USER_NET_STATS_ENABLE;
 
        if (vsocket->async_copy &&
                (flags & (RTE_VHOST_USER_IOMMU_SUPPORT |
                RTE_VHOST_USER_POSTCOPY_SUPPORT))) {
-               VHOST_LOG_CONFIG(ERR, "(%s) enabling async copy and IOMMU "
-                       "or post-copy feature simultaneously is not supported\n", path);
+               VHOST_LOG_CONFIG(ERR, "(%s) async copy with IOMMU or post-copy not supported\n",
+                               path);
                goto out_mutex;
        }
 
@@ -908,8 +909,10 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
                                (1ULL << VIRTIO_NET_F_HOST_TSO6) |
                                (1ULL << VIRTIO_NET_F_HOST_UFO);
 
-               VHOST_LOG_CONFIG(INFO, "(%s) Linear buffers requested without external buffers, "
-                       "disabling host segmentation offloading support\n", path);
+               VHOST_LOG_CONFIG(INFO, "(%s) Linear buffers requested without external buffers,\n",
+                               path);
+               VHOST_LOG_CONFIG(INFO, "(%s) disabling host segmentation offloading support\n",
+                               path);
                vsocket->supported_features &= ~seg_offload_features;
                vsocket->features &= ~seg_offload_features;
        }