From: Stephen Hemminger <stephen@networkplumber.org>
To: Dexuan Cui <decui@microsoft.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"driverdev-devel@linuxdriverproject.org"
<driverdev-devel@linuxdriverproject.org>,
KY Srinivasan <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
"olaf@aepfle.de" <olaf@aepfle.de>,
Rolf Neugebauer <rolf.neugebauer@docker.com>,
"jasowang@redhat.com" <jasowang@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"apw@canonical.com" <apw@canonical.com>
Subject: Re: [PATCH] Drivers: hv: vmbus: finally fix hv_need_to_signal_on_read()
Date: Tue, 24 Jan 2017 08:08:18 -0800 [thread overview]
Message-ID: <20170124080818.48c26a6c@xeon-e3> (raw)
In-Reply-To: <MWHPR03MB2669D6E05A877D07D09611EABF750@MWHPR03MB2669.namprd03.prod.outlook.com>
On Tue, 24 Jan 2017 06:54:46 +0000
Dexuan Cui <decui@microsoft.com> wrote:
> +static inline void
> +init_cached_read_index(struct vmbus_channel *channel)
> +{
> + struct hv_ring_buffer_info *rbi = &channel->inbound;
> +
> + rbi->cached_read_index = rbi->ring_buffer->read_index;
> +}
Looks good thanks. This should go in right away. Which versions are impacted?
Should it also go to stable?
In a future patch, the API function names for interacting with the ring buffer
should be changed to all have common prefix (hv_) and maybe do a little rethinking
about what needs to be in ring buffer and what could be local variables.
For example, the cached_read_index is only useful over the span of the loop
reading from the ring buffer. For me, it would be cleaner with a ring_buffer
iterator object which could abstract the API better.
struct vmbus_ringbuffer_iter iter;
vmbus_begin_read(&iter, channel);
while ((desc = vmbus_next_read(&iter), channel) {
...
}
vmbus_end_read(&iter, channel);
next prev parent reply other threads:[~2017-01-24 16:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-24 6:54 [PATCH] Drivers: hv: vmbus: finally fix hv_need_to_signal_on_read() Dexuan Cui
2017-01-24 16:08 ` Stephen Hemminger [this message]
2017-01-26 6:10 ` Dexuan Cui
2017-01-26 7:16 ` gregkh
2017-01-26 7:44 ` Dexuan Cui
2017-01-26 7:49 ` gregkh
2017-01-26 8:27 ` Dexuan Cui
2017-01-26 9:16 ` gregkh
2017-01-26 9:31 ` Dexuan Cui
2017-01-26 10:10 ` gregkh
2017-01-26 10:24 ` Dexuan Cui
2017-01-26 10:28 ` gregkh
2017-01-26 10:31 ` Dexuan Cui
2017-01-26 19:16 ` KY Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170124080818.48c26a6c@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=apw@canonical.com \
--cc=decui@microsoft.com \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=jasowang@redhat.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=rolf.neugebauer@docker.com \
--cc=sthemmin@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).