aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-02-14 12:09:04 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-03-27 14:29:08 +0000
commita8e2c583e2cc7610a43c1b0e07c928519b7d619c (patch)
treeb2fa228a9e9a7fbbd1095c4d26e8452e63e58beb /src/vnet
parent9bf616ca8973bc543b34b2f7eebdc770400dd615 (diff)
tap: fix the default parameter for num_rx_queues
Type: fix Change-Id: I1a20fea56f1ba1fada7c7ce96ea333bf097b1273 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> (cherry picked from commit 9f32b6acada965d61236fd112445297fc22b60c7)
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/devices/tap/tapv2_api.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/vnet/devices/tap/tapv2_api.c b/src/vnet/devices/tap/tapv2_api.c
index 1f1e18a7b6e..e0121a83c2f 100644
--- a/src/vnet/devices/tap/tapv2_api.c
+++ b/src/vnet/devices/tap/tapv2_api.c
@@ -77,15 +77,10 @@ vl_api_tap_create_v2_t_handler (vl_api_tap_create_v2_t * mp)
ap->rx_ring_sz = ntohs (mp->rx_ring_sz);
ap->tx_ring_sz = ntohs (mp->tx_ring_sz);
ap->sw_if_index = (u32) ~ 0;
+ ap->num_rx_queues = 1;
- if (mp->num_rx_queues < 1)
- {
- ap->rv = VNET_API_ERROR_INVALID_ARGUMENT;
- ap->sw_if_index = ~0;
- goto done;
- }
-
- ap->num_rx_queues = mp->num_rx_queues;
+ if (mp->num_rx_queues > 1)
+ ap->num_rx_queues = mp->num_rx_queues;
if (mp->host_if_name_set)
ap->host_if_name = mp->host_if_name;
@@ -143,7 +138,6 @@ vl_api_tap_create_v2_t_handler (vl_api_tap_create_v2_t * mp)
vnet_set_sw_interface_tag (vnm, tag, ap->sw_if_index);
}
-done:
rmp = vl_msg_api_alloc (sizeof (*rmp));
rmp->_vl_msg_id = ntohs (VL_API_TAP_CREATE_V2_REPLY);
rmp->context = mp->context;