Re: [RFC PATCHv6 3/7] ipvs: use u64_stats_t for the per-cpu counters
Julian Anastasov <[email protected]>
| Newsgroups | org.kernel.vger.lvs-devel |
|---|---|
| Message-ID | <[email protected]> |
Hello,
On Sat, 12 Nov 2022, Julian Anastasov wrote:
> + for (;;) {
> + start += u64_stats_fetch_begin(&c->syncp);
Hm, this should be assignment and not addition...
Not a problem for 64-bit tests.
> + kconns += u64_stats_read(&c->cnt.conns);
> + kinpkts += u64_stats_read(&c->cnt.inpkts);
> + koutpkts += u64_stats_read(&c->cnt.outpkts);
> + kinbytes += u64_stats_read(&c->cnt.inbytes);
> + koutbytes += u64_stats_read(&c->cnt.outbytes);
> + if (!u64_stats_fetch_retry(&c->syncp, start))
> + break;
> +#if BITS_PER_LONG == 32
> + kconns = conns;
> + kinpkts = inpkts;
> + koutpkts = outpkts;
> + kinbytes = inbytes;
> + koutbytes = outbytes;
> +#endif
Regards
--
Julian Anastasov <[email protected]>