- vnet_interface_main_t *im = &vnm->interface_main;
-
- hw_if_index = gm->free_gre_tunnel_hw_if_indices[t->type]
- [vec_len (gm->free_gre_tunnel_hw_if_indices[t->type]) - 1];
- _vec_len (gm->free_gre_tunnel_hw_if_indices[t->type]) -= 1;
-
- hi = vnet_get_hw_interface (vnm, hw_if_index);
- hi->dev_instance = t - gm->tunnels;
- hi->hw_instance = hi->dev_instance;
-
- /* clear old stats of freed tunnel before reuse */
- sw_if_index = hi->sw_if_index;
- vnet_interface_counter_lock (im);
- vlib_zero_combined_counter
- (&im->combined_sw_if_counters[VNET_INTERFACE_COUNTER_TX],
- sw_if_index);
- vlib_zero_combined_counter (&im->combined_sw_if_counters
- [VNET_INTERFACE_COUNTER_RX], sw_if_index);
- vlib_zero_simple_counter (&im->sw_if_counters
- [VNET_INTERFACE_COUNTER_DROP], sw_if_index);
- vnet_interface_counter_unlock (im);
- if (GRE_TUNNEL_TYPE_TEB == t->type)
- {
- t->l2_tx_arc = vlib_node_add_named_next (vlib_get_main (),
- hi->tx_node_index,
- "adj-l2-midchain");
- }