aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/memif
diff options
context:
space:
mode:
authorLiangxing Wang <liangxing.wang@arm.com>2023-01-13 05:19:47 +0000
committerDamjan Marion <dmarion@0xa5.net>2023-03-06 17:13:48 +0000
commitf471e3339f12049531d2ead015d82f117d8fd936 (patch)
treedb422dc5c887d053662a80b4ab1105e1aff5c41a /src/plugins/memif
parent4d830d2142af5aa545bcabf5dc3facc4e4344cbe (diff)
memif: fix input vector rate of memif-input node
Explicitly set the ptd->n_packets to 0 if no packet is received in memif_device_input_inline(). Otherwise ptd->n_packets just keeps last time rx packets number, then this stale number is added to memif_input_node->vectors_since_last_overflow in every dispatch_node() call for memif_input_node. Type: fix Signed-off-by: Liangxing Wang <liangxing.wang@arm.com> Change-Id: Ide98a481c925262f9a609535a314f784cab424d8
Diffstat (limited to 'src/plugins/memif')
-rw-r--r--src/plugins/memif/node.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/memif/node.c b/src/plugins/memif/node.c
index 2d7b71fa20a..40dcf682798 100644
--- a/src/plugins/memif/node.c
+++ b/src/plugins/memif/node.c
@@ -534,7 +534,10 @@ memif_device_input_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
}
if (n_slots == 0)
- goto refill;
+ {
+ ptd->n_packets = 0;
+ goto refill;
+ }
n_desc = memif_parse_desc (ptd, mif, mq, cur_slot, n_slots);