interface: remove the pending interrupt from deleting interface

Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I3138f97519d216b89a9c46865271db1f9ddd53cd
This commit is contained in:
Mohsin Kazmi
2022-11-17 14:04:49 +00:00
committed by Beno�t Ganne
parent 1a9dc75fe8
commit 530c5ee1fe
2 changed files with 16 additions and 5 deletions

View File

@ -785,6 +785,10 @@ af_packet_delete_if (u8 *host_if_name)
/* bring down the interface */
vnet_hw_interface_set_flags (vnm, apif->hw_if_index, 0);
if (apif->mode != AF_PACKET_IF_MODE_IP)
ethernet_delete_interface (vnm, apif->hw_if_index);
else
vnet_delete_hw_interface (vnm, apif->hw_if_index);
/* clean up */
vec_foreach (rx_queue, apif->rx_queues)
@ -807,11 +811,6 @@ af_packet_delete_if (u8 *host_if_name)
mhash_unset (&apm->if_index_by_host_if_name, host_if_name, p);
if (apif->mode != AF_PACKET_IF_MODE_IP)
ethernet_delete_interface (vnm, apif->hw_if_index);
else
vnet_delete_hw_interface (vnm, apif->hw_if_index);
memset (apif, 0, sizeof (*apif));
pool_put (apm->interfaces, apif);

View File

@ -124,7 +124,10 @@ vnet_hw_if_unregister_all_rx_queues (vnet_main_t *vnm, u32 hw_if_index)
vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm, hw_if_index);
vnet_interface_main_t *im = &vnm->interface_main;
vnet_hw_if_rx_queue_t *rxq;
vlib_main_t *vm;
vnet_hw_if_rx_node_runtime_t *rt;
u64 key;
u32 queue_index;
log_debug ("unregister_all: interface %v", hi->name);
@ -132,6 +135,15 @@ vnet_hw_if_unregister_all_rx_queues (vnet_main_t *vnm, u32 hw_if_index)
{
rxq = vnet_hw_if_get_rx_queue (vnm, hi->rx_queue_indices[i]);
key = rx_queue_key (rxq->hw_if_index, rxq->queue_id);
if (PREDICT_FALSE (rxq->mode == VNET_HW_IF_RX_MODE_INTERRUPT ||
rxq->mode == VNET_HW_IF_RX_MODE_ADAPTIVE))
{
vm = vlib_get_main_by_index (rxq->thread_index);
queue_index = vnet_hw_if_get_rx_queue_index_by_id (vnm, hw_if_index,
rxq->queue_id);
rt = vlib_node_get_runtime_data (vm, hi->input_node_index);
clib_interrupt_clear (rt->rxq_interrupts, queue_index);
}
hash_unset_mem_free (&im->rxq_index_by_hw_if_index_and_queue_id, &key);
pool_put_index (im->hw_if_rx_queues, hi->rx_queue_indices[i]);