<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/nvme/target/admin-cmd.c, branch linux-5.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-05-25T07:59:01Z</updated>
<entry>
<title>nvmet: use a private workqueue instead of the system workqueue</title>
<updated>2022-05-25T07:59:01Z</updated>
<author>
<name>Sagi Grimberg</name>
</author>
<published>2022-03-21T11:57:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=84026f8c9357c62a9d3e4c554ffd10ccab813654'/>
<id>urn:sha1:84026f8c9357c62a9d3e4c554ffd10ccab813654</id>
<content type='text'>
[ Upstream commit 8832cf922151e9dfa2821736beb0ae2dd3968b6e ]

Any attempt to flush kernel-global WQs has possibility of deadlock
so we should simply stop using them, instead introduce nvmet_wq
which is the generic nvmet workqueue for work elements that
don't explicitly require a dedicated workqueue (by the mere fact
that they are using the system_wq).

Changes were done using the following replaces:

 - s/schedule_work(/queue_work(nvmet_wq, /g
 - s/schedule_delayed_work(/queue_delayed_work(nvmet_wq, /g
 - s/flush_scheduled_work()/flush_workqueue(nvmet_wq)/g

Reported-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Chaitanya Kulkarni &lt;kch@nvidia.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet: use flex_array_size and struct_size</title>
<updated>2021-10-27T06:06:41Z</updated>
<author>
<name>Len Baker</name>
</author>
<published>2021-10-24T17:29:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d156cfcafbd0eae4224ea007d95ebda467eb0c46'/>
<id>urn:sha1:d156cfcafbd0eae4224ea007d95ebda467eb0c46</id>
<content type='text'>
In an effort to avoid open-coded arithmetic in the kernel [1], use the
flex_array_size() and struct_size() helpers instead of an open-coded
calculation.

[1] https://github.com/KSPP/linux/issues/160

Signed-off-by: Len Baker &lt;len.baker@gmx.com&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Reviewed-by: Chaitanya Kulkarni &lt;kch@nvidia.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: use struct_size over open coded arithmetic</title>
<updated>2021-10-20T17:23:30Z</updated>
<author>
<name>Len Baker</name>
</author>
<published>2021-10-17T09:56:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=117d5b6d00ee02f73d7065fe906e2ef1af74bb68'/>
<id>urn:sha1:117d5b6d00ee02f73d7065fe906e2ef1af74bb68</id>
<content type='text'>
As noted in the "Deprecated Interfaces, Language Features, Attributes,
and Conventions" documentation [1], size calculations (especially
multiplication) should not be performed in memory allocator (or similar)
function arguments due to the risk of them overflowing. This could lead
to values wrapping around and a smaller allocation being made than the
caller was expecting. Using those allocations could lead to linear
overflows of heap memory and other misbehaviors.

In this case this is not actually dynamic size: all the operands
involved in the calculation are constant values. However it is better to
refactor this anyway, just to keep the open-coded math idiom out of
code.

So, use the struct_size() helper to do the arithmetic instead of the
argument "size + count * size" in the kmalloc() function.

This code was detected with the help of Coccinelle and audited and fixed
manually.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments

Signed-off-by: Len Baker &lt;len.baker@gmx.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: use macro definitions for setting cmic value</title>
<updated>2021-10-20T17:16:03Z</updated>
<author>
<name>Max Gurtovoy</name>
</author>
<published>2021-09-23T10:17:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d56ae18f063e38eba47550c632519c9fe3f76b19'/>
<id>urn:sha1:d56ae18f063e38eba47550c632519c9fe3f76b19</id>
<content type='text'>
This makes the code more readable.

Signed-off-by: Max Gurtovoy &lt;mgurtovoy@nvidia.com&gt;
Reviewed-by: Chaitanya Kulkarni &lt;kch@nvidia.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: use macro definition for setting nmic value</title>
<updated>2021-10-20T17:16:02Z</updated>
<author>
<name>Max Gurtovoy</name>
</author>
<published>2021-09-23T10:17:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=571b5444d1eee112e82eebd0cf877dc510b8b5a5'/>
<id>urn:sha1:571b5444d1eee112e82eebd0cf877dc510b8b5a5</id>
<content type='text'>
This makes the code more readable.

Signed-off-by: Max Gurtovoy &lt;mgurtovoy@nvidia.com&gt;
Reviewed-by: Keith Busch &lt;kbusch@kernel.org&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Chaitanya Kulkarni &lt;kch@nvidia.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: set 'CNTRLTYPE' in the identify controller data</title>
<updated>2021-10-20T17:16:02Z</updated>
<author>
<name>Hannes Reinecke</name>
</author>
<published>2021-09-22T06:35:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d3aef70124e7f69975eabeb340866bc91672532d'/>
<id>urn:sha1:d3aef70124e7f69975eabeb340866bc91672532d</id>
<content type='text'>
Set the correct 'CNTRLTYPE' field in the identify controller data.

Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Chaitanya Kulkarni &lt;kch@nvidia.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: add nvmet_is_disc_subsys() helper</title>
<updated>2021-10-20T17:16:02Z</updated>
<author>
<name>Hannes Reinecke</name>
</author>
<published>2021-09-22T06:35:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a294711ed5123f757ed8ed2f103c851b8ee416c9'/>
<id>urn:sha1:a294711ed5123f757ed8ed2f103c851b8ee416c9</id>
<content type='text'>
Add a helper function to determine if a given subsystem is a discovery
subsystem.

Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Chaitanya Kulkarni &lt;kch@nvidia.com&gt;
Reviewed-by: Himanshu Madhani &lt;himanshu.madhani@oracle.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: return bool from nvmet_passthru_ctrl and nvmet_is_passthru_req</title>
<updated>2021-09-06T07:59:03Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-08-27T06:11:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ab7a2737ac5acd7d485ca45d8772497717fbc781'/>
<id>urn:sha1:ab7a2737ac5acd7d485ca45d8772497717fbc781</id>
<content type='text'>
The target core code never needs the host-side nvme_ctrl structure.
Open code two uses of nvmet_is_passthru_req in passthru.c, and then
switch the helpers used by the core to return bool.  Also rename the
fuctions to better match their usage:

  nvmet_passthru_ctrl -&gt; nvmet_is_passthru_subsys
  nvmet_req_passthru_ctrl -&gt; nvmet_is_passthru_req

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
</content>
</entry>
<entry>
<title>nvmet: use NVMET_MAX_NAMESPACES to set nn value</title>
<updated>2021-06-21T06:34:10Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-06-21T03:01:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3c3ee16532c1be92350a2a88bd19283b7bdf32e9'/>
<id>urn:sha1:3c3ee16532c1be92350a2a88bd19283b7bdf32e9</id>
<content type='text'>
For Spec regarding MNAN value:-

If the controller supports Asymmetric Namespace Access Reporting, then
this field shall be set to a non-zero value that is less than or equal
to the NN value.

Instead of using subsys-&gt;max_nsid that gets calculated dynamically,
use NVMET_MAX_NAMESPACES value to report NN. This way we will maintain
the MNAN value spec compliant with NN.

Without this patch, code results in the following error :-

[337976.409142] nvme nvme1: Invalid MNAN value 1024

Signed-off-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: add ZBD over ZNS backend support</title>
<updated>2021-06-17T13:51:21Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-06-10T01:32:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aaf2e048af2704da5869f27b508b288f36d5c7b7'/>
<id>urn:sha1:aaf2e048af2704da5869f27b508b288f36d5c7b7</id>
<content type='text'>
NVMe TP 4053 – Zoned Namespaces (ZNS) allows host software to
communicate with a non-volatile memory subsystem using zones for NVMe
protocol-based controllers. NVMeOF already support the ZNS NVMe
Protocol compliant devices on the target in the passthru mode. There
are generic zoned block devices like  Shingled Magnetic Recording (SMR)
HDDs that are not based on the NVMe protocol.

This patch adds ZNS backend support for non-ZNS zoned block devices as
NVMeOF targets.

This support includes implementing the new command set NVME_CSI_ZNS,
adding different command handlers for ZNS command set such as NVMe
Identify Controller, NVMe Identify Namespace, NVMe Zone Append,
NVMe Zone Management Send and NVMe Zone Management Receive.

With the new command set identifier, we also update the target command
effects logs to reflect the ZNS compliant commands.

Signed-off-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Reviewed-by: Damien Le Moal &lt;damien.lemoal@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
</feed>
