octeon: fix buffer free on full tx ring 25/40625/2
authorDamjan Marion <damarion@cisco.com>
Sat, 30 Mar 2024 13:56:51 +0000 (14:56 +0100)
committerMohammed HAWARI <momohawari@gmail.com>
Fri, 5 Apr 2024 16:00:41 +0000 (16:00 +0000)
Type: fix
Fixes: 01fe7ab
Change-Id: I4419107c4bcb7f85b76addfc62178b6e75e10a52
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/plugins/dev_octeon/tx_node.c

index 5deaa82..28e8f25 100644 (file)
@@ -392,11 +392,11 @@ VNET_DEV_NODE_FN (oct_tx_node)
 
   if (n < n_pkts)
     {
-      n = n_pkts - n;
-      vlib_buffer_free (vm, from + n, n);
+      u32 n_free = n_pkts - n;
+      vlib_buffer_free (vm, from + n, n_free);
       vlib_error_count (vm, node->node_index, OCT_TX_NODE_CTR_NO_FREE_SLOTS,
-                       n);
-      n_pkts -= ctx.n_drop;
+                       n_free);
+      n_pkts -= n_free;
     }
 
   if (ctx.n_drop)