Commit 26089992 authored by Changpeng Liu's avatar Changpeng Liu Committed by Jim Harris
Browse files

nvme: print the error message when error happened



Users don't need to provide nvme debug flag for the error cases.

Change-Id: I00c29e2b8ab470b0233d94acec52b4bec129728c
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/376708


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJohn Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 9b99f2c0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1234,7 +1234,7 @@ nvme_ctrlr_process_init(struct spdk_nvme_ctrlr *ctrlr)
			/* While a device is resetting, it may be unable to service MMIO reads
			 * temporarily. Allow for this case.
			 */
			SPDK_DEBUGLOG(SPDK_TRACE_NVME, "Get registers failed while waiting for CSTS.RDY == 0\n");
			SPDK_ERRLOG("Get registers failed while waiting for CSTS.RDY == 0\n");
			goto init_timeout;
		}
		SPDK_ERRLOG("Failed to read CC and CSTS in state %d\n", ctrlr->state);
+4 −5
Original line number Diff line number Diff line
@@ -1534,7 +1534,7 @@ nvme_pcie_prp_list_append(struct nvme_tracker *tr, uint32_t *prp_index, void *vi
		      *prp_index, virt_addr, (uint32_t)len);

	if (spdk_unlikely(((uintptr_t)virt_addr & 3) != 0)) {
		SPDK_DEBUGLOG(SPDK_TRACE_NVME, "virt_addr %p not dword aligned\n", virt_addr);
		SPDK_ERRLOG("virt_addr %p not dword aligned\n", virt_addr);
		return -EINVAL;
	}

@@ -1547,13 +1547,13 @@ nvme_pcie_prp_list_append(struct nvme_tracker *tr, uint32_t *prp_index, void *vi
		 * so prp_index == count is valid.
		 */
		if (spdk_unlikely(i > SPDK_COUNTOF(tr->u.prp))) {
			SPDK_DEBUGLOG(SPDK_TRACE_NVME, "out of PRP entries\n");
			SPDK_ERRLOG("out of PRP entries\n");
			return -EINVAL;
		}

		phys_addr = spdk_vtophys(virt_addr);
		if (spdk_unlikely(phys_addr == SPDK_VTOPHYS_ERROR)) {
			SPDK_DEBUGLOG(SPDK_TRACE_NVME, "vtophys(%p) failed\n", virt_addr);
			SPDK_ERRLOG("vtophys(%p) failed\n", virt_addr);
			return -EINVAL;
		}

@@ -1563,8 +1563,7 @@ nvme_pcie_prp_list_append(struct nvme_tracker *tr, uint32_t *prp_index, void *vi
			seg_len = page_size - ((uintptr_t)virt_addr & page_mask);
		} else {
			if ((phys_addr & page_mask) != 0) {
				SPDK_DEBUGLOG(SPDK_TRACE_NVME, "PRP %u not page aligned (%p)\n",
					      i, virt_addr);
				SPDK_ERRLOG("PRP %u not page aligned (%p)\n", i, virt_addr);
				return -EINVAL;
			}