Commit 7d44b36e authored by Jim Harris's avatar Jim Harris
Browse files

nvme: only prefetch req's stailq when req != NULL



It is fine to prefetch an invalid address, but ASAN
doesn't like it.  So move the prefetch slightly to
make ASAN happy.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: Ib51ab8890e5fe91d30057f65e1399cfc9dd1dd49
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17432


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 7858e18b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -925,13 +925,13 @@ nvme_pcie_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_
		}

		tr = &pqpair->tr[cpl->cid];
		pqpair->sq_head = cpl->sqhd;

		if (tr->req) {
			/* Prefetch the req's STAILQ_ENTRY since we'll need to access it
			 * as part of putting the req back on the qpair's free list.
			 */
			__builtin_prefetch(&tr->req->stailq);
		pqpair->sq_head = cpl->sqhd;

		if (tr->req) {
			nvme_pcie_qpair_complete_tracker(qpair, tr, cpl, true);
		} else {
			SPDK_ERRLOG("cpl does not map to outstanding cmd\n");