31
31
32
32
#define NVMF_CTRLR_RESET_SHN_TIMEOUT_IN_MS (NVMF_CC_RESET_SHN_TIMEOUT_IN_MS + 5000)
33
33
34
- #define DUPLICATE_QID_RETRY_US 1000
34
+ #define DUPLICATE_QID_RETRY_US 10000
35
35
36
36
/*
37
37
* Report the SPDK version as the firmware revision.
@@ -302,15 +302,16 @@ nvmf_ctrlr_add_qpair(struct spdk_nvmf_qpair *qpair,
302
302
303
303
if (spdk_bit_array_get (ctrlr -> qpair_mask , qpair -> qid )) {
304
304
if (qpair -> connect_req != NULL ) {
305
- SPDK_ERRLOG ("Got I/O connect with duplicate QID %u\n" , qpair -> qid );
305
+ SPDK_ERRLOG ("Got I/O connect with duplicate QID %u on ctrlr %p [%s]\n" ,
306
+ qpair -> qid , ctrlr , ctrlr -> hostnqn );
306
307
rsp -> status .sct = SPDK_NVME_SCT_COMMAND_SPECIFIC ;
307
308
rsp -> status .sc = SPDK_NVME_SC_INVALID_QUEUE_IDENTIFIER ;
308
309
qpair -> connect_req = NULL ;
309
310
qpair -> ctrlr = NULL ;
310
311
spdk_nvmf_request_complete (req );
311
312
} else {
312
- SPDK_WARNLOG ("Duplicate QID detected, re-check in %dus\n" ,
313
- DUPLICATE_QID_RETRY_US );
313
+ SPDK_WARNLOG ("Duplicate QID %u detected on ctrlr %p [%s] , re-check in %dus\n" ,
314
+ qpair -> qid , ctrlr , ctrlr -> hostnqn , DUPLICATE_QID_RETRY_US );
314
315
qpair -> connect_req = req ;
315
316
/* Set qpair->ctrlr here so that we'll have it when the poller expires. */
316
317
nvmf_qpair_set_ctrlr (qpair , ctrlr );
@@ -320,6 +321,15 @@ nvmf_ctrlr_add_qpair(struct spdk_nvmf_qpair *qpair,
320
321
return ;
321
322
}
322
323
324
+ /* Reset `connect_req` after a retry.
325
+ * (Note it shares the union with `first_fused_req`).
326
+ */
327
+ if (qpair -> connect_req != NULL ) {
328
+ SPDK_WARNLOG ("Added QID %u on ctrlr %p [%s] after duplicate QID retry\n" ,
329
+ qpair -> qid , ctrlr , ctrlr -> hostnqn );
330
+ qpair -> connect_req = NULL ;
331
+ }
332
+
323
333
SPDK_DTRACE_PROBE4_TICKS (nvmf_ctrlr_add_qpair , qpair , qpair -> qid , ctrlr -> subsys -> subnqn ,
324
334
ctrlr -> hostnqn );
325
335
nvmf_qpair_set_ctrlr (qpair , ctrlr );
@@ -4409,7 +4419,8 @@ nvmf_ctrlr_process_io_cmd(struct spdk_nvmf_request *req)
4409
4419
} else if (spdk_unlikely (req -> qpair -> first_fused_req != NULL )) {
4410
4420
struct spdk_nvme_cpl * fused_response = & req -> qpair -> first_fused_req -> rsp -> nvme_cpl ;
4411
4421
4412
- SPDK_ERRLOG ("Expected second of fused commands - failing first of fused commands\n" );
4422
+ SPDK_ERRLOG ("Ctrlr %p [%s]: Expected second of fused commands - failing first of fused commands: qpair id %u\n" ,
4423
+ req -> qpair -> ctrlr , req -> qpair -> ctrlr ? req -> qpair -> ctrlr -> hostnqn : "<null>" , req -> qpair -> qid );
4413
4424
4414
4425
/* abort req->qpair->first_fused_request and continue with new command */
4415
4426
fused_response -> status .sc = SPDK_NVME_SC_ABORTED_MISSING_FUSED ;
0 commit comments