Skip to contentSkip to conversation

Drivers: hv: vmbus: Enable interrupt driven flow control

PATCH In review K. Y. Srinivasan 2 participants 3 messages Sep 5, 2014 – Sep 7, 2014 Hyper-V/Azure core and drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
 drivers/hv/ring_buffer.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/hv/ring_buffer.c +5 -0
index 15db66b..6361d12 100644
@@ -361,6 +361,11 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info,
 	ring_info->ring_buffer->read_index =
 		ring_info->ring_buffer->write_index = 0;
 
+	/*
+	 * Set the feature bit for enabling flow control.
+	 */
+	ring_info->ring_buffer->feature_bits.value = 1;
+
 	ring_info->ring_size = buflen;
 	ring_info->ring_datasize = buflen - sizeof(struct hv_ring_buffer);
 
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 29 lines · K. Y. Srinivasan

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.

---
 drivers/hv/ring_buffer.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/hv/ring_buffer.c +0 -0
index 15db66b..6361d12 100644

drivers/hv/ring_buffer.c int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info, · line 368

Quoted 8 lines
drivers/hv/ring_buffer.c +5 -0
@@ -361,6 +361,11 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info,
        ring_info->ring_buffer->read_index =
                ring_info->ring_buffer->write_index = 0;
 
+       /*
+        * Set the feature bit for enabling flow control.
+        */
+       ring_info->ring_buffer->feature_bits.value = 1;
+

This feature is enabled, do we need to reset pending_send_sz and reserved1[12], reserved1[4028] here?

Quoted 11 lines
drivers/hv/ring_buffer.c +0 -1
        ring_info->ring_size = buflen;
        ring_info->ring_datasize = buflen - sizeof(struct hv_ring_buffer);
 
--

1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
Quoted 46 lines

-----Original Message-----
From: Amos Kong [mailto:[email protected]]
Sent: Sunday, September 7, 2014 4:44 AM
To: KY Srinivasan
Cc: [email protected]; open list; [email protected]; [email protected]; [email protected]; Jason Wang
Subject: Re: [PATCH V2 1/1] Drivers: hv: vmbus: Enable interrupt driven flow control

Quoted 7 lines · K. Y. Srinivasan

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).

Quoted 7 lines

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

drivers/hv/ring_buffer.c int hv_ringbuffer_init(struct hv_ring_buffer_info

Quoted 15 lines

this feature.

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

---
 drivers/hv/ring_buffer.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/hv/ring_buffer.c index renamed from drivers/hv/ring_buffer.c +0 -0

15db66b..6361d12 100644

drivers/hv/ring_buffer.c +0 -0
@@ -361,6 +361,11 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info

*ring_info,

Quoted 3 lines
drivers/hv/ring_buffer.c +0 -0
        ring_info->ring_buffer->read_index =
                ring_info->ring_buffer->write_index = 0;
 
Quoted 13 lines

drivers/hv/ring_buffer.c int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info, · line 368

Quoted 5 lines
drivers/hv/ring_buffer.c +5 -0
+       /*
+        * Set the feature bit for enabling flow control.
+        */
+       ring_info->ring_buffer->feature_bits.value = 1;
+

This feature is enabled, do we need to reset pending_send_sz and reserved1[12], reserved1[4028] here?

Quoted 4 lines
drivers/hv/ring_buffer.c +0 -0
        ring_info->ring_size = buflen;
        ring_info->ring_datasize = buflen - sizeof(struct
 hv_ring_buffer);

All the pages for the ring buffer have already been zeroed out including the shared control structure. Look at vmbus_open() (drivers/hv/channel.c) where we allocate the ring buffer - we pass in the flag to Zero out the pages.

Regards,

K. Y

Quoted 8 lines
Quoted 8 lines

--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/