#include <vnet/adj/adj_mcast.h>
#include <vnet/ip/ip.h>
#include <vnet/interface/rx_queue_funcs.h>
+#include <vnet/interface/tx_queue_funcs.h>
/* *INDENT-OFF* */
VLIB_REGISTER_LOG_CLASS (if_default_log, static) = {
r.type = VLIB_NODE_TYPE_INTERNAL;
r.runtime_data = &rt;
r.runtime_data_bytes = sizeof (rt);
- r.scalar_size = 0;
+ r.scalar_size = sizeof (vnet_hw_if_tx_frame_t);
r.vector_size = sizeof (u32);
r.flags = VLIB_NODE_FLAG_IS_OUTPUT;
static char *e[] = {
"interface is down",
"interface is deleted",
- "no buffers to segment GSO",
};
r.n_errors = ARRAY_LEN (e);
/* Call delete callbacks. */
call_hw_interface_add_del_callbacks (vnm, hw_if_index, /* is_create */ 0);
- /* delete rx queues */
+ /* delete rx & tx queues */
vnet_hw_if_unregister_all_rx_queues (vnm, hw_if_index);
+ vnet_hw_if_unregister_all_tx_queues (vnm, hw_if_index);
vnet_hw_if_update_runtime_data (vnm, hw_if_index);
/* Delete any sub-interfaces. */
im->rxq_index_by_hw_if_index_and_queue_id =
hash_create_mem (0, sizeof (u64), sizeof (u32));
+ im->txq_index_by_hw_if_index_and_queue_id =
+ hash_create_mem (0, sizeof (u64), sizeof (u32));
im->sw_if_index_by_sup_and_sub = hash_create_mem (0, sizeof (u64),
sizeof (uword));
{
}
else
{
- si->flags &= ~(VNET_SW_INTERFACE_FLAG_UNNUMBERED);
- si->unnumbered_sw_if_index = (u32) ~ 0;
+ /*
+ * Unless the interface is actually unnumbered, don't
+ * smash e.g. if_address_pool_index_by_sw_if_index
+ */
+ if (si->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED)
+ {
+ si->flags &= ~(VNET_SW_INTERFACE_FLAG_UNNUMBERED);
+ si->unnumbered_sw_if_index = (u32) ~0;
- ip4_main.lookup_main.if_address_pool_index_by_sw_if_index
- [unnumbered_sw_if_index] = ~0;
- ip6_main.lookup_main.if_address_pool_index_by_sw_if_index
- [unnumbered_sw_if_index] = ~0;
+ ip4_main.lookup_main
+ .if_address_pool_index_by_sw_if_index[unnumbered_sw_if_index] = ~0;
+ ip6_main.lookup_main
+ .if_address_pool_index_by_sw_if_index[unnumbered_sw_if_index] = ~0;
+ }
}
if (was_unnum != (si->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED))