History log of /drivers/hv/ring_buffer.c
Revision Date Author Comments
046c7911b224267062ab1caeabbf11bc46e9c152 06-Sep-2014 K. Y. Srinivasan <kys@microsoft.com> Drivers: hv: vmbus: Enable interrupt driven flow control

In win8 we have a feature that allows for interrupt driven flow management
for host/guest communication. For instance, if the host were blocked because
there was no space available in the ringbuffer, the host could request that the
guest send an interrupt when space becomes available in the ringbuffer (when
the guest drains the ringbuffer).

While this feature was implemented in the guest a while ago, we had not
advertised that the guest supported this feature. This patch advertises
the support to the host.

For pre-win8 hosts, this has no effect since the size of the ringbuffer
control structure has not changed and all changes have been backward
compatible - unused/reserved space has been used to implement this
feature.

In this version of the patch I have cleaned up the commit log based on
feedback from Greg KH.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
011a7c3cc3aa60c7ea6bb49d847e80a299ba7b36 02-Feb-2014 K. Y. Srinivasan <kys@microsoft.com> Drivers: hv: vmbus: Cleanup the packet send path

The current channel code is using scatterlist abstraction to pass data to the
ringbuffer API on the send path. This causes unnecessary translations
between virtual and physical addresses. Fix this.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
e91e84fa4cfeb67a9a096f1adaa1a1a692474724 19-Jun-2013 Jason Wang <jasowang@redhat.com> drivers: hv: check interrupt mask before read_index

This patches add a read barriers to force the driver to check the interrupt mask
before read_index. Otherwise we may lost a kick to host.

Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
35848f68b07df3f917cb13fc3c134718669f569b 18-Jun-2013 Jason Wang <jasowang@redhat.com> drivers: hv: switch to use mb() instead of smp_mb()

Even if guest were compiled without SMP support, it could not assume that host
wasn't. So switch to use mb() instead of smp_mb() to force memory barriers for
UP guest.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
288fa3e022eb85fa151e0f9bcd15caeb81679af6 29-Mar-2013 K. Y. Srinivasan <kys@microsoft.com> Drivers: hv: vmbus: Fix a bug in hv_need_to_signal()

As part of updating the vmbus protocol, the function hv_need_to_signal()
was introduced. This functions helps optimize signalling from guest to
host. The newly added memory barrier is needed to ensure that we correctly
decide when to signal the host.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Reported-by: Olaf Hering <olh@suse.de>
Cc: Stable <stable@vger.kernel.org> (V3.8+)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
c2b8e5202cf7670f918d0f7439ed2123cd58e1b7 01-Dec-2012 K. Y. Srinivasan <kys@microsoft.com> Drivers: hv: Implement flow management on the send side

Implement flow management on the send side. When the sender is blocked, the reader
can potentially signal the sender to indicate there is now room to send.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4fa152ce24724a4a6b2edd26ca2eb7757ff5b2b8 01-Dec-2012 K. Y. Srinivasan <kys@microsoft.com> Drivers: hv: Get rid of hv_get_ringbuffer_interrupt_mask()

This function is no longer used; get rid of it.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
98fa8cf4bcc79cb14de8fd815bbcd00dcbd7b20e 01-Dec-2012 K. Y. Srinivasan <kys@microsoft.com> Drivers: hv: Optimize the signaling on the write path

The host has already implemented the "read" side optimizations.
Leverage that to optimize "write" side signaling.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6fdf3b21433e901dcba0ac186f00d604ce944f56 01-Dec-2012 K. Y. Srinivasan <kys@microsoft.com> Drivers: hv: Implement routines for read side signaling optimization

Implement functions that will support read-side signaling optimization.
By having the reader indicate the start of the "read" operation and the
"end" of the read operation we can more efficiently handle the signaling
protocol: while the read is in progress, there is no need for the "writer"
to signal the "reader" as new items are put on the read queue.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
33be96e47cc27f2f1a753a0707b02a73df8c8d46 27-Mar-2012 Haiyang Zhang <haiyangz@microsoft.com> net/hyperv: Add flow control based on hi/low watermark

In the existing code, we only stop queue when the ringbuffer is full,
so the current packet has to be dropped or retried from upper layer.

This patch stops the tx queue when available ringbuffer is below
the low watermark. So the ringbuffer still has small amount of space
available for the current packet. This will reduce the overhead of
retries on sending.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
1a2643012fa2262e823b7f11d9732b7fea4c25ce 11-Oct-2011 Greg Kroah-Hartman <gregkh@suse.de> Staging: hv: remove last user of DPRINT() macro

This also removed the unused function hv_dump_ring_info().

Cc: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
46a971913611a23478283931460a95be962ce329 04-Oct-2011 Greg Kroah-Hartman <gregkh@suse.de> Staging: hv: move hyperv code out of staging directory

After many years wandering the desert, it is finally time for the
Microsoft HyperV code to move out of the staging directory. Or at least
the core hyperv bus code, and the utility driver, the rest still have
some review to get through by the various subsystem maintainers.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>