af_packet: update tx_frame even when ring exhausted 09/9609/4
authorFlorin Coras <fcoras@cisco.com>
Tue, 28 Nov 2017 19:59:20 +0000 (11:59 -0800)
committerDamjan Marion <dmarion.lists@gmail.com>
Thu, 30 Nov 2017 08:39:52 +0000 (08:39 +0000)
Change-Id: I2fde74b53d6b4dc54d4af7020130f7b22463d70f
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/devices/af_packet/device.c

index e01b1c7..b9492b3 100644 (file)
@@ -132,11 +132,11 @@ af_packet_interface_tx (vlib_main_t * vm,
       tph->tp_status = TP_STATUS_SEND_REQUEST;
       n_sent++;
     next:
+      tx_frame = (tx_frame + 1) % frame_num;
+
       /* check if we've exhausted the ring */
       if (PREDICT_FALSE (frame_not_ready + n_sent == frame_num))
        break;
-
-      tx_frame = (tx_frame + 1) % frame_num;
     }
 
   CLIB_MEMORY_BARRIER ();