diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2012-12-01 06:46:57 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-17 11:41:49 -0800 |
commit | c2b8e5202cf7670f918d0f7439ed2123cd58e1b7 (patch) | |
tree | 5dfc99b2b71a348c3942522cb5d3c338684edf1a /drivers/hv/channel.c | |
parent | 2a5c43a821b3b26e6af1cdb987b4daeba6f13a6f (diff) | |
download | linux-c2b8e5202cf7670f918d0f7439ed2123cd58e1b7.tar.bz2 |
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>
Diffstat (limited to 'drivers/hv/channel.c')
-rw-r--r-- | drivers/hv/channel.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 9303252b2e19..064257e79f23 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -735,6 +735,7 @@ int vmbus_recvpacket(struct vmbus_channel *channel, void *buffer, u32 packetlen; u32 userlen; int ret; + bool signal = false; *buffer_actual_len = 0; *requestid = 0; @@ -761,8 +762,10 @@ int vmbus_recvpacket(struct vmbus_channel *channel, void *buffer, /* Copy over the packet to the user buffer */ ret = hv_ringbuffer_read(&channel->inbound, buffer, userlen, - (desc.offset8 << 3)); + (desc.offset8 << 3), &signal); + if (signal) + vmbus_setevent(channel); return 0; } @@ -779,6 +782,7 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer, u32 packetlen; u32 userlen; int ret; + bool signal = false; *buffer_actual_len = 0; *requestid = 0; @@ -805,7 +809,11 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer, *requestid = desc.trans_id; /* Copy over the entire packet to the user buffer */ - ret = hv_ringbuffer_read(&channel->inbound, buffer, packetlen, 0); + ret = hv_ringbuffer_read(&channel->inbound, buffer, packetlen, 0, + &signal); + + if (signal) + vmbus_setevent(channel); return 0; } |