numam-spdk/test
Jim Harris e40bd53175 nvme/pcie: only set qpair state from qpair's thread
The qpair's state member is only 3 bits of a uint8_t,
and the in_completion_context bit is another bit in that
same uint8_t.

We know that the qpair's state is only ever updated by
one thread, but it is possible that the state could
be modified by one thread, while another thread
is modifying in_completion_context.

in_completion_context is only modified by the thread
that is polling the qpair (or the qpair's poll group).
But with async mode, another thread that has a qpair
on the same PCIe controller could poll its adminq and
reap the SQ completion for the qpair that's owned by
the other thread.

So do *not* set the generic qpair state to CONNECTED
from the SQ completion callback.  Instead just set
the pcie_state to READY, and let the thread that owns
the qpair detect the qpair is READY and set the state
to CONNECTED itself.

Fixes issue #2157.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9efc0c954504f1841e1c3890ae78211ad0d1990e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9975
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-10-25 19:53:14 +00:00
..
accel_engine test/accel_engine: add more test cases 2021-09-01 07:34:02 +00:00
app test/nvme_fuzz: fix nvme_fuzz not support sequential FUSE commands 2021-10-18 07:55:20 +00:00
bdev scripts/common: Extract SPDK_GPT_PART_TYPE_GUID from source 2021-10-20 21:18:52 +00:00
blobfs event: Shift subsystem initialization code to a separate library 2021-05-24 10:12:50 +00:00
blobstore scheduler: Change main core frequency dynamically 2021-01-22 18:31:25 +00:00
common pgkdep/git: Patch ice driver under ubuntu1804 2021-10-14 09:51:42 +00:00
compress test/nvmf: use recommended nvmf_create_subsystem rpc 2021-05-20 15:00:22 +00:00
config_converter scripts/config_converter: skip sections not present in legacy config 2021-01-15 08:32:10 +00:00
cpp_headers queue_extras: use SPDK_CONTAINEROF 2019-10-07 15:06:01 +00:00
dd autotest: Run dd tests under SPDK_TEST_URING 2021-05-20 15:15:33 +00:00
dma dma: Update translation result to hold iovec pointer 2021-10-20 22:55:52 +00:00
dpdk_memory_utility check_format: Ignore shellcheck's SC2128 and SC2178 directives 2021-06-30 22:43:05 +00:00
env env/dpdk: revert 8f7d9ec "env/dpdk: Use the DPDK device count for IOMMU mapping" 2021-09-24 07:40:21 +00:00
event test/scheduler: add a for_each_reactor shutdown test 2021-10-21 14:47:15 +00:00
external_code markdownlint: enable rule MD040 2021-09-08 21:53:48 +00:00
ftl test/ftl: Use emulated zoned devices instead of ocssd 2021-09-21 07:52:48 +00:00
fuzz nvme_fuzz: pass trid on command line only 2021-09-27 10:55:34 +00:00
interrupt thread: reap unreg pollers in intr 2021-10-21 21:25:53 +00:00
ioat build: Example applications build to build/example 2020-06-15 15:27:16 +00:00
iscsi_tgt iscsi_tgt/rpc_config: Give some extra time for the process to die 2021-07-29 07:03:01 +00:00
json_config scheduler: add scheduler subsystem JSON configuration 2021-09-07 07:33:03 +00:00
lvol test/lvol: rename lvol test script 2020-10-20 08:54:53 +00:00
make build: don't put out-of-tree ocf build in build/ dir 2021-08-17 08:54:30 +00:00
nvme nvme_compliance: add test cases for SET FEATURES with Number of Queues 2021-10-20 07:38:44 +00:00
nvmf test/nvmf: Extend ANA state change timeout to 20 seconds 2021-10-21 09:17:46 +00:00
ocf check_format: Fixes for shellcheck's SC2251 directive 2021-06-30 22:43:05 +00:00
openstack test/openstack: Use stable branch for the requirements repo 2021-10-14 09:51:52 +00:00
pmem build: Output executables from the app directory to build/bin 2020-06-15 15:27:16 +00:00
rpc autotest: Use rpc_cmd() for rpc plugin-based tests 2021-04-02 08:22:42 +00:00
rpc_client build: use DEPDIRS variables to build SPDK_LIB_LIST 2020-12-18 09:40:01 +00:00
rpc_plugins autotest: Use rpc_cmd() for rpc plugin-based tests 2021-04-02 08:22:42 +00:00
scheduler scheduler_dynamic: fix busy tsc accounting 2021-09-28 07:29:03 +00:00
setup autotest: Check if nvme devices are in use before the wipe 2021-10-20 21:18:52 +00:00
spdkcli autotest: Don't override default amount of hugepages on Linux to 8GB 2021-06-24 17:33:10 +00:00
thread test/thread: Add poller_perf to evaluate cost to run poller 2021-08-20 07:29:42 +00:00
unit nvme/pcie: only set qpair state from qpair's thread 2021-10-25 19:53:14 +00:00
vhost test/vhost: enable BPF traces in performance tests 2021-08-23 08:48:05 +00:00
vmd test: replace VMD_WHITELIST with VMD_ALLOWED 2020-12-03 09:41:07 +00:00
Makefile test/dma: Add functional test to verify DMA 2021-09-24 07:37:45 +00:00
spdk_cunit.h test: remove leftover spdk_cunit declaration 2018-07-06 22:47:56 +00:00