Spdk/lib/ublk
Jim Harris c80a57cad3 ublk: fix device queue shutdown processing
When a queue has finished processing on its polling
thread, it sends a message to the app thread signaling
that it is done.  Then when the app thread gets
messages from all of the queues for that device, it can
proceed with tearing the device down.

But if there are still ctrl_ring commands in progress,
it needs to wait.  Previously it would register a
poller that would retry the same function if it
found commands in progress.  But the problem is that
it did not differentiate the function getting called
as a direct message from the polling thread vs. retried
via the poller on the app thread.  This could result
in lost messages.

So fix it to always increment the queues_closed
counter (renamed from q_deinit_num), and then
only check for ctrl ring commands in progress after
we received all of the queue closed messages.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0ea23ebc69acb29d5ab7e1d86ddbe74b9973e225
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16405
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michal.berger@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
2023-01-24 17:09:34 +00:00
..
Makefile so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
spdk_ublk.map ublk: add configure and event/subsystem 2023-01-20 07:48:25 +00:00
ublk_internal.h ublk: add an rpc method to get current ublk devices 2023-01-20 07:48:25 +00:00
ublk_rpc.c ublk: add an rpc method to get current ublk devices 2023-01-20 07:48:25 +00:00
ublk.c ublk: fix device queue shutdown processing 2023-01-24 17:09:34 +00:00