avf: free spinlock on txq removal 36/32336/3
authorDamjan Marion <damarion@cisco.com>
Fri, 14 May 2021 13:26:53 +0000 (15:26 +0200)
committerFlorin Coras <florin.coras@gmail.com>
Fri, 14 May 2021 15:46:50 +0000 (15:46 +0000)
Type: fix
Change-Id: I8e9a907a227f82b870a945b94731dc3204c23ee1
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/plugins/avf/device.c

index 05946a4..28fe0a4 100644 (file)
@@ -304,6 +304,7 @@ avf_txq_init (vlib_main_t * vm, avf_device_t * ad, u16 qid, u16 txq_size)
     {
       qid = qid % ad->num_queue_pairs;
       txq = vec_elt_at_index (ad->txqs, qid);
+      ASSERT (txq->lock == 0);
       clib_spinlock_init (&txq->lock);
       ad->flags |= AVF_DEVICE_F_SHARED_TXQ_LOCK;
       return 0;
@@ -1529,6 +1530,7 @@ avf_delete_if (vlib_main_t * vm, avf_device_t * ad, int with_barrier)
       clib_ring_free (txq->rs_slots);
       vec_free (txq->tmp_bufs);
       vec_free (txq->tmp_descs);
+      clib_spinlock_free (&txq->lock);
     }
   /* *INDENT-ON* */
   vec_free (ad->txqs);