perf: Optimize the output of global metrics to reduce atomic operations

This commit is contained in:
luwenpeng
2023-10-12 16:31:53 +08:00
parent 4f870de963
commit 8d1a9b3be5
10 changed files with 265 additions and 160 deletions

View File

@@ -149,8 +149,8 @@ void route_ctx_copy(struct route_ctx *dst, struct route_ctx *src)
void throughput_metrics_inc(struct throughput_metrics *iterm, uint64_t n_pkts, uint64_t n_bytes)
{
ATOMIC_ADD(&iterm->n_bytes, n_bytes);
ATOMIC_ADD(&iterm->n_pkts, n_pkts);
iterm->n_bytes += n_bytes;
iterm->n_pkts += n_pkts;
}
/******************************************************************************