From a94563e12801ae2a3d69921d205dfd117caeae5b Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Tue, 5 Apr 2022 11:23:17 +0000 Subject: devices: fix the received blocks counters Type: fix Signed-off-by: Mohsin Kazmi Change-Id: If7d9c94dcdc32fa66763e18bd3be7d28b2d17946 --- src/vnet/devices/af_packet/node.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/vnet') diff --git a/src/vnet/devices/af_packet/node.c b/src/vnet/devices/af_packet/node.c index 631bbac1117..239c781a76f 100644 --- a/src/vnet/devices/af_packet/node.c +++ b/src/vnet/devices/af_packet/node.c @@ -268,11 +268,6 @@ af_packet_device_input_fn (vlib_main_t *vm, vlib_node_runtime_t *node, 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 @@ af_packet_device_input_fn (vlib_main_t *vm, vlib_node_runtime_t *node, { 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); -- cgit 1.2.3-korg