]> git.proxmox.com Git - mirror_qemu.git/commit
hw/block/nvme: refactor nvme_dma
authorKlaus Jensen <k.jensen@samsung.com>
Tue, 15 Dec 2020 18:18:25 +0000 (19:18 +0100)
committerKlaus Jensen <k.jensen@samsung.com>
Tue, 9 Mar 2021 10:00:57 +0000 (11:00 +0100)
commit81d07f4ff51a2b5249f940975acfb9b0d787d593
tree30a5913680da73dfbfae72b14940411ed593798d
parent073d12d99871d0d500f44bd49cb0c45df14cf2c3
hw/block/nvme: refactor nvme_dma

The nvme_dma function doesn't just do DMA (QEMUSGList-based) memory transfers;
it also handles QEMUIOVector copies.

Introduce the NvmeTxDirection enum and rename to nvme_tx. Remove mapping
of PRPs/SGLs from nvme_tx and instead assert that they have been mapped
previously. This allows more fine-grained use in subsequent patches.

Add new (better named) helpers, nvme_{c2h,h2c}, that does both PRP/SGL
mapping and transfer.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
hw/block/nvme.c