]> git.feebdaed.xyz Git - 0xmirror/f-stack.git/commitdiff
Fixed a crash issue of kni_stat in secondary proc.
authorfengbojiang <fengbojiang@tencent.com>
Thu, 23 Oct 2025 07:45:37 +0000 (15:45 +0800)
committerfengbojiang <fengbojiang@tencent.com>
Thu, 23 Oct 2025 07:45:37 +0000 (15:45 +0800)
lib/ff_dpdk_kni.c

index cac2c20727d5c911856c60bb105996f02e06fc14..1ff92607831604e96a1e1c393b2f6fba7cd346f0 100644 (file)
@@ -665,7 +665,9 @@ ff_kni_enqueue(enum FilterReturn filter, uint16_t port_id, struct rte_mbuf *pkt)
     return 0;
 
 error:
-    kni_stat[port_id]->rx_dropped++;
+    if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+        kni_stat[port_id]->rx_dropped++;
+    }
     rte_pktmbuf_free(pkt);
 
     return -1;