<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/nvme/host/rdma.c, branch linux-4.16.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-05-30T06:17:20+00:00</updated>
<entry>
<title>nvme: expand nvmf_check_if_ready checks</title>
<updated>2018-05-30T06:17:20+00:00</updated>
<author>
<name>James Smart</name>
<email>jsmart2021@gmail.com</email>
</author>
<published>2018-04-12T15:16:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e1329a2e91f8ea9e5f6a1cb84e6032df38793a1d'/>
<id>urn:sha1:e1329a2e91f8ea9e5f6a1cb84e6032df38793a1d</id>
<content type='text'>
[ Upstream commit bb06ec31452fb2da1594f88035c2ecea4e0652f4 ]

The nvmf_check_if_ready() checks that were added are very simplistic.
As such, the routine allows a lot of cases to fail ios during windows
of reset or re-connection. In cases where there are not multi-path
options present, the error goes back to the callee - the filesystem
or application. Not good.

The common routine was rewritten and calling syntax slightly expanded
so that per-transport is_ready routines don't need to be present.
The transports now call the routine directly. The routine is now a
fabrics routine rather than an inline function.

The routine now looks at controller state to decide the action to
take. Some states mandate io failure. Others define the condition where
a command can be accepted.  When the decision is unclear, a generic
queue-or-reject check is made to look for failfast or multipath ios and
only fails the io if it is so marked. Otherwise, the io will be queued
and wait for the controller state to resolve.

Admin commands issued via ioctl share a live admin queue with commands
from the transport for controller init. The ioctls could be intermixed
with the initialization commands. It's possible for the ioctl cmd to
be issued prior to the controller being enabled. To block this, the
ioctl admin commands need to be distinguished from admin commands used
for controller init. Added a USERCMD nvme_req(req)-&gt;rq_flags bit to
reflect this division and set it on ioctls requests.  As the
nvmf_check_if_ready() routine is called prior to nvme_setup_cmd(),
ensure that commands allocated by the ioctl path (actually anything
in core.c) preps the nvme_req(req) before starting the io. This will
preserve the USERCMD flag during execution and/or retry.

Signed-off-by: James Smart &lt;james.smart@broadcom.com&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.e&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Keith Busch &lt;keith.busch@intel.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-jens' of git://git.infradead.org/nvme into for-linus</title>
<updated>2018-02-28T19:18:58+00:00</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@kernel.dk</email>
</author>
<published>2018-02-28T19:18:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=468f098734ab095b72d8af26bcd4bcb2ed31a3be'/>
<id>urn:sha1:468f098734ab095b72d8af26bcd4bcb2ed31a3be</id>
<content type='text'>
Pull NVMe fixes from Keith for 4.16-rc.

* 'for-jens' of git://git.infradead.org/nvme:
  nvmet: fix PSDT field check in command format
  nvme-multipath: fix sysfs dangerously created links
  nvme-pci: Fix nvme queue cleanup if IRQ setup fails
  nvmet-loop: use blk_rq_payload_bytes for sgl selection
  nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes
  nvme-fabrics: don't check for non-NULL module in nvmf_register_transport
</content>
</entry>
<entry>
<title>nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes</title>
<updated>2018-02-22T08:45:32+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2018-02-22T15:24:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0d30992395b1ed0e006960de1651b44cd51be791'/>
<id>urn:sha1:0d30992395b1ed0e006960de1651b44cd51be791</id>
<content type='text'>
blk_rq_bytes does the wrong thing for special payloads like discards and
might cause the driver to not set up a SGL.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Keith Busch &lt;keith.busch@intel.com&gt;
</content>
</entry>
<entry>
<title>nvme-rdma: fix sysfs invoked reset_ctrl error flow</title>
<updated>2018-02-14T13:44:22+00:00</updated>
<author>
<name>Nitzan Carmi</name>
<email>nitzanc@mellanox.com</email>
</author>
<published>2018-01-17T11:01:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8000d1fdb07e365e6565c2415aefdfed15413794'/>
<id>urn:sha1:8000d1fdb07e365e6565c2415aefdfed15413794</id>
<content type='text'>
When reset_controller that is invoked by sysfs fails,
it enters an error flow which practically removes the
nvme ctrl entirely (similar to delete_ctrl flow). It
causes the system to hang, since a sysfs attribute cannot
be unregistered by one of its own methods.

This can be fixed by calling delete_ctrl as a work rather
than sequential code. In addition, it should give the ctrl
a chance to recover using reconnection mechanism (consistant
with FC reset_ctrl error flow). Also, while we're here, return
suitable errno in case the reset ended with non live ctrl.

Signed-off-by: Nitzan Carmi &lt;nitzanc@mellanox.com&gt;
Reviewed-by: Max Gurtovoy &lt;maxg@mellanox.com&gt;
Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
</content>
</entry>
<entry>
<title>nvme-rdma: use NVME_CTRL_CONNECTING state to mark init process</title>
<updated>2018-02-08T16:35:53+00:00</updated>
<author>
<name>Max Gurtovoy</name>
<email>maxg@mellanox.com</email>
</author>
<published>2018-01-31T16:31:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b754a32c66772e6510acd92237aadd4cf227ae39'/>
<id>urn:sha1:b754a32c66772e6510acd92237aadd4cf227ae39</id>
<content type='text'>
In order to avoid concurrent error recovery during initialization
process (allowed by the NVME_CTRL_NEW --&gt; NVME_CTRL_RESETTING transition)
we must mark the ctrl as CONNECTING before initial connection
establisment.

Signed-off-by: Max Gurtovoy &lt;maxg@mellanox.com&gt;
Reviewed-by: James Smart &lt;james.smart@broadcom.com&gt;
Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
</content>
</entry>
<entry>
<title>nvme: rename NVME_CTRL_RECONNECTING state to NVME_CTRL_CONNECTING</title>
<updated>2018-02-08T16:35:53+00:00</updated>
<author>
<name>Max Gurtovoy</name>
<email>maxg@mellanox.com</email>
</author>
<published>2018-01-31T16:31:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ad6a0a52e6de3d1161b7999c7903db906ba4cf79'/>
<id>urn:sha1:ad6a0a52e6de3d1161b7999c7903db906ba4cf79</id>
<content type='text'>
In pci transport, this state is used to mark the initialization
process. This should be also used in other transports as well.

Signed-off-by: Max Gurtovoy &lt;maxg@mellanox.com&gt;
Reviewed-by: James Smart &lt;james.smart@broadcom.com&gt;
Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-4.16/block' of git://git.kernel.dk/linux-block</title>
<updated>2018-01-29T19:51:49+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2018-01-29T19:51:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0a4b6e2f80aad46fb55a5cf7b1664c0aef030ee0'/>
<id>urn:sha1:0a4b6e2f80aad46fb55a5cf7b1664c0aef030ee0</id>
<content type='text'>
Pull block updates from Jens Axboe:
 "This is the main pull request for block IO related changes for the
  4.16 kernel. Nothing major in this pull request, but a good amount of
  improvements and fixes all over the map. This contains:

   - BFQ improvements, fixes, and cleanups from Angelo, Chiara, and
     Paolo.

   - Support for SMR zones for deadline and mq-deadline from Damien and
     Christoph.

   - Set of fixes for bcache by way of Michael Lyle, including fixes
     from himself, Kent, Rui, Tang, and Coly.

   - Series from Matias for lightnvm with fixes from Hans Holmberg,
     Javier, and Matias. Mostly centered around pblk, and the removing
     rrpc 1.2 in preparation for supporting 2.0.

   - A couple of NVMe pull requests from Christoph. Nothing major in
     here, just fixes and cleanups, and support for command tracing from
     Johannes.

   - Support for blk-throttle for tracking reads and writes separately.
     From Joseph Qi. A few cleanups/fixes also for blk-throttle from
     Weiping.

   - Series from Mike Snitzer that enables dm to register its queue more
     logically, something that's alwways been problematic on dm since
     it's a stacked device.

   - Series from Ming cleaning up some of the bio accessor use, in
     preparation for supporting multipage bvecs.

   - Various fixes from Ming closing up holes around queue mapping and
     quiescing.

   - BSD partition fix from Richard Narron, fixing a problem where we
     can't mount newer (10/11) FreeBSD partitions.

   - Series from Tejun reworking blk-mq timeout handling. The previous
     scheme relied on atomic bits, but it had races where we would think
     a request had timed out if it to reused at the wrong time.

   - null_blk now supports faking timeouts, to enable us to better
     exercise and test that functionality separately. From me.

   - Kill the separate atomic poll bit in the request struct. After
     this, we don't use the atomic bits on blk-mq anymore at all. From
     me.

   - sgl_alloc/free helpers from Bart.

   - Heavily contended tag case scalability improvement from me.

   - Various little fixes and cleanups from Arnd, Bart, Corentin,
     Douglas, Eryu, Goldwyn, and myself"

* 'for-4.16/block' of git://git.kernel.dk/linux-block: (186 commits)
  block: remove smart1,2.h
  nvme: add tracepoint for nvme_complete_rq
  nvme: add tracepoint for nvme_setup_cmd
  nvme-pci: introduce RECONNECTING state to mark initializing procedure
  nvme-rdma: remove redundant boolean for inline_data
  nvme: don't free uuid pointer before printing it
  nvme-pci: Suspend queues after deleting them
  bsg: use pr_debug instead of hand crafted macros
  blk-mq-debugfs: don't allow write on attributes with seq_operations set
  nvme-pci: Fix queue double allocations
  block: Set BIO_TRACE_COMPLETION on new bio during split
  blk-throttle: use queue_is_rq_based
  block: Remove kblockd_schedule_delayed_work{,_on}()
  blk-mq: Avoid that blk_mq_delay_run_hw_queue() introduces unintended delays
  blk-mq: Rename blk_mq_request_direct_issue() into blk_mq_request_issue_directly()
  lib/scatterlist: Fix chaining support in sgl_alloc_order()
  blk-throttle: track read and write request individually
  block: add bdev_read_only() checks to common helpers
  block: fail op_is_write() requests to read-only partitions
  blk-throttle: export io_serviced_recursive, io_service_bytes_recursive
  ...
</content>
</entry>
<entry>
<title>nvme-rdma: remove redundant boolean for inline_data</title>
<updated>2018-01-25T17:41:40+00:00</updated>
<author>
<name>Max Gurtovoy</name>
<email>maxg@mellanox.com</email>
</author>
<published>2017-12-06T16:21:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1dad3a67fbb03d88c68ca20a4f89296e50600710'/>
<id>urn:sha1:1dad3a67fbb03d88c68ca20a4f89296e50600710</id>
<content type='text'>
Signed-off-by: Max Gurtovoy &lt;maxg@mellanox.com&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvme: host delete_work and reset_work on separate workqueues</title>
<updated>2018-01-15T16:09:30+00:00</updated>
<author>
<name>Roy Shterman</name>
<email>roys@lightbitslabs.com</email>
</author>
<published>2018-01-14T10:39:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b227c59b9b5b8ae52639c8980af853d2f654f90a'/>
<id>urn:sha1:b227c59b9b5b8ae52639c8980af853d2f654f90a</id>
<content type='text'>
We need to ensure that delete_work will be hosted on a different
workqueue than all the works we flush or cancel from it.
Otherwise we may hit a circular dependency warning [1].

Also, given that delete_work flushes reset_work, host reset_work
on nvme_reset_wq and delete_work on nvme_delete_wq. In addition,
fix the flushing in the individual drivers to flush nvme_delete_wq
when draining queued deletes.

[1]:
[  178.491942] =============================================
[  178.492718] [ INFO: possible recursive locking detected ]
[  178.493495] 4.9.0-rc4-c844263313a8-lb #3 Tainted: G           OE
[  178.494382] ---------------------------------------------
[  178.495160] kworker/5:1/135 is trying to acquire lock:
[  178.495894]  (
[  178.496120] "nvme-wq"
[  178.496471] ){++++.+}
[  178.496599] , at:
[  178.496921] [&lt;ffffffffa70ac206&gt;] flush_work+0x1a6/0x2d0
[  178.497670]
               but task is already holding lock:
[  178.498499]  (
[  178.498724] "nvme-wq"
[  178.499074] ){++++.+}
[  178.499202] , at:
[  178.499520] [&lt;ffffffffa70ad6c2&gt;] process_one_work+0x162/0x6a0
[  178.500343]
               other info that might help us debug this:
[  178.501269]  Possible unsafe locking scenario:

[  178.502113]        CPU0
[  178.502472]        ----
[  178.502829]   lock(
[  178.503115] "nvme-wq"
[  178.503467] );
[  178.503716]   lock(
[  178.504001] "nvme-wq"
[  178.504353] );
[  178.504601]
                *** DEADLOCK ***

[  178.505441]  May be due to missing lock nesting notation

[  178.506453] 2 locks held by kworker/5:1/135:
[  178.507068]  #0:
[  178.507330]  (
[  178.507598] "nvme-wq"
[  178.507726] ){++++.+}
[  178.508079] , at:
[  178.508173] [&lt;ffffffffa70ad6c2&gt;] process_one_work+0x162/0x6a0
[  178.509004]  #1:
[  178.509265]  (
[  178.509532] (&amp;ctrl-&gt;delete_work)
[  178.509795] ){+.+.+.}
[  178.510145] , at:
[  178.510239] [&lt;ffffffffa70ad6c2&gt;] process_one_work+0x162/0x6a0
[  178.511070]
               stack backtrace:
:
[  178.511693] CPU: 5 PID: 135 Comm: kworker/5:1 Tainted: G           OE   4.9.0-rc4-c844263313a8-lb #3
[  178.512974] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1ubuntu1 04/01/2014
[  178.514247] Workqueue: nvme-wq nvme_del_ctrl_work [nvme_tcp]
[  178.515071]  ffffc2668175bae0 ffffffffa7450823 ffffffffa88abd80 ffffffffa88abd80
[  178.516195]  ffffc2668175bb98 ffffffffa70eb012 ffffffffa8d8d90d ffff9c472e9ea700
[  178.517318]  ffff9c472e9ea700 ffff9c4700000000 ffff9c4700007200 ab83be61bec0d50e
[  178.518443] Call Trace:
[  178.518807]  [&lt;ffffffffa7450823&gt;] dump_stack+0x85/0xc2
[  178.519542]  [&lt;ffffffffa70eb012&gt;] __lock_acquire+0x17d2/0x18f0
[  178.520377]  [&lt;ffffffffa75839a7&gt;] ? serial8250_console_putchar+0x27/0x30
[  178.521330]  [&lt;ffffffffa7583980&gt;] ? wait_for_xmitr+0xa0/0xa0
[  178.522174]  [&lt;ffffffffa70ac1eb&gt;] ? flush_work+0x18b/0x2d0
[  178.522975]  [&lt;ffffffffa70eb7cb&gt;] lock_acquire+0x11b/0x220
[  178.523753]  [&lt;ffffffffa70ac206&gt;] ? flush_work+0x1a6/0x2d0
[  178.524535]  [&lt;ffffffffa70ac229&gt;] flush_work+0x1c9/0x2d0
[  178.525291]  [&lt;ffffffffa70ac206&gt;] ? flush_work+0x1a6/0x2d0
[  178.526077]  [&lt;ffffffffa70a9cf0&gt;] ? flush_workqueue_prep_pwqs+0x220/0x220
[  178.527040]  [&lt;ffffffffa70ae7cf&gt;] __cancel_work_timer+0x10f/0x1d0
[  178.527907]  [&lt;ffffffffa70fecb9&gt;] ? vprintk_default+0x29/0x40
[  178.528726]  [&lt;ffffffffa71cb507&gt;] ? printk+0x48/0x50
[  178.529434]  [&lt;ffffffffa70ae8c3&gt;] cancel_delayed_work_sync+0x13/0x20
[  178.530381]  [&lt;ffffffffc042100b&gt;] nvme_stop_ctrl+0x5b/0x70 [nvme_core]
[  178.531314]  [&lt;ffffffffc0403dcc&gt;] nvme_del_ctrl_work+0x2c/0x50 [nvme_tcp]
[  178.532271]  [&lt;ffffffffa70ad741&gt;] process_one_work+0x1e1/0x6a0
[  178.533101]  [&lt;ffffffffa70ad6c2&gt;] ? process_one_work+0x162/0x6a0
[  178.533954]  [&lt;ffffffffa70adc4e&gt;] worker_thread+0x4e/0x490
[  178.534735]  [&lt;ffffffffa70adc00&gt;] ? process_one_work+0x6a0/0x6a0
[  178.535588]  [&lt;ffffffffa70adc00&gt;] ? process_one_work+0x6a0/0x6a0
[  178.536441]  [&lt;ffffffffa70b48cf&gt;] kthread+0xff/0x120
[  178.537149]  [&lt;ffffffffa70b47d0&gt;] ? kthread_park+0x60/0x60
[  178.538094]  [&lt;ffffffffa70b47d0&gt;] ? kthread_park+0x60/0x60
[  178.538900]  [&lt;ffffffffa78e332a&gt;] ret_from_fork+0x2a/0x40

Signed-off-by: Roy Shterman &lt;roys@lightbitslabs.com&gt;
Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvme-fabrics: protect against module unload during create_ctrl</title>
<updated>2018-01-08T10:01:56+00:00</updated>
<author>
<name>Roy Shterman</name>
<email>roys@lightbitslabs.com</email>
</author>
<published>2017-12-25T12:18:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0de5cd367c6aa2a31a1c931628f778f79f8ef22e'/>
<id>urn:sha1:0de5cd367c6aa2a31a1c931628f778f79f8ef22e</id>
<content type='text'>
NVMe transport driver module unload may (and usually does) trigger
iteration over the active controllers and delete them all (sometimes
under a mutex).  However, a controller can be created concurrently with
module unload which can lead to leakage of resources (most important char
device node leakage) in case the controller creation occured after the
unload delete and drain sequence.  To protect against this, we take a
module reference to guarantee that the nvme transport driver is not
unloaded while creating a controller.

Signed-off-by: Roy Shterman &lt;roys@lightbitslabs.com&gt;
Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Max Gurtovoy &lt;maxg@mellanox.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
</feed>
