From: K. Y. Srinivasan Date: Sat, 1 Aug 2015 23:08:14 +0000 (-0700) Subject: Drivers: hv: vmbus: Permit sending of packets without payload X-Git-Tag: v4.1.12-92~196^2~40 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=71174aeee3190ffe9a7e508bad9908eca2c09030;p=users%2Fjedix%2Flinux-maple.git 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 Signed-off-by: Greg Kroah-Hartman (cherry picked from commit b81658cf5d44e07c70c93e3b2aefe848eaaba99f) Orabug: 21886720 Signed-off-by: Jason Luo --- diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 603ce97e90272..c4dcab048cb8e 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: