vhost: rework async configuration structure
[dpdk.git] / lib / vhost / vhost.c
index 3f82d3f..b6e78bb 100644 (file)
@@ -1619,19 +1619,17 @@ int rte_vhost_extern_callback_register(int vid,
        return 0;
 }
 
-int rte_vhost_async_channel_register(int vid, uint16_t queue_id,
-                                       uint32_t features,
-                                       struct rte_vhost_async_channel_ops *ops)
+int
+rte_vhost_async_channel_register(int vid, uint16_t queue_id,
+               struct rte_vhost_async_config config,
+               struct rte_vhost_async_channel_ops *ops)
 {
        struct vhost_virtqueue *vq;
        struct virtio_net *dev = get_device(vid);
-       struct rte_vhost_async_features f;
 
        if (dev == NULL || ops == NULL)
                return -1;
 
-       f.intval = features;
-
        if (queue_id >= VHOST_MAX_VRING)
                return -1;
 
@@ -1640,7 +1638,7 @@ int rte_vhost_async_channel_register(int vid, uint16_t queue_id,
        if (unlikely(vq == NULL || !dev->async_copy))
                return -1;
 
-       if (unlikely(!f.async_inorder)) {
+       if (unlikely(!(config.features & RTE_VHOST_ASYNC_INORDER))) {
                VHOST_LOG_CONFIG(ERR,
                        "async copy is not supported on non-inorder mode "
                        "(vid %d, qid: %d)\n", vid, queue_id);
@@ -1719,9 +1717,7 @@ int rte_vhost_async_channel_register(int vid, uint16_t queue_id,
 
        vq->async_ops.check_completed_copies = ops->check_completed_copies;
        vq->async_ops.transfer_data = ops->transfer_data;
-
-       vq->async_inorder = f.async_inorder;
-       vq->async_threshold = f.async_threshold;
+       vq->async_threshold = config.async_threshold;
 
        vq->async_registered = true;
 
@@ -1731,7 +1727,8 @@ reg_out:
        return 0;
 }
 
-int rte_vhost_async_channel_unregister(int vid, uint16_t queue_id)
+int
+rte_vhost_async_channel_unregister(int vid, uint16_t queue_id)
 {
        struct vhost_virtqueue *vq;
        struct virtio_net *dev = get_device(vid);