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;
/* If a tag was supplied... */
if (vl_api_string_len (&mp->tag))
{
- u8 *tag = format (0, "%s%c", vl_api_from_api_string (&mp->tag), 0);
+ u8 *tag = vl_api_from_api_to_new_vec (&mp->tag);
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;
rv = tap_delete_if (vm, sw_if_index);
-
-
rmp = vl_msg_api_alloc (sizeof (*rmp));
rmp->_vl_msg_id = ntohs (VL_API_TAP_DELETE_V2_REPLY);
rmp->context = mp->context;
return;
filter_sw_if_index = htonl (mp->sw_if_index);
- if (filter_sw_if_index != ~0)
- return; /* UNIMPLEMENTED */
+ if (mp->sw_if_index != ~0)
+ VALIDATE_SW_IF_INDEX (mp);
rv = tap_dump_ifs (&tapifs);
if (rv)
vec_foreach (tap_if, tapifs)
{
- tap_send_sw_interface_details (am, reg, tap_if, mp->context);
+ if ((filter_sw_if_index == ~0)
+ || (tap_if->sw_if_index == filter_sw_if_index))
+ tap_send_sw_interface_details (am, reg, tap_if, mp->context);
}
-
+ BAD_SW_IF_INDEX_LABEL;
vec_free (tapifs);
}