diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2015-08-01 16:08:14 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-04 22:28:39 -0700 |
commit | b81658cf5d44e07c70c93e3b2aefe848eaaba99f (patch) | |
tree | 5d8545ecd67e5a16683e05c84547cab9364ee1ec /drivers/hv/channel.c | |
parent | b6ddeae1603dfa55e857ba1520f5acea83f8cf1c (diff) |
Drivers: hv: vmbus: Permit sending of packets without payload
The guest may have to send a completion packet back to the host.
To support this usage, permit sending a packet without a payload -
we would be only sending the descriptor in this case.
Signed-off-by: K. Y. Srinivasan <kys@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 | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 603ce97e9027..c4dcab048cb8 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -601,6 +601,7 @@ int vmbus_sendpacket_ctl(struct vmbus_channel *channel, void *buffer, u64 aligned_data = 0; int ret; bool signal = false; + int num_vecs = ((bufferlen != 0) ? 3 : 1); /* Setup the descriptor */ @@ -618,7 +619,8 @@ int vmbus_sendpacket_ctl(struct vmbus_channel *channel, void *buffer, bufferlist[2].iov_base = &aligned_data; bufferlist[2].iov_len = (packetlen_aligned - packetlen); - ret = hv_ringbuffer_write(&channel->outbound, bufferlist, 3, &signal); + ret = hv_ringbuffer_write(&channel->outbound, bufferlist, num_vecs, + &signal); /* * Signalling the host is conditional on many factors: |