<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/nvme/target/core.c, branch linux-5.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-06-16T10:05:03Z</updated>
<entry>
<title>nvmet: fix false keep-alive timeout when a controller is torn down</title>
<updated>2021-06-16T10:05:03Z</updated>
<author>
<name>Sagi Grimberg</name>
</author>
<published>2021-05-25T15:49:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=983b52636a439368272313585ab27d7addc92bf8'/>
<id>urn:sha1:983b52636a439368272313585ab27d7addc92bf8</id>
<content type='text'>
[ Upstream commit aaeadd7075dc9e184bc7876e9dd7b3bada771df2 ]

Controller teardown flow may take some time in case it has many I/O
queues, and the host may not send us keep-alive during this period.
Hence reset the traffic based keep-alive timer so we don't trigger
a controller teardown as a result of a keep-alive expiration.

Reported-by: Yi Zhang &lt;yi.zhang@redhat.com&gt;
Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Tested-by: Yi Zhang &lt;yi.zhang@redhat.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: fix freeing unallocated p2pmem</title>
<updated>2021-06-10T11:41:36Z</updated>
<author>
<name>Max Gurtovoy</name>
</author>
<published>2021-06-01T16:22:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8a452d62e7cea3c8a2676a3b89a9118755a1a271'/>
<id>urn:sha1:8a452d62e7cea3c8a2676a3b89a9118755a1a271</id>
<content type='text'>
[ Upstream commit bcd9a0797d73eeff659582f23277e7ab6e5f18f3 ]

In case p2p device was found but the p2p pool is empty, the nvme target
is still trying to free the sgl from the p2p pool instead of the
regular sgl pool and causing a crash (BUG() is called). Instead, assign
the p2p_dev for the request only if it was allocated from p2p pool.

This is the crash that was caused:

[Sun May 30 19:13:53 2021] ------------[ cut here ]------------
[Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518!
[Sun May 30 19:13:53 2021] invalid opcode: 0000 [#1] SMP PTI
...
[Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518!
...
[Sun May 30 19:13:53 2021] RIP: 0010:gen_pool_free_owner+0xa8/0xb0
...
[Sun May 30 19:13:53 2021] Call Trace:
[Sun May 30 19:13:53 2021] ------------[ cut here ]------------
[Sun May 30 19:13:53 2021]  pci_free_p2pmem+0x2b/0x70
[Sun May 30 19:13:53 2021]  pci_p2pmem_free_sgl+0x4f/0x80
[Sun May 30 19:13:53 2021]  nvmet_req_free_sgls+0x1e/0x80 [nvmet]
[Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518!
[Sun May 30 19:13:53 2021]  nvmet_rdma_release_rsp+0x4e/0x1f0 [nvmet_rdma]
[Sun May 30 19:13:53 2021]  nvmet_rdma_send_done+0x1c/0x60 [nvmet_rdma]

Fixes: c6e3f1339812 ("nvmet: add metadata support for block devices")
Reviewed-by: Israel Rukshin &lt;israelr@nvidia.com&gt;
Signed-off-by: Max Gurtovoy &lt;mgurtovoy@nvidia.com&gt;
Reviewed-by: Logan Gunthorpe &lt;logang@deltatee.com&gt;
Reviewed-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.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: fix memory leak in nvmet_alloc_ctrl()</title>
<updated>2021-05-26T10:59:04Z</updated>
<author>
<name>Wu Bo</name>
</author>
<published>2021-05-19T05:01:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=afb680ed7ecbb7fd66ddb43650e9b533fd8b4b9a'/>
<id>urn:sha1:afb680ed7ecbb7fd66ddb43650e9b533fd8b4b9a</id>
<content type='text'>
[ Upstream commit fec356a61aa3d3a66416b4321f1279e09e0f256f ]

When creating ctrl in nvmet_alloc_ctrl(), if the cntlid_min is larger
than cntlid_max of the subsystem, and jumps to the
"out_free_changed_ns_list" label, but the ctrl-&gt;sqs lack of be freed.
Fix this by jumping to the "out_free_sqs" label.

Fixes: 94a39d61f80f ("nvmet: make ctrl-id configurable")
Signed-off-by: Wu Bo &lt;wubo40@huawei.com&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.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: don't check iosqes,iocqes for discovery controllers</title>
<updated>2021-03-18T04:39:02Z</updated>
<author>
<name>Sagi Grimberg</name>
</author>
<published>2021-03-15T22:34:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d218a8a3003e84ab136e69a4e30dd4ec7dab2d22'/>
<id>urn:sha1:d218a8a3003e84ab136e69a4e30dd4ec7dab2d22</id>
<content type='text'>
From the base spec, Figure 78:

  "Controller Configuration, these fields are defined as parameters to
   configure an "I/O Controller (IOC)" and not to configure a "Discovery
   Controller (DC).

   ...
   If the controller does not support I/O queues, then this field shall
   be read-only with a value of 0h

Just perform this check for I/O controllers.

Fixes: a07b4970f464 ("nvmet: add a generic NVMe target")
Reported-by: Belanger, Martin &lt;Martin.Belanger@dell.com&gt;
Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: model_number must be immutable once set</title>
<updated>2021-03-05T12:41:03Z</updated>
<author>
<name>Max Gurtovoy</name>
</author>
<published>2021-02-17T17:19:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d9f273b7585c380d7a10d4b3187ddc2d37f2740b'/>
<id>urn:sha1:d9f273b7585c380d7a10d4b3187ddc2d37f2740b</id>
<content type='text'>
In case we have already established connection to nvmf target, it
shouldn't be allowed to change the model_number. E.g. if someone will
identify ctrl and get model_number of "my_model" later on will change
the model_numbel via configfs to "my_new_model" this will break the NVMe
specification for "Get Log Page – Persistent Event Log" that refers to
Model Number as: "This field contains the same value as reported in the
Model Number field of the Identify Controller data structure, bytes
63:24."

Although it doesn't mentioned explicitly that this field can't be
changed, we can assume it.

So allow setting this field only once: using configfs or in the first
identify ctrl operation.

Signed-off-by: Max Gurtovoy &lt;mgurtovoy@nvidia.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: remove else at the end of the function</title>
<updated>2021-02-10T15:38:06Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-02-10T05:48:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=295a39f5a56f3276bae6a0ae5c26ce06bb8aa21c'/>
<id>urn:sha1:295a39f5a56f3276bae6a0ae5c26ce06bb8aa21c</id>
<content type='text'>
The function nvmet_parse_io_cmd() returns value from
nvmet_file_parse_io_cmd() or nvmet_bdev_parse_io_cmd() based on which
backend is set for the request. Remove the else and just return the
value from nvmet_bdev_parse_io_cmd().

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 nvmet_req_subsys() helper</title>
<updated>2021-02-10T15:38:05Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-02-10T05:48:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=20c2c3bb83f26c42bf62cc773f96f30848ed11a2'/>
<id>urn:sha1:20c2c3bb83f26c42bf62cc773f96f30848ed11a2</id>
<content type='text'>
Just like what we have to get the passthru ctrl from the req, add an
helper to get the subsystem associated with the nvmet_req() instead
of open coding the chain of structures.

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 helper to report invalid opcode</title>
<updated>2021-02-10T15:38:05Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-02-10T05:47:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d81d57cf1b4702b7c2fa8ce8f1d5c6961a0c20b5'/>
<id>urn:sha1:d81d57cf1b4702b7c2fa8ce8f1d5c6961a0c20b5</id>
<content type='text'>
In the NVMeOF block device backend, file backend, and passthru backend
we reject and report the commands if opcode is not handled.

Add an helper and use it in block device backend to keep the code
and error message uniform.

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: make nvmet_find_namespace() req based</title>
<updated>2021-02-10T15:38:04Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-02-10T05:47:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a1f7c79ae6d3dfdc16082daa44b3cf8dbe4f238'/>
<id>urn:sha1:3a1f7c79ae6d3dfdc16082daa44b3cf8dbe4f238</id>
<content type='text'>
The six callers of nvmet_find_namespace() duplicate the error log page
update and status setting code for each call on failure.

All callers are nvmet requests based functions, so we can pass req
to the nvmet_find_namesapce() &amp; derive ctrl from req, that'll allow us
to update the error log page in nvmet_find_namespace(). Now that we
pass the request we can also get rid of the local variable in
nvmet_find_namespace() and use the req-&gt;ns and return the error code.

Replace the ctrl parameter with nvmet_req for nvmet_find_namespace(),
centralize the error log page update for non allocated namesapces, and
return uniform error for non-allocated namespace.

The nvmet_find_namespace() takes nsid parameter which is from NVMe
commands structures such as get_log_page, identify, rw and common. All
these commands have same offset for the nsid field.

Derive nsid from req-&gt;cmd-&gt;common.nsid) &amp; remove the extra parameter
from the nvmet_find_namespace().

Lastly now we associate the ns to the req parameter that we pass to the
nvmet_find_namespace(), rename nvmet_find_namespace() to
nvmet_req_find_ns().

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: remove unused ctrl-&gt;cqs</title>
<updated>2020-12-01T19:36:36Z</updated>
<author>
<name>Amit</name>
</author>
<published>2020-11-15T12:19:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d65aeab7bf6e83e75f53cfdbdb84603e52e1182'/>
<id>urn:sha1:6d65aeab7bf6e83e75f53cfdbdb84603e52e1182</id>
<content type='text'>
remove unused cqs from nvmet_ctrl struct
this will reduce the allocated memory.

Signed-off-by: Amit &lt;amit.engel@dell.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
</feed>
