- 04 6月, 2022 1 次提交
-
-
由 Klaus Jensen 提交于
The Identify Controller Serial Number (SN) is the serial number for the NVM subsystem and must be the same across all controller in the NVM subsystem. Enforce this. Reviewed-by: NChristoph Hellwig <hch@lst.de> Reviewed-by: NKeith Busch <kbusch@kernel.org> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
- 11 5月, 2022 1 次提交
-
-
由 Markus Armbruster 提交于
Header guard symbols should match their file name to make guard collisions less likely. Cleaned up with scripts/clean-header-guards.pl, followed by some renaming of new guard symbols picked by the script to better ones. Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Message-Id: <20220506134911.2856099-2-armbru@redhat.com> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> [Change to generated file ebpf/rss.bpf.skeleton.h backed out]
-
- 03 3月, 2022 4 次提交
-
-
由 Naveen Nagar 提交于
This adds support for one possible new protection information format introduced in TP4068 (and integrated in NVMe 2.0): the 64-bit CRC guard and 48-bit reference tag. This version does not support storage tags. Like the CRC16 support already present, this uses a software implementation of CRC64 (so it is naturally pretty slow). But its good enough for verification purposes. This may go nicely hand-in-hand with the support that Keith submitted for the Linux kernel[1]. [1]: https://lore.kernel.org/linux-nvme/20220126165214.GA1782352@dhcp-10-100-145-180.wdc.com/T/Reviewed-by: NKeith Busch <kbusch@kernel.org> Signed-off-by: NNaveen Nagar <naveen.n1@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Naveen Nagar 提交于
Add support for up to 64 LBA formats through the LBAFEE field of the Host Behavior Support feature. Reviewed-by: NKeith Busch <kbusch@kernel.org> Signed-off-by: NNaveen Nagar <naveen.n1@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Naveen Nagar 提交于
Add support for getting and setting the Host Behavior Support feature. Reviewed-by: NKeith Busch <kbusch@kernel.org> Signed-off-by: NNaveen Nagar <naveen.n1@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Klaus Jensen 提交于
Move dif/pi data structures and inlines to dif.h. Reviewed-by: NKeith Busch <kbusch@kernel.org> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
- 14 2月, 2022 2 次提交
-
-
由 Klaus Jensen 提交于
Add support for TP 4076 ("Zoned Random Write Area"), v2021.08.23 ("Ratified"). This adds three new namespace parameters: "zoned.numzrwa" (number of zrwa resources, i.e. number of zones that can have a zrwa), "zoned.zrwas" (zrwa size in LBAs), "zoned.zrwafg" (granularity in LBAs for flushes). Reviewed-by: NKeith Busch <kbusch@kernel.org> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Philippe Mathieu-Daudé 提交于
These buffers can be anything, not an array of chars, so use the 'void *' type for them. Signed-off-by: NPhilippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: NKlaus Jensen <k.jensen@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
- 27 7月, 2021 3 次提交
-
-
由 Klaus Jensen 提交于
Prior to this patch the nvme-ns devices are always children of the NvmeBus owned by the NvmeCtrl. This causes the namespaces to be unrealized when the parent device is removed. However, when subsystems are involved, this is not what we want since the namespaces may be attached to other controllers as well. This patch adds an additional NvmeBus on the subsystem device. When nvme-ns devices are realized, if the parent controller device is linked to a subsystem, the parent bus is set to the subsystem one instead. This makes sure that namespaces are kept alive and not unrealized. Reviewed-by: NHannes Reinecke <hare@suse.de> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Klaus Jensen 提交于
Make sure the controller is unregistered from the subsystem when device is removed. Reviewed-by: NHannes Reinecke <hare@suse.de> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Klaus Jensen 提交于
The nvme_ns_setup and nvme_ns_check_constraints should not depend on the controller state. Refactor and remove it. Reviewed-by: NHannes Reinecke <hare@suse.de> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
- 29 6月, 2021 7 次提交
-
-
由 Klaus Jensen 提交于
Jakub noticed[1] that, when using pin-based interrupts, the device will unconditionally deasssert when any CQEs are acknowledged. However, the pin should not be deasserted if other completion queues still holds unacknowledged CQEs. The bug is an artifact of commit ca247d35 ("hw/block/nvme: fix pin-based interrupt behavior") which fixed one bug but introduced another. This is the third time someone tries to fix pin-based interrupts (see commit 5e9aa92e ("hw/block: Fix pin-based interrupt behaviour of NVMe"))... Third time's the charm, so fix it, again, by keeping track of how many CQs have unacknowledged CQEs and only deassert when all are cleared. [1]: <20210610114624.304681-1-jakub.jermar@kernkonzept.com> Cc: qemu-stable@nongnu.org Fixes: ca247d35 ("hw/block/nvme: fix pin-based interrupt behavior") Reported-by: NJakub Jermář <jakub.jermar@kernkonzept.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
The nvme_check_prinfo() and nvme_dif_check() functions operate on the 16 bit "control" member of the NvmeCmd. These functions do not otherwise operate on an NvmeCmd or an NvmeRequest, so change them to expect the actual 4 bit PRINFO field and add constants that work on this field as well. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Prepare nvme_dif_pract_generate_dif() and nvme_dif_check() to be callable in smaller increments by making the reftag a pointer parameter updated by the function. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Prior to this patch, a broadcast flush would result in submitting multiple "fire and forget" aios (no reference saved to the aiocbs returned from the blk_aio_flush calls). Fix this by issuing the flushes one after another. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Heinrich Schuchardt 提交于
On machines with version > 6.0 replace a missing EUI-64 by a generated value. Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Heinrich Schuchardt 提交于
The EUI-64 field is the only identifier for NVMe namespaces in UEFI device paths. Add a new namespace property "eui64", that provides the user the option to specify the EUI-64. Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Niklas Cassel 提交于
In the Zoned Namespace Command Set Specification, chapter 2.5.1 Managing resources "The controller may transition zones in the ZSIO:Implicitly Opened state to the ZSC:Closed state for resource management purposes." The word may in this sentence means that automatically transitioning an implicitly opened zone to closed is completely optional. Add a new parameter so that the user can control if this automatic transitioning should be performed or not. Being able to control this can help with verifying that e.g. a user-space program behaves properly even without this optional ZNS feature. The default value is set to true, in order to not change the existing behavior. Signed-off-by: NNiklas Cassel <niklas.cassel@wdc.com> [k.jensen: moved parameter to controller] Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
- 17 5月, 2021 8 次提交
-
-
由 Klaus Jensen 提交于
With the introduction of the nvme-subsystem device we are really cluttering up the hw/block directory. As suggested by Philippe previously, move the nvme emulation to hw/nvme. Suggested-by: NPhilippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
The NvmeCtrl num_namespaces member is just an indirection for the NVME_MAX_NAMESPACES constant. Remove the indirection. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Streamline namespace array indexing such that both the subsystem and controller namespaces arrays are 1-indexed. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Add an nvme_moff() helper. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
There is no need to look up the lba size and metadata size in the LBA Format structure everytime we want to use it. And we use it a lot. Cache the values in the NvmeNamespace and update them if the namespace is formatted. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
The inline nvme_ns_status() helper only has a single call site. Remove it from the header file and inline it for real. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Remove non-shared defines from the shared header. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
In preparation for moving the nvme device into its own subtree, merge the header files into one. Also add missing copyright notice and add list of authors with substantial contributions. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
- 07 4月, 2021 3 次提交
-
-
由 Klaus Jensen 提交于
Prior to this patch, if a private nvme-ns device (that is, a namespace that is not linked to a subsystem) is wired up to an nvme-subsys linked nvme controller device, the device fails to verify that the namespace id is unique within the subsystem. NVM Express v1.4b, Section 6.1.6 ("NSID and Namespace Usage") states that because the device supports Namespace Management, "NSIDs *shall* be unique within the NVM subsystem". Additionally, prior to this patch, private namespaces are not known to the subsystem and the namespace is considered exclusive to the controller with which it is initially wired up to. However, this is not the definition of a private namespace; per Section 1.6.33 ("private namespace"), a private namespace is just a namespace that does not support multipath I/O or namespace sharing, which means "that it is only able to be attached to one controller at a time". Fix this by always allocating namespaces in the subsystem (if one is linked to the controller), regardless of the shared/private status of the namespace. Whether or not the namespace is shareable is controlled by a new `shared` nvme-ns parameter. Finally, this fix allows the nvme-ns `subsys` parameter to be removed, since the `shared` parameter now serves the purpose of attaching the namespace to all controllers in the subsystem upon device realization. It is invalid to have an nvme-ns namespace device with a linked subsystem without the parent nvme controller device also being linked to one and since the nvme-ns devices will unconditionally be "attached" (in QEMU terms that is) to an nvme controller device through an NvmeBus, the nvme-ns namespace device can always get a reference to the subsystem of the controller it is explicitly (using 'bus=' parameter) or implicitly attaching to. Fixes: e5707685 ("hw/block/nvme: support for shared namespace in subsystem") Cc: Minwoo Im <minwoo.im.dev@gmail.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NGollu Appalanaidu <anaidu.gollu@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Reviewed-by: NMinwoo Im <minwoo.im.dev@gmail.com>
-
由 Klaus Jensen 提交于
Remove the unused BlockConf from the controller structure and remove the noop constraint checking. Device works just fine with both legacy drive parameter namespace and nvme-ns namespace definitions. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NGollu Appalanaidu <anaidu.gollu@samsung.com>
-
由 Klaus Jensen 提交于
Add the missing nvme_adm_opc_str entry for the Namespace Attachment command. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NGollu Appalanaidu <anaidu.gollu@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
- 18 3月, 2021 5 次提交
-
-
由 Minwoo Im 提交于
Format NVM admin command can make a namespace or namespaces to be with different LBA size and metadata size with protection information types. This patch introduces Format NVM command with LBA format, Metadata, and Protection Information for the device. The secure erase operation things and support for formatting zoned namespaces are yet to be added. The parameter checks inside of this patch has been referred from Keith's old branch. Signed-off-by: NMinwoo Im <minwoo.im@samsung.com> [anaidu.gollu: rebased on e2e] Signed-off-by: NGollu Appalanaidu <anaidu.gollu@samsung.com> [k.jensen: rebased for reworked aio tracking] Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Verify is not subject to MDTS, so a single Verify command may result in excessive amounts of allocated memory. Impose a limit on the data size by adding support for TP 4040 ("Non-MDTS Command Size Limits"). Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Gollu Appalanaidu 提交于
See NVM Express 1.4, section 6.14 ("Verify Command"). Signed-off-by: NGollu Appalanaidu <anaidu.gollu@samsung.com> [k.jensen: rebased, refactored for e2e] Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Add support for namespaces formatted with protection information. The type of end-to-end data protection (i.e. Type 1, Type 2 or Type 3) is selected with the `pi` nvme-ns device parameter. If the number of metadata bytes is larger than 8, the `pil` nvme-ns device parameter may be used to control the location of the 8-byte DIF tuple. The default `pil` value of '0', causes the DIF tuple to be transferred as the last 8 bytes of the metadata. Set to 1 to store this in the first eight bytes instead. Co-authored-by: NGollu Appalanaidu <anaidu.gollu@samsung.com> Signed-off-by: NGollu Appalanaidu <anaidu.gollu@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Coverity complains about a possible memory corruption in the nvme_ns_attach and _detach functions. While we should not (famous last words) be able to reach this function without nsid having previously been validated, this is still an open door for future misuse. Make Coverity and maintainers happy by asserting that the index into the array is valid. Also, while not detected by Coverity (yet), add an assert in nvme_subsys_ns and nvme_subsys_register_ns as well since a similar issue is exists there. Fixes: 037953b5 ("hw/block/nvme: support namespace detach") Fixes: CID 1450757 Fixes: CID 1450758 Cc: Minwoo Im <minwoo.im.dev@gmail.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
-
- 09 3月, 2021 6 次提交
-
-
由 Minwoo Im 提交于
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: NMinwoo Im <minwoo.im.dev@gmail.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Reviewed-by: NKlaus Jensen <k.jensen@samsung.com> Tested-by: NKlaus Jensen <k.jensen@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Minwoo Im 提交于
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: NMinwoo Im <minwoo.im.dev@gmail.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Reviewed-by: NKlaus Jensen <k.jensen@samsung.com> Tested-by: NKlaus Jensen <k.jensen@samsung.com> [k.jensen: rebased for dma refactor] Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Minwoo Im 提交于
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: NMinwoo Im <minwoo.im.dev@gmail.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Reviewed-by: NKlaus Jensen <k.jensen@samsung.com> Tested-by: NKlaus Jensen <k.jensen@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Minwoo Im 提交于
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: NMinwoo Im <minwoo.im.dev@gmail.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Klaus Jensen 提交于
Introduce NvmeSg and try to deal with that pesky qsg/iov duality that haunts all the memory-related functions. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Gollu Appalanaidu 提交于
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: NGollu Appalanaidu <anaidu.gollu@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-