net/virtio-user: add mrg-rxbuf and in-order vdev parameters
[dpdk.git] / drivers / net / virtio / virtio_user / virtio_user_dev.c
index e0e9568..953c460 100644 (file)
@@ -375,7 +375,8 @@ virtio_user_dev_setup(struct virtio_user_dev *dev)
 
 int
 virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
-                    int cq, int queue_size, const char *mac, char **ifname)
+                    int cq, int queue_size, const char *mac, char **ifname,
+                    int mrg_rxbuf, int in_order)
 {
        pthread_mutex_init(&dev->mutex, NULL);
        snprintf(dev->path, PATH_MAX, "%s", path);
@@ -420,6 +421,16 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
                dev->device_features = VIRTIO_USER_SUPPORTED_FEATURES;
        }
 
+       if (!mrg_rxbuf) {
+               dev->device_features &= ~(1ull << VIRTIO_NET_F_MRG_RXBUF);
+               dev->unsupported_features |= (1ull << VIRTIO_NET_F_MRG_RXBUF);
+       }
+
+       if (!in_order) {
+               dev->device_features &= ~(1ull << VIRTIO_F_IN_ORDER);
+               dev->unsupported_features |= (1ull << VIRTIO_F_IN_ORDER);
+       }
+
        if (dev->mac_specified) {
                dev->device_features |= (1ull << VIRTIO_NET_F_MAC);
        } else {