Commit b7351518 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

accel: add a function for getting a module based on its name



Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I46b8310e20f0810bb2966e7c731ba5c11cc9e7ea
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20433


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
parent 436877a4
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -328,4 +328,13 @@ struct spdk_accel_task *spdk_accel_sequence_first_task(struct spdk_accel_sequenc
 */
struct spdk_accel_task *spdk_accel_sequence_next_task(struct spdk_accel_task *task);

/**
 * Returns an accel module identified by `name`.
 *
 * \param name Name of the module.
 *
 * \return Pointer to a module or NULL if it couldn't be found.
 */
struct spdk_accel_module_if *spdk_accel_get_module(const char *name);

#endif
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

SO_VER := 13
SO_MINOR := 0
SO_MINOR := 1
SO_SUFFIX := $(SO_VER).$(SO_MINOR)

LIBNAME = accel
+14 −0
Original line number Diff line number Diff line
@@ -2920,4 +2920,18 @@ spdk_accel_get_buf_align(enum spdk_accel_opcode opcode,
	return spdk_max(modinfo.required_alignment, drvinfo.required_alignment);
}

struct spdk_accel_module_if *
spdk_accel_get_module(const char *name)
{
	struct spdk_accel_module_if *module;

	TAILQ_FOREACH(module, &spdk_accel_module_list, tailq) {
		if (strcmp(module->name, name) == 0) {
			return module;
		}
	}

	return NULL;
}

SPDK_LOG_REGISTER_COMPONENT(accel)
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@
	spdk_accel_alloc_sequence_buf;
	spdk_accel_sequence_first_task;
	spdk_accel_sequence_next_task;
	spdk_accel_get_module;

	local: *;
};