[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] eb2e89: hw/block/nvme: introduce nvme-subsys
From: |
Peter Maydell |
Subject: |
[Qemu-commits] [qemu/qemu] eb2e89: hw/block/nvme: introduce nvme-subsys device |
Date: |
Wed, 10 Mar 2021 12:17:12 -0800 |
Branch: refs/heads/staging
Home: https://github.com/qemu/qemu
Commit: eb2e89747eca57fb0028001b28b3c4e0c1540e3a
https://github.com/qemu/qemu/commit/eb2e89747eca57fb0028001b28b3c4e0c1540e3a
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/meson.build
A hw/block/nvme-subsys.c
A hw/block/nvme-subsys.h
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: introduce nvme-subsys device
To support multi-path in QEMU NVMe device model, We need to have NVMe
subsystem hierarchy to map controllers and namespaces to a NVMe
subsystem.
This patch introduced a simple nvme-subsys device model. The subsystem
will be prepared with subsystem NQN with <subsys_id> provided in
nvme-subsys device:
ex) -device nvme-subsys,id=subsys0: nqn.2019-08.org.qemu:subsys0
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
[k.jensen: added 'nqn' device parameter per request]
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: 982ed66bb2e89bdb029b186232946fe2e7c217e1
https://github.com/qemu/qemu/commit/982ed66bb2e89bdb029b186232946fe2e7c217e1
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
M hw/block/nvme.h
Log Message:
-----------
hw/block/nvme: support to map controller to a subsystem
nvme controller(nvme) can be mapped to a NVMe subsystem(nvme-subsys).
This patch maps a controller to a subsystem by adding a parameter
'subsys' to the nvme device.
To map a controller to a subsystem, we need to put nvme-subsys first and
then maps the subsystem to the controller:
-device nvme-subsys,id=subsys0
-device nvme,serial=foo,id=nvme0,subsys=subsys0
If 'subsys' property is not given to the nvme controller, then subsystem
NQN will be created with serial (e.g., 'foo' in above example),
Otherwise, it will be based on subsys id (e.g., 'subsys0' in above
example).
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: 66b7e9bed0aee4342aa7cb824b8c46a42cacf7e2
https://github.com/qemu/qemu/commit/66b7e9bed0aee4342aa7cb824b8c46a42cacf7e2
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M include/block/nvme.h
Log Message:
-----------
hw/block/nvme: add CMIC enum value for Identify Controller
Added Controller Multi-path I/O and Namespace Sharing Capabilities
(CMIC) field to support multi-controller in the following patches.
This field is in Identify Controller data structure in [76].
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: e36a261d4bf7057a8ffee336422210b58c661a21
https://github.com/qemu/qemu/commit/e36a261d4bf7057a8ffee336422210b58c661a21
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme-subsys.c
M hw/block/nvme-subsys.h
M hw/block/nvme.c
M hw/block/nvme.h
Log Message:
-----------
hw/block/nvme: support for multi-controller in subsystem
We have nvme-subsys and nvme devices mapped together. To support
multi-controller scheme to this setup, controller identifier(id) has to
be managed. Earlier, cntlid(controller id) used to be always 0 because
we didn't have any subsystem scheme that controller id matters.
This patch introduced 'cntlid' attribute to the nvme controller
instance(NvmeCtrl) and make it allocated by the nvme-subsys device
mapped to the controller. If nvme-subsys is not given to the
controller, then it will always be 0 as it was.
Added 'ctrls' array in the nvme-subsys instance to manage attached
controllers to the subsystem with a limit(32). This patch didn't take
list for the controllers to make it seamless with nvme-ns device.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: adc36b8d21204c00643016d8766a5214e3d54b5b
https://github.com/qemu/qemu/commit/adc36b8d21204c00643016d8766a5214e3d54b5b
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M include/block/nvme.h
Log Message:
-----------
hw/block/nvme: add NMIC enum value for Identify Namespace
Added Namespace Multi-path I/O and Namespace Sharing Capabilities (NMIC)
field to support shared namespace from controller(s).
This field is in Identify Namespace data structure in [30].
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: e570768566b36f0a0471f65a40b47a6471ef0e24
https://github.com/qemu/qemu/commit/e570768566b36f0a0471f65a40b47a6471ef0e24
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme-ns.c
M hw/block/nvme-ns.h
M hw/block/nvme-subsys.c
M hw/block/nvme-subsys.h
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: support for shared namespace in subsystem
nvme-ns device is registered to a nvme controller device during the
initialization in nvme_register_namespace() in case that 'bus' property
is given which means it's mapped to a single controller.
This patch introduced a new property 'subsys' just like the controller
device instance did to map a namespace to a NVMe subsystem.
If 'subsys' property is given to the nvme-ns device, it will belong to
the specified subsystem and will be attached to all controllers in that
subsystem by enabling shared namespace capability in NMIC(Namespace
Multi-path I/O and Namespace Capabilities) in Identify Namespace.
Usage:
-device nvme-subsys,id=subsys0
-device nvme,serial=foo,id=nvme0,subsys=subsys0
-device nvme,serial=bar,id=nvme1,subsys=subsys0
-device nvme,serial=baz,id=nvme2,subsys=subsys0
-device nvme-ns,id=ns1,drive=<drv>,nsid=1,subsys=subsys0 # Shared
-device nvme-ns,id=ns2,drive=<drv>,nsid=2,bus=nvme2 # Non-shared
In the above example, 'ns1' will be shared to 'nvme0' and 'nvme1' in
the same subsystem. On the other hand, 'ns2' will be attached to the
'nvme2' only as a private namespace in that subsystem.
All the namespace with 'subsys' parameter will attach all controllers in
the subsystem to the namespace by default.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: eda688ee2403c1efc48f420590623c885aec3393
https://github.com/qemu/qemu/commit/eda688ee2403c1efc48f420590623c885aec3393
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: remove unused parameter in check zone write
Remove the unused NvmeCtrl parameter in nvme_check_zone_write.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: 975b64665048e8e283a3c9cad9808da0a014e283
https://github.com/qemu/qemu/commit/975b64665048e8e283a3c9cad9808da0a014e283
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: refactor zone resource management
Zone transition handling and resource management is open coded (and
semi-duplicated in the case of open, close and finish).
In preparation for Simple Copy command support (which also needs to open
zones for writing), consolidate into a set of 'nvme_zrm' functions and
in the process fix a bug with the controller not closing an open zone to
allow another zone to be explicitly opened.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: b0a79429d964ad2d8c1c41fdc18b3ae5def41ff8
https://github.com/qemu/qemu/commit/b0a79429d964ad2d8c1c41fdc18b3ae5def41ff8
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: pull write pointer advancement to separate function
In preparation for Simple Copy, pull write pointer advancement into a
separate function that is independent off an NvmeRequest.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: 3862efff316c1d02b41d1362f97dfba812050e53
https://github.com/qemu/qemu/commit/3862efff316c1d02b41d1362f97dfba812050e53
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M include/block/nvme.h
Log Message:
-----------
nvme: updated shared header for copy command
Add new data structures and types for the Simple Copy command.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: e4e430b3d6baa1c908ba71ca37aad87edac98804
https://github.com/qemu/qemu/commit/e4e430b3d6baa1c908ba71ca37aad87edac98804
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme-ns.c
M hw/block/nvme-ns.h
M hw/block/nvme.c
M hw/block/nvme.h
M hw/block/trace-events
Log Message:
-----------
hw/block/nvme: add simple copy command
Add support for TP 4065a ("Simple Copy Command"), v2020.05.04
("Ratified").
The implementation uses a bounce buffer to first read in the source
logical blocks, then issue a write of that bounce buffer. The default
maximum number of source logical blocks is 128, translating to 512 KiB
for 4k logical blocks which aligns with the default value of MDTS.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: 92323c8c2566b8ea4cdfe8e72a22d2651b0ee6af
https://github.com/qemu/qemu/commit/92323c8c2566b8ea4cdfe8e72a22d2651b0ee6af
Author: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: fix Close Zone
Implicitly and Explicitly Open zones can be closed by Close Zone
management function. This got broken by a recent commit ("hw/block/nvme:
refactor zone resource management") and now such commands fail with
Invalid Zone State Transition status.
Modify nvm_zrm_close() function to make Close Zone work correctly.
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: 9ae390046164e8b62fbdc48d2c6de8ee6fbd3cdc
https://github.com/qemu/qemu/commit/9ae390046164e8b62fbdc48d2c6de8ee6fbd3cdc
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme-ns.c
Log Message:
-----------
hw/block/nvme: add missing mor/mar constraint checks
Firstly, if zoned.max_active is non-zero, zoned.max_open must be less
than or equal to zoned.max_active.
Secondly, if only zones.max_active is set, we have to explicitly set
zones.max_open or we end up with an invalid MAR/MOR configuration. This
is an artifact of the parameters not being zeroes-based like in the
spec.
Cc: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reported-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Commit: 2c7e2ad243b92f02555498392fb4ce761db8ceb3
https://github.com/qemu/qemu/commit/2c7e2ad243b92f02555498392fb4ce761db8ceb3
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: improve invalid zasl value reporting
The Zone Append Size Limit (ZASL) must be at least 4096 bytes, so
improve the user experience by adding an early parameter check in
nvme_check_constraints.
When ZASL is still too small due to the host configuring the device for
an even larger page size, convert the trace point in nvme_start_ctrl to
an NVME_GUEST_ERR such that this is logged by QEMU instead of only
traced.
Reported-by: Corne <info@dantalion.nl>
Cc: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: 594a2b742b15a81e3bb41938c25ad6520c38e3cc
https://github.com/qemu/qemu/commit/594a2b742b15a81e3bb41938c25ad6520c38e3cc
Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: use locally assigned QEMU IEEE OUI
Commit 6eb7a071292a ("hw/block/nvme: change controller pci id") changed
the controller to use a Red Hat assigned PCI Device and Vendor ID, but
did not change the IEEE OUI away from the Intel IEEE OUI.
Fix that and use the locally assigned QEMU IEEE OUI instead if the
`use-intel-id` parameter is not explicitly set. Also reverse the Intel
IEEE OUI bytes.
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Commit: c94973288cd9cfdb0dc23ae84ba256a7345c372e
https://github.com/qemu/qemu/commit/c94973288cd9cfdb0dc23ae84ba256a7345c372e
Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
M hw/block/trace-events
M include/block/nvme.h
Log Message:
-----------
hw/block/nvme: add broadcast nsid support flush command
Add support for using the broadcast nsid to issue a flush on all
namespaces through a single command.
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: 5b8bb923ccf749d500593d6f1f0a210062285532
https://github.com/qemu/qemu/commit/5b8bb923ccf749d500593d6f1f0a210062285532
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: document 'mdts' nvme device parameter
Document the 'mdts' nvme device parameter.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: be5a1c27a3a5576323e910549071be635645aef1
https://github.com/qemu/qemu/commit/be5a1c27a3a5576323e910549071be635645aef1
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
M hw/block/trace-events
Log Message:
-----------
hw/block/nvme: deduplicate bad mdts trace event
If mdts is exceeded, trace it from a single place.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: 578d914b263c1ec71e567b90d744075ea3a8ea74
https://github.com/qemu/qemu/commit/578d914b263c1ec71e567b90d744075ea3a8ea74
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
M hw/block/nvme.h
M hw/block/trace-events
Log Message:
-----------
hw/block/nvme: align zoned.zasl with mdts
ZASL (Zone Append Size Limit) is defined exactly like MDTS (Maximum Data
Transfer Size), that is, it is a value in units of the minimum memory
page size (CAP.MPSMIN) and is reported as a power of two.
The 'mdts' nvme device parameter is specified as in the spec, but the
'zoned.append_size_limit' parameter is specified in bytes. This is
suboptimal for a number of reasons:
1. It is just plain confusing wrt. the definition of mdts.
2. There is a lot of complexity involved in validating the value; it
must be a power of two, it should be larger than 4k, if it is zero
we set it internally to mdts, but still report it as zero.
3. While "hw/block/nvme: improve invalid zasl value reporting"
slightly improved the handling of the parameter, the validation is
still wrong; it does not depend on CC.MPS, it depends on
CAP.MPSMIN. And we are not even checking that it is actually less
than or equal to MDTS, which is kinda the *one* condition it must
satisfy.
Fix this by defining zasl exactly like mdts and checking the one thing
that it must satisfy (that it is less than or equal to mdts). Also,
change the default value from 128KiB to 0 (aka, whatever mdts is).
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: 8c4d305f31f09064988e7f0a543dc94b7dbff2b2
https://github.com/qemu/qemu/commit/8c4d305f31f09064988e7f0a543dc94b7dbff2b2
Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: remove unnecessary endian conversion
Remove an unnecessary le_to_cpu conversion in Identify.
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Commit: 49f0eba8b2bdc0c9aeaac620b978da7cb0fa947f
https://github.com/qemu/qemu/commit/49f0eba8b2bdc0c9aeaac620b978da7cb0fa947f
Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
M hw/block/trace-events
Log Message:
-----------
hw/block/nvme: add identify trace event
Add a trace event for the Identify command.
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Commit: f4f872b532a53da7bc734cdb7cb166ec22d617d1
https://github.com/qemu/qemu/commit/f4f872b532a53da7bc734cdb7cb166ec22d617d1
Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: fix potential compilation error
assert may be compiled to a noop and we could end up returning an
uninitialized status.
Fix this by always returning Internal Device Error as a fallback.
Note that, as pointed out by Philippe, per commit 262a69f4282 ("osdep.h:
Prohibit disabling assert() in supported builds") this shouldn't be
possible. But clean it up so we don't worry about it again.
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[k.jensen: split commit]
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: 57331f9355431d86636580edf4847e299c4b3ad7
https://github.com/qemu/qemu/commit/57331f9355431d86636580edf4847e299c4b3ad7
Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: add trace event for zone read check
Add a trace event for the offline zone condition when checking zone
read.
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[k.jensen: split commit]
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: 67ce28a1fdcf73e2c026dbc43bb8fb6dc9a56aed
https://github.com/qemu/qemu/commit/67ce28a1fdcf73e2c026dbc43bb8fb6dc9a56aed
Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
M hw/block/nvme.h
M hw/block/trace-events
M include/block/nvme.h
Log Message:
-----------
hw/block/nvme: report non-mdts command size limit for dsm
Dataset Management is not subject to MDTS, but exceeded a certain size
per range causes internal looping. Report this limit (DMRSL) in the NVM
command set specific identify controller data structure.
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: ba7b81e769c3d65dc18d1d31b8c9c5b2b0a65cdd
https://github.com/qemu/qemu/commit/ba7b81e769c3d65dc18d1d31b8c9c5b2b0a65cdd
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: remove redundant len member in compare context
The 'len' member of the nvme_compare_ctx struct is redundant since the
same information is available in the 'iov' member.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: d90ba23a846f8c9cd8d238e8391e6be5881cddb4
https://github.com/qemu/qemu/commit/d90ba23a846f8c9cd8d238e8391e6be5881cddb4
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: remove block accounting for write zeroes
A Write Zeroes commands should not be counted in either the 'Data Units
Written' or in 'Host Write Commands' SMART/Health Information Log page.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: 569dbe19c415865a3b2a1ca806f780d1bd5da2db
https://github.com/qemu/qemu/commit/569dbe19c415865a3b2a1ca806f780d1bd5da2db
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: fix strerror printing
Fix missing sign inversion.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: f80a1c331ac2fe7428ddd76b1f059642d6a91338
https://github.com/qemu/qemu/commit/f80a1c331ac2fe7428ddd76b1f059642d6a91338
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
M hw/block/nvme.h
Log Message:
-----------
hw/block/nvme: try to deal with the iov/qsg duality
Introduce NvmeSg and try to deal with that pesky qsg/iov duality that
haunts all the memory-related functions.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: 073d12d99871d0d500f44bd49cb0c45df14cf2c3
https://github.com/qemu/qemu/commit/073d12d99871d0d500f44bd49cb0c45df14cf2c3
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
M hw/block/trace-events
Log Message:
-----------
hw/block/nvme: remove the req dependency in map functions
The PRP and SGL mapping functions does not have any particular need for
the entire NvmeRequest as a parameter. Clean it up.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Commit: 81d07f4ff51a2b5249f940975acfb9b0d787d593
https://github.com/qemu/qemu/commit/81d07f4ff51a2b5249f940975acfb9b0d787d593
Author: Klaus Jensen <k.jensen@samsung.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
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>
Commit: 037953b5b299daec4d92253858de32c15dd4e9f4
https://github.com/qemu/qemu/commit/037953b5b299daec4d92253858de32c15dd4e9f4
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme-ns.c
M hw/block/nvme-ns.h
M hw/block/nvme-subsys.h
M hw/block/nvme.c
M hw/block/nvme.h
Log Message:
-----------
hw/block/nvme: support namespace detach
Given that now we have nvme-subsys device supported, we can manage
namespace allocated, but not attached: detached. This patch introduced
a parameter for nvme-ns device named 'detached'. This parameter
indicates whether the given namespace device is detached from
a entire NVMe subsystem('subsys' given case, shared namespace) or a
controller('bus' given case, private namespace).
- Allocated namespace
1) Shared ns in the subsystem 'subsys0':
-device nvme-ns,id=ns1,drive=blknvme0,nsid=1,subsys=subsys0,detached=true
2) Private ns for the controller 'nvme0' of the subsystem 'subsys0':
-device nvme-subsys,id=subsys0
-device nvme,serial=foo,id=nvme0,subsys=subsys0
-device nvme-ns,id=ns1,drive=blknvme0,nsid=1,bus=nvme0,detached=true
3) (Invalid case) Controller 'nvme0' has no subsystem to manage ns:
-device nvme,serial=foo,id=nvme0
-device nvme-ns,id=ns1,drive=blknvme0,nsid=1,bus=nvme0,detached=true
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: 5215e60600b0bc0a011f4456e0f0a0d9376d9133
https://github.com/qemu/qemu/commit/5215e60600b0bc0a011f4456e0f0a0d9376d9133
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme-subsys.h
Log Message:
-----------
hw/block/nvme: fix namespaces array to 1-based
subsys->namespaces array used to be sized to NVME_SUBSYS_MAX_NAMESPACES.
But subsys->namespaces are being accessed with 1-based namespace id
which means the very first array entry will always be empty(NULL).
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: 92cad003c131c1866580beb4c00e19551652be8d
https://github.com/qemu/qemu/commit/92cad003c131c1866580beb4c00e19551652be8d
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme-subsys.h
M hw/block/nvme.h
Log Message:
-----------
hw/block/nvme: fix allocated namespace list to 256
Expand allocated namespace list (subsys->namespaces) to have 256 entries
which is a value lager than at least NVME_MAX_NAMESPACES which is for
attached namespace list in a controller.
Allocated namespace list should at least larger than attached namespace
list.
n->num_namespaces = NVME_MAX_NAMESPACES;
The above line will set the NN field by id->nn so that the subsystem
should also prepare at least this number of namespace list entries.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: 94d8d6d1678156dfc7244beef75c05db52965d60
https://github.com/qemu/qemu/commit/94d8d6d1678156dfc7244beef75c05db52965d60
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme-subsys.h
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: support allocated namespace type
>From NVMe spec 1.4b "6.1.5. NSID and Namespace Relationships" defines
valid namespace types:
- Unallocated: Not exists in the NVMe subsystem
- Allocated: Exists in the NVMe subsystem
- Inactive: Not attached to the controller
- Active: Attached to the controller
This patch added support for allocated, but not attached namespace type:
!nvme_ns(n, nsid) && nvme_subsys_ns(n->subsys, nsid)
nvme_ns() returns attached namespace instance of the given controller
and nvme_subsys_ns() returns allocated namespace instance in the
subsystem.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: 1f46660788542ae7f86e18bc4de14bc4b642423d
https://github.com/qemu/qemu/commit/1f46660788542ae7f86e18bc4de14bc4b642423d
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
Log Message:
-----------
hw/block/nvme: refactor nvme_select_ns_iocs
This patch has no functional changes. This patch just refactored
nvme_select_ns_iocs() to iterate the attached namespaces of the
controlller and make it invoke __nvme_select_ns_iocs().
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: 645ce1a70cb6bedc85a11edb547db091375dea55
https://github.com/qemu/qemu/commit/645ce1a70cb6bedc85a11edb547db091375dea55
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme-subsys.h
M hw/block/nvme.c
M hw/block/nvme.h
M hw/block/trace-events
M include/block/nvme.h
Log Message:
-----------
hw/block/nvme: support namespace attachment command
This patch supports Namespace Attachment command for the pre-defined
nvme-ns device nodes. Of course, attach/detach namespace should only be
supported in case 'subsys' is given. This is because if we detach a
namespace from a controller, somebody needs to manage the detached, but
allocated namespace in the NVMe subsystem.
As command effect for the namespace attachment command is registered,
the host will be notified that namespace inventory is changed so that
host will rescan the namespace inventory after this command. For
example, kernel driver manages this command effect via passthru IOCTL.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
[k.jensen: rebased for dma refactor]
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: f432fdfa1215bc3a00468b2e711176be279b0fd2
https://github.com/qemu/qemu/commit/f432fdfa1215bc3a00468b2e711176be279b0fd2
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme-ns.h
M hw/block/nvme.c
M hw/block/nvme.h
M include/block/nvme.h
Log Message:
-----------
hw/block/nvme: support changed namespace asynchronous event
If namespace inventory is changed due to some reasons (e.g., namespace
attachment/detachment), controller can send out event notifier to the
host to manage namespaces.
This patch sends out the AEN to the host after either attach or detach
namespaces from controllers. To support clear of the event from the
controller, this patch also implemented Get Log Page command for Changed
Namespace List log type. To return namespace id list through the
command, when namespace inventory is updated, id is added to the
per-controller list (changed_ns_list).
To indicate the support of this async event, this patch set
OAES(Optional Asynchronous Events Supported) in Identify Controller data
structure.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: 23fb7dfeca17c55e4329ca98459d33fc204c1f59
https://github.com/qemu/qemu/commit/23fb7dfeca17c55e4329ca98459d33fc204c1f59
Author: Minwoo Im <minwoo.im.dev@gmail.com>
Date: 2021-03-09 (Tue, 09 Mar 2021)
Changed paths:
M hw/block/nvme.c
M hw/block/trace-events
M include/block/nvme.h
Log Message:
-----------
hw/block/nvme: support Identify NS Attached Controller List
Support Identify command for Namespace attached controller list. This
command handler will traverse the controller instances in the given
subsystem to figure out whether the specified nsid is attached to the
controllers or not.
The 4096bytes Identify data will return with the first entry (16bits)
indicating the number of the controller id entries. So, the data can
hold up to 2047 entries for the controller ids.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Klaus Jensen <k.jensen@samsung.com>
[k.jensen: rebased for dma refactor]
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Commit: d689ecad073e0289afa8ca863e45879d719e5c21
https://github.com/qemu/qemu/commit/d689ecad073e0289afa8ca863e45879d719e5c21
Author: Peter Maydell <peter.maydell@linaro.org>
Date: 2021-03-10 (Wed, 10 Mar 2021)
Changed paths:
M hw/block/meson.build
M hw/block/nvme-ns.c
M hw/block/nvme-ns.h
A hw/block/nvme-subsys.c
A hw/block/nvme-subsys.h
M hw/block/nvme.c
M hw/block/nvme.h
M hw/block/trace-events
M include/block/nvme.h
Log Message:
-----------
Merge remote-tracking branch 'remotes/nvme/tags/nvme-next-pull-request' into
staging
hw/block/nvme updates
* NVMe subsystem support (`-device nvme-subsys`) (Minwoo Im)
* Namespace (De|At)tachment support (Minwoo Im)
* Simple Copy command support (Klaus Jensen)
* Flush broadcast support (Gollu Appalanaidu)
* QEMUIOVector/QEMUSGList duality refactoring (Klaus Jensen)
plus various fixes from Minwoo, Gollu, Dmitry and me.
v2:
- add `nqn` nvme-subsys device parameter instead of using `id`.
(Paolo)
# gpg: Signature made Tue 09 Mar 2021 11:44:17 GMT
# gpg: using RSA key 522833AA75E2DCE6A24766C04DE1AF316D4F0DE9
# gpg: Good signature from "Klaus Jensen <its@irrelevant.dk>" [unknown]
# gpg: aka "Klaus Jensen <k.jensen@samsung.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: DDCA 4D9C 9EF9 31CC 3468 4272 63D5 6FC5 E55D A838
# Subkey fingerprint: 5228 33AA 75E2 DCE6 A247 66C0 4DE1 AF31 6D4F 0DE9
* remotes/nvme/tags/nvme-next-pull-request: (38 commits)
hw/block/nvme: support Identify NS Attached Controller List
hw/block/nvme: support changed namespace asynchronous event
hw/block/nvme: support namespace attachment command
hw/block/nvme: refactor nvme_select_ns_iocs
hw/block/nvme: support allocated namespace type
hw/block/nvme: fix allocated namespace list to 256
hw/block/nvme: fix namespaces array to 1-based
hw/block/nvme: support namespace detach
hw/block/nvme: refactor nvme_dma
hw/block/nvme: remove the req dependency in map functions
hw/block/nvme: try to deal with the iov/qsg duality
hw/block/nvme: fix strerror printing
hw/block/nvme: remove block accounting for write zeroes
hw/block/nvme: remove redundant len member in compare context
hw/block/nvme: report non-mdts command size limit for dsm
hw/block/nvme: add trace event for zone read check
hw/block/nvme: fix potential compilation error
hw/block/nvme: add identify trace event
hw/block/nvme: remove unnecessary endian conversion
hw/block/nvme: align zoned.zasl with mdts
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Compare: https://github.com/qemu/qemu/compare/821e7ed167f1...d689ecad073e
- [Qemu-commits] [qemu/qemu] eb2e89: hw/block/nvme: introduce nvme-subsys device,
Peter Maydell <=