Skip to content

Commit affb1af

Browse files
kattisrinivasangregkh
authored andcommitted
Drivers: hv: vmbus: Fix a bug in the channel callback dispatch code
Starting with Win8, we have implemented several optimizations to improve the scalability and performance of the VMBUS transport between the Host and the Guest. Some of the non-performance critical services cannot leverage these optimization since they only read and process one message at a time. Make adjustments to the callback dispatch code to account for the way non-performance critical drivers handle reading of the channel. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Cc: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a497c3b commit affb1af

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎drivers/hv/connection.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,13 @@ static void process_chn_event(u32 relid)
339339
*/
340340

341341
do {
342-
hv_begin_read(&channel->inbound);
342+
if (read_state)
343+
hv_begin_read(&channel->inbound);
343344
channel->onchannel_callback(arg);
344-
bytes_to_read = hv_end_read(&channel->inbound);
345+
if (read_state)
346+
bytes_to_read = hv_end_read(&channel->inbound);
347+
else
348+
bytes_to_read = 0;
345349
} while (read_state && (bytes_to_read != 0));
346350
} else {
347351
pr_err("no channel callback for relid - %u\n", relid);

0 commit comments

Comments
 (0)