LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [RFC PATCHv6 3/7] ipvs: use u64_stats_t for the per-cpu counters

To: Jiri Wiesner <jwiesner@xxxxxxx>
Subject: Re: [RFC PATCHv6 3/7] ipvs: use u64_stats_t for the per-cpu counters
Cc: Simon Horman <horms@xxxxxxxxxxxx>, lvs-devel@xxxxxxxxxxxxxxx, yunhong-cgl jiang <xintian1976@xxxxxxxxx>, dust.li@xxxxxxxxxxxxxxxxx
From: Julian Anastasov <ja@xxxxxx>
Date: Mon, 14 Nov 2022 13:46:06 +0200 (EET)
        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 <ja@xxxxxx>


<Prev in Thread] Current Thread [Next in Thread>