Skip to content

Commit

Permalink
Merge pull request #1002 from lxchx/fix-duplicate-arp-reply-or-kni-as…
Browse files Browse the repository at this point in the history
…-dropped

netif: fix duplicate ARP replies or KNI packets being counted as dropped
  • Loading branch information
ywc689 authored Nov 25, 2024
2 parents 3095daf + f5504c6 commit 673aa0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down

0 comments on commit 673aa0c

Please sign in to comment.