devices: fix the received blocks counters
Type: fix
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: If7d9c94dcdc32fa66763e18bd3be7d28b2d17946
diff --git a/src/vnet/devices/af_packet/node.c b/src/vnet/devices/af_packet/node.c
index 631bbac..239c781 100644
--- a/src/vnet/devices/af_packet/node.c
+++ b/src/vnet/devices/af_packet/node.c
@@ -268,11 +268,6 @@
u32 n_required = 0;
bd = (block_desc_t *) block_start;
- total++;
-
- if (TP_STATUS_BLK_TMO & bd->hdr.bh1.block_status)
- timedout_blk++;
-
if (PREDICT_FALSE (rx_queue->is_rx_pending))
{
num_pkts = rx_queue->num_rx_pkts;
@@ -283,6 +278,10 @@
{
num_pkts = bd->hdr.bh1.num_pkts;
rx_frame_offset = sizeof (block_desc_t);
+ total++;
+
+ if (TP_STATUS_BLK_TMO & bd->hdr.bh1.block_status)
+ timedout_blk++;
}
n_required = clib_max (num_pkts, VLIB_FRAME_SIZE);