aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2022-04-05 11:23:17 +0000
committerBeno�t Ganne <bganne@cisco.com>2022-04-05 14:16:51 +0000
commita94563e12801ae2a3d69921d205dfd117caeae5b (patch)
tree2e76a532b17d1cd59af92cc7823f0f552ee1bb70 /src/vnet
parentfd78a1f65b3e698b0e99f29584b060750b89bdab (diff)
devices: fix the received blocks counters
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: If7d9c94dcdc32fa66763e18bd3be7d28b2d17946
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/devices/af_packet/node.c9
1 files changed, 4 insertions, 5 deletions
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);