From f5504c6a4cf8f995573d9ba637b499723c8d8ef9 Mon Sep 17 00:00:00 2001 From: lxchx Date: Tue, 22 Oct 2024 19:59:15 +0800 Subject: [PATCH] netif: fix duplicate ARP replies or KNI packets being counted as dropped --- src/netif.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/netif.c b/src/netif.c index 0a071a1d..416d1ad2 100644 --- a/src/netif.c +++ b/src/netif.c @@ -2497,7 +2497,7 @@ int netif_rcv_mbuf(struct netif_port *dev, lcoreid_t cid, struct rte_mbuf *mbuf, if (err == EDPVS_KNICONTINUE) { if (pkts_from_ring || forward2kni) - goto drop; + goto slient_free; if (unlikely(NULL == rte_pktmbuf_prepend(mbuf, (mbuf->data_off - data_off)))) goto drop; kni_ingress(mbuf, dev); @@ -2511,8 +2511,9 @@ int netif_rcv_mbuf(struct netif_port *dev, lcoreid_t cid, struct rte_mbuf *mbuf, return EDPVS_OK; drop: - rte_pktmbuf_free(mbuf); lcore_stats[cid].dropped++; +slient_free: + rte_pktmbuf_free(mbuf); return EDPVS_DROP; }