memif: fix the memif crash when slave disconnect 39/34039/2
authorMohsin Kazmi <sykazmi@cisco.com>
Mon, 11 Oct 2021 15:43:15 +0000 (15:43 +0000)
committerDamjan Marion <dmarion@me.com>
Tue, 12 Oct 2021 13:09:32 +0000 (13:09 +0000)
Type: fix

Fixes: 3effb4e63068 ("memif: integrate with new tx infra")

memif is recently integrated with new tx infra. But it
introduces a crash when slave disconnect from master but
interface is not deleted. Disconnect routine was missing
unregister of all tx queues. This patch fixes it.

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I81c59cc1a03561248ec8595d5e3caa54f421833e

src/plugins/memif/memif.c

index 55d9b84..886721a 100644 (file)
@@ -147,7 +147,6 @@ memif_disconnect (memif_if_t * mif, clib_error_t * err)
        }
     }
   vnet_hw_if_unregister_all_rx_queues (vnm, mif->hw_if_index);
-  vnet_hw_if_update_runtime_data (vnm, mif->hw_if_index);
 
   /* *INDENT-OFF* */
   vec_foreach_index (i, mif->tx_queues)
@@ -163,6 +162,8 @@ memif_disconnect (memif_if_t * mif, clib_error_t * err)
     }
     mq->ring = 0;
   }
+  vnet_hw_if_unregister_all_tx_queues (vnm, mif->hw_if_index);
+  vnet_hw_if_update_runtime_data (vnm, mif->hw_if_index);
 
   /* free tx and rx queues */
   vec_foreach (mq, mif->rx_queues)