|
Lines 2171-2176
pci_nvme_append_iov_req(struct pci_nvme_softc *sc, struct pci_nvme_ioreq *req,
Link Here
|
| 2171 |
uint64_t gpaddr, size_t size, int do_write, uint64_t lba) |
2171 |
uint64_t gpaddr, size_t size, int do_write, uint64_t lba) |
| 2172 |
{ |
2172 |
{ |
| 2173 |
int iovidx; |
2173 |
int iovidx; |
|
|
2174 |
bool can_concatenate = false; |
| 2174 |
|
2175 |
|
| 2175 |
if (req == NULL) |
2176 |
if (req == NULL) |
| 2176 |
return (-1); |
2177 |
return (-1); |
|
Lines 2179-2186
pci_nvme_append_iov_req(struct pci_nvme_softc *sc, struct pci_nvme_ioreq *req,
Link Here
|
| 2179 |
return (-1); |
2180 |
return (-1); |
| 2180 |
} |
2181 |
} |
| 2181 |
|
2182 |
|
| 2182 |
/* concatenate contig block-iovs to minimize number of iovs */ |
2183 |
/* |
| 2183 |
if ((req->prev_gpaddr + req->prev_size) == gpaddr) { |
2184 |
* Minimize the number of IOVs by concatenating contiguous address |
|
|
2185 |
* ranges. Skip if there is no previous range. |
| 2186 |
*/ |
| 2187 |
if (req->io_req.br_iovcnt > 0) |
| 2188 |
can_concatenate = (req->prev_gpaddr + req->prev_size) == gpaddr; |
| 2189 |
|
| 2190 |
if (can_concatenate) { |
| 2184 |
iovidx = req->io_req.br_iovcnt - 1; |
2191 |
iovidx = req->io_req.br_iovcnt - 1; |
| 2185 |
|
2192 |
|
| 2186 |
req->io_req.br_iov[iovidx].iov_base = |
2193 |
req->io_req.br_iov[iovidx].iov_base = |