From: Florin Coras Date: Tue, 28 Nov 2017 19:59:20 +0000 (-0800) Subject: af_packet: update tx_frame even when ring exhausted X-Git-Tag: v18.04-rc0~142 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=837503cf66c432355b37db842ac5b0ee37c18085;p=vpp.git af_packet: update tx_frame even when ring exhausted Change-Id: I2fde74b53d6b4dc54d4af7020130f7b22463d70f Signed-off-by: Florin Coras --- diff --git a/src/vnet/devices/af_packet/device.c b/src/vnet/devices/af_packet/device.c index e01b1c71b32..b9492b36a69 100644 --- a/src/vnet/devices/af_packet/device.c +++ b/src/vnet/devices/af_packet/device.c @@ -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 ();