summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/devices/virtio/vhost_user.api6
-rw-r--r--src/vnet/devices/virtio/vhost_user_api.c12
2 files changed, 16 insertions, 2 deletions
diff --git a/src/vnet/devices/virtio/vhost_user.api b/src/vnet/devices/virtio/vhost_user.api
index ccaa87cf0ce..c745b3d616b 100644
--- a/src/vnet/devices/virtio/vhost_user.api
+++ b/src/vnet/devices/virtio/vhost_user.api
@@ -13,13 +13,15 @@
* limitations under the License.
*/
-option version = "1.0.0";
+option version = "2.0.0";
/** \brief vhost-user interface create request
@param client_index - opaque cookie to identify the sender
@param is_server - our side is socket server
@param sock_filename - unix socket filename, used to speak with frontend
@param use_custom_mac - enable or disable the use of the provided hardware address
+ @param disable_mrg_rxbuf - disable the use of merge receive buffers
+ @param disable_indirect_desc - disable the use of indirect descriptors which driver can use
@param mac_address - hardware address to use if 'use_custom_mac' is set
*/
define create_vhost_user_if
@@ -29,6 +31,8 @@ define create_vhost_user_if
u8 is_server;
u8 sock_filename[256];
u8 renumber;
+ u8 disable_mrg_rxbuf;
+ u8 disable_indirect_desc;
u32 custom_dev_instance;
u8 use_custom_mac;
u8 mac_address[6];
diff --git a/src/vnet/devices/virtio/vhost_user_api.c b/src/vnet/devices/virtio/vhost_user_api.c
index 59dba252f22..016ccbd2687 100644
--- a/src/vnet/devices/virtio/vhost_user_api.c
+++ b/src/vnet/devices/virtio/vhost_user_api.c
@@ -76,9 +76,19 @@ vl_api_create_vhost_user_if_t_handler (vl_api_create_vhost_user_if_t * mp)
u32 sw_if_index = (u32) ~ 0;
vnet_main_t *vnm = vnet_get_main ();
vlib_main_t *vm = vlib_get_main ();
+ u64 features = (u64) ~ (0ULL);
+ u64 disabled_features = (u64) (0ULL);
+
+ if (mp->disable_mrg_rxbuf)
+ disabled_features = (1ULL << FEAT_VIRTIO_NET_F_MRG_RXBUF);
+
+ if (mp->disable_indirect_desc)
+ disabled_features |= (1ULL << FEAT_VIRTIO_F_INDIRECT_DESC);
+
+ features &= ~disabled_features;
rv = vhost_user_create_if (vnm, vm, (char *) mp->sock_filename,
- mp->is_server, &sw_if_index, (u64) ~ 0,
+ mp->is_server, &sw_if_index, features,
mp->renumber, ntohl (mp->custom_dev_instance),
(mp->use_custom_mac) ? mp->mac_address : NULL);