Commit 2632229b authored by Jim Harris's avatar Jim Harris
Browse files

nvme/perf: only call verify_io when md_size > 0



verify_io is a function pointer, so avoiding the
call altogether is beneficial.  We know that no
verification is possible if md_size == 0, so use
this to determine if the call should be made.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I75f01e4f56aacb0f7babd2342efc6014f886667d

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456249


Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent e68ea1ce
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@
#include "spdk/dif.h"
#include "spdk/util.h"
#include "spdk/log.h"
#include "spdk/likely.h"

#if HAVE_LIBAIO
#include <libaio.h>
@@ -548,8 +549,7 @@ nvme_verify_io(struct perf_task *task, struct ns_entry *entry)
	struct spdk_dif_error err_blk = {};
	int rc;

	if (!task->is_read || entry->md_size == 0 ||
	    (entry->io_flags & SPDK_NVME_IO_FLAGS_PRACT)) {
	if (!task->is_read || (entry->io_flags & SPDK_NVME_IO_FLAGS_PRACT)) {
		return;
	}

@@ -917,8 +917,10 @@ task_complete(struct perf_task *task)
		spdk_histogram_data_tally(ns_ctx->histogram, tsc_diff);
	}

	if (spdk_unlikely(entry->md_size > 0)) {
		/* add application level verification for end-to-end data protection */
		entry->fn_table->verify_io(task, entry);
	}

	/*
	 * is_draining indicates when time has expired for the test run