Page MenuHomeFreeBSD

D35328.id106398.diff
No OneTemporary

D35328.id106398.diff

Index: usr.sbin/bhyve/pci_nvme.c
===================================================================
--- usr.sbin/bhyve/pci_nvme.c
+++ usr.sbin/bhyve/pci_nvme.c
@@ -2171,6 +2171,7 @@
uint64_t gpaddr, size_t size, int do_write, uint64_t lba)
{
int iovidx;
+ bool range_is_contiguous;
if (req == NULL)
return (-1);
@@ -2179,8 +2180,16 @@
return (-1);
}
- /* concatenate contig block-iovs to minimize number of iovs */
- if ((req->prev_gpaddr + req->prev_size) == gpaddr) {
+ /*
+ * Minimize the number of IOVs by concatenating contiguous address
+ * ranges. Skip if there is no previous range.
+ */
+ if (req->io_req.br_iovcnt == 0)
+ range_is_contiguous = false;
+ else
+ range_is_contiguous = (req->prev_gpaddr + req->prev_size) == gpaddr;
+
+ if (range_is_contiguous) {
iovidx = req->io_req.br_iovcnt - 1;
req->io_req.br_iov[iovidx].iov_base =

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 7:28 PM (21 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14722381
Default Alt Text
D35328.id106398.diff (877 B)

Event Timeline