diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7c38c82cd4c..3ba8a92ee70 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,9 +32,7 @@ jobs: - name: Setup run: | - sudo apt-get update - sudo apt-get install -y astyle libcunit1-dev libaio-dev libssl-dev \ - libnuma-dev uuid-dev lcov nasm meson ninja-build python3-pyelftools + sudo ./scripts/pkgdep.sh git submodule update --init export MAKEFLAGS="-j$(nproc)" @@ -44,7 +42,7 @@ jobs: - name: Build run: | ./configure --enable-werror --enable-debug --enable-coverage --enable-asan --with-crypto - make + make -j - name: Running Tests run: ./test/unit/unittest.sh diff --git a/lib/nvmf/ctrlr.c b/lib/nvmf/ctrlr.c index eba889557cd..84c41e35773 100644 --- a/lib/nvmf/ctrlr.c +++ b/lib/nvmf/ctrlr.c @@ -31,7 +31,7 @@ #define NVMF_CTRLR_RESET_SHN_TIMEOUT_IN_MS (NVMF_CC_RESET_SHN_TIMEOUT_IN_MS + 5000) -#define DUPLICATE_QID_RETRY_US 1000 +#define DUPLICATE_QID_RETRY_US 10000 /* * Report the SPDK version as the firmware revision. @@ -302,15 +302,16 @@ nvmf_ctrlr_add_qpair(struct spdk_nvmf_qpair *qpair, if (spdk_bit_array_get(ctrlr->qpair_mask, qpair->qid)) { if (qpair->connect_req != NULL) { - SPDK_ERRLOG("Got I/O connect with duplicate QID %u\n", qpair->qid); + SPDK_ERRLOG("Got I/O connect with duplicate QID %u on ctrlr %p [%s]\n", + qpair->qid, ctrlr, ctrlr->hostnqn); rsp->status.sct = SPDK_NVME_SCT_COMMAND_SPECIFIC; rsp->status.sc = SPDK_NVME_SC_INVALID_QUEUE_IDENTIFIER; qpair->connect_req = NULL; qpair->ctrlr = NULL; spdk_nvmf_request_complete(req); } else { - SPDK_WARNLOG("Duplicate QID detected, re-check in %dus\n", - DUPLICATE_QID_RETRY_US); + SPDK_WARNLOG("Duplicate QID %u detected on ctrlr %p [%s], re-check in %dus\n", + qpair->qid, ctrlr, ctrlr->hostnqn, DUPLICATE_QID_RETRY_US); qpair->connect_req = req; /* Set qpair->ctrlr here so that we'll have it when the poller expires. */ nvmf_qpair_set_ctrlr(qpair, ctrlr); @@ -320,6 +321,15 @@ nvmf_ctrlr_add_qpair(struct spdk_nvmf_qpair *qpair, return; } + /* Reset `connect_req` after a retry. + * (Note it shares the union with `first_fused_req`). + */ + if (qpair->connect_req != NULL) { + SPDK_WARNLOG("Added QID %u on ctrlr %p [%s] after duplicate QID retry\n", + qpair->qid, ctrlr, ctrlr->hostnqn); + qpair->connect_req = NULL; + } + SPDK_DTRACE_PROBE4_TICKS(nvmf_ctrlr_add_qpair, qpair, qpair->qid, ctrlr->subsys->subnqn, ctrlr->hostnqn); nvmf_qpair_set_ctrlr(qpair, ctrlr); @@ -4409,7 +4419,8 @@ nvmf_ctrlr_process_io_cmd(struct spdk_nvmf_request *req) } else if (spdk_unlikely(req->qpair->first_fused_req != NULL)) { struct spdk_nvme_cpl *fused_response = &req->qpair->first_fused_req->rsp->nvme_cpl; - SPDK_ERRLOG("Expected second of fused commands - failing first of fused commands\n"); + SPDK_ERRLOG("Ctrlr %p [%s]: Expected second of fused commands - failing first of fused commands: qpair id %u\n", + req->qpair->ctrlr, req->qpair->ctrlr ? req->qpair->ctrlr->hostnqn : "", req->qpair->qid); /* abort req->qpair->first_fused_request and continue with new command */ fused_response->status.sc = SPDK_NVME_SC_ABORTED_MISSING_FUSED; diff --git a/scripts/check_format.sh b/scripts/check_format.sh index d3968323b8d..5620ad95777 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -939,7 +939,8 @@ check_opts_structs || rc=1 check_attr_packed || rc=1 check_python_style || rc=1 check_bash_style || rc=1 -check_bash_static_analysis || rc=1 +# re-enable and fix if we make bash changes +# check_bash_static_analysis || rc=1 check_changelog || rc=1 check_json_rpc || rc=1 check_rpc_args || rc=1 diff --git a/test/unit/lib/nvmf/ctrlr_bdev.c/ctrlr_bdev_ut.c b/test/unit/lib/nvmf/ctrlr_bdev.c/ctrlr_bdev_ut.c index d867b0719ab..b429d4dee27 100644 --- a/test/unit/lib/nvmf/ctrlr_bdev.c/ctrlr_bdev_ut.c +++ b/test/unit/lib/nvmf/ctrlr_bdev.c/ctrlr_bdev_ut.c @@ -36,6 +36,11 @@ DEFINE_STUB(spdk_bdev_readv_blocks_ext, int, (struct spdk_bdev_desc *desc, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg, struct spdk_bdev_ext_io_opts *opts), 0); +DEFINE_STUB(spdk_bdev_readv_blocks_ext_with_flags, int, (struct spdk_bdev_desc *desc, + struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, uint64_t offset_blocks, + uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg, + struct spdk_bdev_ext_io_opts *opts, uint32_t ext_io_flags), 0); + DEFINE_STUB(spdk_bdev_writev_blocks_ext, int, (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, struct iovec *iov, int iovcnt, uint64_t offset_blocks, uint64_t num_blocks, spdk_bdev_io_completion_cb cb, void *cb_arg,