From 6a9e923da298dda69cbdaf73eed6fb0e85ec2ad2 Mon Sep 17 00:00:00 2001 From: paul luse Date: Wed, 1 Jul 2020 15:00:10 -0400 Subject: [PATCH] lib/ioat: add mew API to get the max # of descriptors supported Needed by follow-on patches to aupport accel_fw batching in IOAT module. Signed-off-by: paul luse Change-Id: Ie39718f42756c10af131ff7893874d19ea390ecc Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3154 Community-CI: Mellanox Build Bot Reviewed-by: Ben Walker Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- CHANGELOG.md | 4 ++++ include/spdk/ioat.h | 9 +++++++++ lib/ioat/Makefile | 2 +- lib/ioat/ioat.c | 6 ++++++ lib/ioat/spdk_ioat.map | 1 + 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9d5a0795..5b53fdef4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## v20.07: (Upcoming Release) +### ioat + +A new API `spdk_ioat_get_max_descriptors` was added. + ### nvmf The NVMe-oF target no longer supports connecting scheduling configuration and instead diff --git a/include/spdk/ioat.h b/include/spdk/ioat.h index 9d32eaf0e..c4e66be3b 100644 --- a/include/spdk/ioat.h +++ b/include/spdk/ioat.h @@ -107,6 +107,15 @@ int spdk_ioat_probe(void *cb_ctx, spdk_ioat_probe_cb probe_cb, spdk_ioat_attach_ */ void spdk_ioat_detach(struct spdk_ioat_chan *ioat); +/** + * Get the maximum number of descriptors supported by the library. + * + * \param chan I/OAT channel + * + * \return maximum number of descriptors. + */ +uint32_t spdk_ioat_get_max_descriptors(struct spdk_ioat_chan *chan); + /** * Build a DMA engine memory copy request. * diff --git a/lib/ioat/Makefile b/lib/ioat/Makefile index a0da25b86..933ad5ef7 100644 --- a/lib/ioat/Makefile +++ b/lib/ioat/Makefile @@ -35,7 +35,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk SO_VER := 2 -SO_MINOR := 0 +SO_MINOR := 1 C_SRCS = ioat.c LIBNAME = ioat diff --git a/lib/ioat/ioat.c b/lib/ioat/ioat.c index bde3290cb..516fa545c 100644 --- a/lib/ioat/ioat.c +++ b/lib/ioat/ioat.c @@ -374,6 +374,12 @@ ioat_channel_destruct(struct spdk_ioat_chan *ioat) } } +uint32_t +spdk_ioat_get_max_descriptors(struct spdk_ioat_chan *ioat) +{ + return 1 << ioat->ring_size_order; +} + static int ioat_channel_start(struct spdk_ioat_chan *ioat) { diff --git a/lib/ioat/spdk_ioat.map b/lib/ioat/spdk_ioat.map index a74768c9e..f467da817 100644 --- a/lib/ioat/spdk_ioat.map +++ b/lib/ioat/spdk_ioat.map @@ -11,6 +11,7 @@ spdk_ioat_flush; spdk_ioat_process_events; spdk_ioat_get_dma_capabilities; + spdk_ioat_get_max_descriptors; local: *; };