Commit ec95646a authored by Jim Harris's avatar Jim Harris Committed by Darek Stojaczyk
Browse files

ioat: make ioat_flush a public spdk_ioat_flush API



This will enable batching of doorbell writes in
future commits.  For now, just make the API public.

This is the first in a series of patches that
drastically improves performance for high queue
depth CB-DMA workloads.  Some basic tests on
my Xeon E5-v3 platform shows about 4x improvement
for 512B transfers.

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

Reviewed-on: https://review.gerrithub.io/c/444972


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent d4875ed8
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -141,6 +141,17 @@ int spdk_ioat_submit_fill(struct spdk_ioat_chan *chan,
			  void *cb_arg, spdk_ioat_req_cb cb_fn,
			  void *dst, uint64_t fill_pattern, uint64_t nbytes);

/**
 * Flush previously built descriptors.
 *
 * Descriptors are flushed by writing the channel's dmacount doorbell
 * register.  This function enables batching multiple descriptors followed by
 * a single doorbell write.
 *
 * \param chan I/OAT channel to flush.
 */
void spdk_ioat_flush(struct spdk_ioat_chan *chan);

/**
 * Check for completed requests on an I/OAT channel.
 *
+5 −5
Original line number Diff line number Diff line
@@ -158,8 +158,8 @@ ioat_submit_single(struct spdk_ioat_chan *ioat)
	ioat->head++;
}

static void
ioat_flush(struct spdk_ioat_chan *ioat)
void
spdk_ioat_flush(struct spdk_ioat_chan *ioat)
{
	ioat->regs->dmacount = (uint16_t)ioat->head;
}
@@ -454,7 +454,7 @@ ioat_channel_start(struct spdk_ioat_chan *ioat)
	ioat_write_chainaddr(ioat, ioat->ring[0].phys_addr);

	ioat_prep_null(ioat);
	ioat_flush(ioat);
	spdk_ioat_flush(ioat);

	i = 100;
	while (i-- > 0) {
@@ -652,7 +652,7 @@ spdk_ioat_submit_copy(struct spdk_ioat_chan *ioat, void *cb_arg, spdk_ioat_req_c
		return -ENOMEM;
	}

	ioat_flush(ioat);
	spdk_ioat_flush(ioat);
	return 0;
}

@@ -709,7 +709,7 @@ spdk_ioat_submit_fill(struct spdk_ioat_chan *ioat, void *cb_arg, spdk_ioat_req_c
		return -ENOMEM;
	}

	ioat_flush(ioat);
	spdk_ioat_flush(ioat);
	return 0;
}