Skip to content

Commit 380b75d

Browse files
mhklinuxkuba-moo
authored andcommitted
Drivers: hv: Allow vmbus_sendpacket_mpb_desc() to create multiple ranges
vmbus_sendpacket_mpb_desc() is currently used only by the storvsc driver and is hardcoded to create a single GPA range. To allow it to also be used by the netvsc driver to create multiple GPA ranges, no longer hardcode as having a single GPA range. Allow the calling driver to specify the rangecount in the supplied descriptor. Update the storvsc driver to reflect this new approach. Cc: <stable@vger.kernel.org> # 6.1.x Signed-off-by: Michael Kelley <mhklinux@outlook.com> Link: https://patch.msgid.link/20250513000604.1396-2-mhklinux@outlook.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent bf449f3 commit 380b75d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

drivers/hv/channel.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,9 +1136,10 @@ int vmbus_sendpacket_pagebuffer(struct vmbus_channel *channel,
11361136
EXPORT_SYMBOL_GPL(vmbus_sendpacket_pagebuffer);
11371137

11381138
/*
1139-
* vmbus_sendpacket_multipagebuffer - Send a multi-page buffer packet
1139+
* vmbus_sendpacket_mpb_desc - Send one or more multi-page buffer packets
11401140
* using a GPADL Direct packet type.
1141-
* The buffer includes the vmbus descriptor.
1141+
* The desc argument must include space for the VMBus descriptor. The
1142+
* rangecount field must already be set.
11421143
*/
11431144
int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel,
11441145
struct vmbus_packet_mpb_array *desc,
@@ -1160,7 +1161,6 @@ int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel,
11601161
desc->length8 = (u16)(packetlen_aligned >> 3);
11611162
desc->transactionid = VMBUS_RQST_ERROR; /* will be updated in hv_ringbuffer_write() */
11621163
desc->reserved = 0;
1163-
desc->rangecount = 1;
11641164

11651165
bufferlist[0].iov_base = desc;
11661166
bufferlist[0].iov_len = desc_size;

drivers/scsi/storvsc_drv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,7 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
18191819
return SCSI_MLQUEUE_DEVICE_BUSY;
18201820
}
18211821

1822+
payload->rangecount = 1;
18221823
payload->range.len = length;
18231824
payload->range.offset = offset_in_hvpg;
18241825

0 commit comments

Comments
 (0)