What about the following simplification. If on older hosts you can avoid more
code
and the additional barrier. Also cleanup comment wording somewhat.
>From de2d566d9092cbbc8e5974dea581617ef787ff69 Mon Sep 17 00:00:00 2001
From: Michael Kelley
Date: Sat, 10 Feb 2018 20:48:49 +
Subject: [PAT
...@canonical.com; vkuzn...@redhat.com; jasow...@redhat.com;
> leann.ogasaw...@canonical.com; marcelo.ce...@canonical.com; Stephen Hemminger
> ; KY Srinivasan
> Subject: Re: [PATCH char-misc 1/1] Drivers: hv: vmbus: Fix ring buffer
> signaling
>
>
> > if (rbi
> if (rbi->ring_buffer->feature_bits.feat_pending_send_sz) {
> u32 pending_sz = READ_ONCE(rbi->ring_buffer->pending_send_sz);
>
> /*
> + * Ensure the read of write_index in hv_get_bytes_to_write()
> + * happens after the read of pending
> -Original Message-
> From: KY Srinivasan
> Sent: Sunday, February 11, 2018 5:14 PM
--- snip ---
> > if (rbi->ring_buffer->feature_bits.feat_pending_send_sz) {
> > u32 pending_sz = READ_ONCE(rbi->ring_buffer-
> > >pending_send_sz);
> >
> > /*
> > +
> -Original Message-
> From: Michael Kelley [mailto:mhkel...@outlook.com]
> Sent: Saturday, February 10, 2018 12:49 PM
> To: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org;
> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
> vkuzn...@redhat.com; jasow...@redhat
On Sat, 10 Feb 2018 20:48:49 +
Michael Kelley wrote:
> + u32 delta = rbi->ring_buffer->read_index < rbi->priv_read_index ?
> + (rbi->priv_read_index - rbi->ring_buffer->read_index) :
> + (rbi->ring_datasize - rbi->ring_buffer->read_index +
> +