Skip to content

hw/block/nvme: dma handling and address mapping cleanup

Klaus Jensen qemu-devel 2 versions – Applied

Status from this message: Pushed to nvme-next.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest16 patches 16 repliesApplied
  2. v116 patches 41 repliesSuperseded

Changes in v2 from the cover letter · 19 lines

* hw/block/nvme: add mapping helpers
- Add an assert in case of out of bounds array access. (Maxim)

* hw/block/nvme: remove redundant has_sg member
- Split the fix for the missing qemu_iov_destroy into a fresh patch ("hw/block/nvme: destroy request iov before reuse"). (Minwoo)

* hw/block/nvme: pass request along for tracing [DROPPED]
- Dropped the patch and replaced it with a simple patch that just adds tracing to the nvme_map_prp function ("hw/block/nvme: add tracing to nvme_map_prp"). (Minwoo)

* hw/block/nvme: add request mapping helper
- Changed the name from nvme_map to nvme_map_dptr. (Minwoo, Maxim)

* hw/block/nvme: add check for mdts
- Don't touch the documentaiton for the cmb_size_mb and max_ioqpairs parameters in this patch. (Minwoo)

* hw/block/nvme: refactor NvmeRequest clearing [DROPPED]
- Keep NvmeRequest structure clearing as "before use". (Maxim)

* hw/block/nvme: add a namespace reference in NvmeRequest
* hw/block/nvme: remove NvmeCmd parameter
- Squash these two patches together into "hw/block/nvme: add ns/cmd references in NvmeRequest".

* hw/block/nvme: consolidate qsg/iov clearing
- Move the qsg/iov destroys to a new nvme_req_exit function that is called after the cqe has been posted.

* hw/block/nvme: remove explicit qsg/iov parameters
- New patch. THe nvme_map_prp() function doesn't require the qsg and iov parameters since it can just get them from the passed NvmeRequest.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/16hw/block/nvme: memset preallocated requests structureshw/block/nvme.c+1 -11 reply
2/16hw/block/nvme: add mapping helpershw/block/nvme.c hw/block/trace-events+96 -170 replies
3/16hw/block/nvme: replace dma_acct with blk_acct equivalenthw/block/nvme.c+4 -10 replies
4/16hw/block/nvme: remove redundant has_sg memberhw/block/nvme.c hw/block/nvme.h+2 -62 replies
5/16hw/block/nvme: destroy request iov before reusehw/block/nvme.c+4 -02 replies
6/16hw/block/nvme: refactor dma read/writehw/block/nvme.c+46 -450 replies
7/16hw/block/nvme: add tracing to nvme_map_prphw/block/nvme.c hw/block/trace-events+3 -02 replies
8/16hw/block/nvme: add request mapping helperhw/block/nvme.c+10 -31 reply
9/16hw/block/nvme: verify validity of prp lists in the cmbhw/block/nvme.c+13 -10 replies
10/16hw/block/nvme: refactor request bounds checkinghw/block/nvme.c+21 -50 replies
11/16hw/block/nvme: add check for mdtshw/block/nvme.c hw/block/nvme.h hw/block/trace-events+31 -10 replies
12/16hw/block/nvme: be consistent about zeros vs zeroesblock/nvme.c hw/block/nvme.c include/block/nvme.h+8 -80 replies
13/16hw/block/nvme: add ns/cmd references in NvmeRequesthw/block/nvme.c hw/block/nvme.h+104 -850 replies
14/16hw/block/nvme: consolidate qsg/iov clearinghw/block/nvme.c+21 -314 replies
15/16hw/block/nvme: use preallocated qsg/iov in nvme_dma_prphw/block/nvme.c+18 -231 reply
16/16hw/block/nvme: remove explicit qsg/iov parametershw/block/nvme.c+7 -42 replies

Reviews trailers per patch

All 16 patches have a Reviewed-by or Acked-by.

PatchMaxim LevitskyMinwoo ImAndrzej JakowskiKeith Busch
1/16R-b R-b
2/16R-b R-b R-b
3/16R-b R-b
4/16R-b R-b
5/16R-b R-b
6/16R-b R-b
7/16R-b R-b
8/16R-b R-b
9/16R-b R-b
10/16R-b R-b
11/16R-b R-b
12/16R-b R-b
13/16R-b R-b
14/16R-b R-b
15/16R-b R-b A-b
16/16R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/16] hw/block/nvme: dma handling and address mapping cleanup

From: Klaus Jensen <[email protected]>

This series consists of patches that refactors dma read/write and adds a number of address mapping helper functions.

v2:
* hw/block/nvme: add mapping helpers
- Add an assert in case of out of bounds array access. (Maxim)

* hw/block/nvme: remove redundant has_sg member
- Split the fix for the missing qemu_iov_destroy into a fresh patch ("hw/block/nvme: destroy request iov before reuse"). (Minwoo)

* hw/block/nvme: pass request along for tracing [DROPPED]
- Dropped the patch and replaced it with a simple patch that just adds tracing to the nvme_map_prp function ("hw/block/nvme: add tracing to nvme_map_prp"). (Minwoo)

* hw/block/nvme: add request mapping helper
- Changed the name from nvme_map to nvme_map_dptr. (Minwoo, Maxim)

* hw/block/nvme: add check for mdts
- Don't touch the documentaiton for the cmb_size_mb and max_ioqpairs parameters in this patch. (Minwoo)

* hw/block/nvme: refactor NvmeRequest clearing [DROPPED]
- Keep NvmeRequest structure clearing as "before use". (Maxim)

* hw/block/nvme: add a namespace reference in NvmeRequest
* hw/block/nvme: remove NvmeCmd parameter
- Squash these two patches together into "hw/block/nvme: add ns/cmd references in NvmeRequest".

* hw/block/nvme: consolidate qsg/iov clearing
- Move the qsg/iov destroys to a new nvme_req_exit function that is called after the cqe has been posted.

* hw/block/nvme: remove explicit qsg/iov parameters
- New patch. THe nvme_map_prp() function doesn't require the qsg and iov parameters since it can just get them from the passed NvmeRequest.

Based-on: <[email protected]>

Klaus Jensen (16):
hw/block/nvme: memset preallocated requests structures hw/block/nvme: add mapping helpers hw/block/nvme: replace dma_acct with blk_acct equivalent hw/block/nvme: remove redundant has_sg member hw/block/nvme: destroy request iov before reuse hw/block/nvme: refactor dma read/write hw/block/nvme: add tracing to nvme_map_prp hw/block/nvme: add request mapping helper hw/block/nvme: verify validity of prp lists in the cmb hw/block/nvme: refactor request bounds checking hw/block/nvme: add check for mdts hw/block/nvme: be consistent about zeros vs zeroes hw/block/nvme: add ns/cmd references in NvmeRequest hw/block/nvme: consolidate qsg/iov clearing hw/block/nvme: use preallocated qsg/iov in nvme_dma_prp hw/block/nvme: remove explicit qsg/iov parameters

 block/nvme.c          |   4 +-
 hw/block/nvme.c       | 506 +++++++++++++++++++++++++++---------------
 hw/block/nvme.h       |   4 +-
 hw/block/trace-events |   4 +
 include/block/nvme.h  |   4 +-
 5 files changed, 340 insertions(+), 182 deletions(-)
Signature · 1 line
2.27.0