buf[i] = NULL;
num = rte_distributor_get_pkt(db, id, buf, buf, num);
while (!quit) {
- worker_stats[id].handled_packets += num;
+ __atomic_fetch_add(&worker_stats[id].handled_packets, num,
+ __ATOMIC_RELAXED);
count += num;
num = rte_distributor_get_pkt(db, id,
buf, buf, num);
}
- worker_stats[id].handled_packets += num;
+ __atomic_fetch_add(&worker_stats[id].handled_packets, num,
+ __ATOMIC_RELAXED);
count += num;
rte_distributor_return_pkt(db, id, buf, num);
return 0;
id, buf, buf, num);
while (!quit) {
- worker_stats[id].handled_packets++, count++;
+ worker_stats[id].handled_packets += num;
+ count += num;
rte_pktmbuf_free(pkt);
num = rte_distributor_get_pkt(d, id, buf, buf, num);
}