Commit fbb24d0e authored by paul luse's avatar paul luse Committed by Jim Harris
Browse files

lib/accel: remove batching from the framework and plug-in modules



Batching will be made available for DSA specifically through the new
idxd_perf tool.

Signed-off-by: default avatarpaul luse <paul.e.luse@intel.com>
Change-Id: Ic51d9ad3692074805b1ffa705cea8be35737c778
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9846


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarMonica Kenguva <monica.kenguva@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 998b5d66
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2,6 +2,11 @@

## v22.01: (Upcoming Release)

### accel

The batching capability was removed. Batching is now considered an implementation
detail of the low level drivers.

### nvme

API `spdk_nvme_trtype_is_fabrics` was added to return existing transport type
+0 −189
Original line number Diff line number Diff line
@@ -122,91 +122,6 @@ uint64_t spdk_accel_get_capabilities(struct spdk_io_channel *ch);
int spdk_accel_submit_copy(struct spdk_io_channel *ch, void *dst, void *src, uint64_t nbytes,
			   spdk_accel_completion_cb cb_fn, void *cb_arg);

/**
 * Synchronous call to get batch size. This is the maximum number of
 *  descriptors that a batch can contain. Once this limit is reached the batch
 *  should be processed with spdk_accel_batch_submit().
 *
 * \param ch I/O channel associated with this call.
 *
 * \return max number of descriptors per batch.
 */
uint32_t spdk_accel_batch_get_max(struct spdk_io_channel *ch);

/**
 * Synchronous call to create a batch sequence.
 *
 * \param ch I/O channel associated with this call.
 *
 * \return handle to use for subsequent batch requests, NULL on failure.
 */
struct spdk_accel_batch *spdk_accel_batch_create(struct spdk_io_channel *ch);

/**
 * Asynchronous call to submit a batch sequence.
 *
 * \param ch I/O channel associated with this call.
 * \param batch Handle provided when the batch was started with spdk_accel_batch_create().
 * \param cb_fn Called when this operation completes.
 * \param cb_arg Callback argument.
 *
 * \return 0 on success, negative errno on failure.
 */
int spdk_accel_batch_submit(struct spdk_io_channel *ch, struct spdk_accel_batch *batch,
			    spdk_accel_completion_cb cb_fn, void *cb_arg);

/**
 * Synchronous call to cancel a batch sequence. In some cases prepared commands will be
 * processed if they cannot be cancelled.
 *
 * \param ch I/O channel associated with this call.
 * \param batch Handle provided when the batch was started with spdk_accel_batch_create().
 *
 * \return 0 on success, negative errno on failure.
 */
int spdk_accel_batch_cancel(struct spdk_io_channel *ch, struct spdk_accel_batch *batch);

/**
 * Synchronous call to prepare a copy request into a previously initialized batch
 *  created with spdk_accel_batch_create(). The callback will be called when the copy
 *  completes after the batch has been submitted by an asynchronous call to
 *  spdk_accel_batch_submit().
 *
 * \param ch I/O channel associated with this call.
 * \param batch Handle provided when the batch was started with spdk_accel_batch_create().
 * \param dst Destination to copy to.
 * \param src Source to copy from.
 * \param nbytes Length in bytes to copy.
 * \param cb_fn Called when this operation completes.
 * \param cb_arg Callback argument.
 *
 * \return 0 on success, negative errno on failure.
 */
int spdk_accel_batch_prep_copy(struct spdk_io_channel *ch, struct spdk_accel_batch *batch,
			       void *dst, void *src, uint64_t nbytes, spdk_accel_completion_cb cb_fn,
			       void *cb_arg);

/**
 * Synchronous call to prepare a dualcast request into a previously initialized batch
 *  created with spdk_accel_batch_create(). The callback will be called when the dualcast
 *  completes after the batch has been submitted by an asynchronous call to
 *  spdk_accel_batch_submit().
 *
 * \param ch I/O channel associated with this call.
 * \param batch Handle provided when the batch was started with spdk_accel_batch_create().
 * \param dst1 First destination to copy to (must be 4K aligned).
 * \param dst2 Second destination to copy to (must be 4K aligned).
 * \param src Source to copy from.
 * \param nbytes Length in bytes to copy.
 * \param cb_fn Called when this operation completes.
 * \param cb_arg Callback argument.
 *
 * \return 0 on success, negative errno on failure.
 */
int spdk_accel_batch_prep_dualcast(struct spdk_io_channel *ch, struct spdk_accel_batch *batch,
				   void *dst1, void *dst2, void *src, uint64_t nbytes,
				   spdk_accel_completion_cb cb_fn, void *cb_arg);

/**
 * Submit a dual cast copy request.
 *
@@ -223,26 +138,6 @@ int spdk_accel_batch_prep_dualcast(struct spdk_io_channel *ch, struct spdk_accel
int spdk_accel_submit_dualcast(struct spdk_io_channel *ch, void *dst1, void *dst2, void *src,
			       uint64_t nbytes, spdk_accel_completion_cb cb_fn, void *cb_arg);

/**
 * Synchronous call to prepare a compare request into a previously initialized batch
 *  created with spdk_accel_batch_create(). The callback will be called when the compare
 *  completes after the batch has been submitted by an asynchronous call to
 *  spdk_accel_batch_submit().
 *
 * \param ch I/O channel associated with this call.
 * \param batch Handle provided when the batch was started with spdk_accel_batch_create().
 * \param src1 First location to perform compare on.
 * \param src2 Second location to perform compare on.
 * \param nbytes Length in bytes to compare.
 * \param cb_fn Called when this operation completes.
 * \param cb_arg Callback argument.
 *
 * \return 0 on success, negative errno on failure.
 */
int spdk_accel_batch_prep_compare(struct spdk_io_channel *ch, struct spdk_accel_batch *batch,
				  void *src1, void *src2, uint64_t nbytes, spdk_accel_completion_cb cb_fn,
				  void *cb_arg);

/**
 * Submit a compare request.
 *
@@ -258,26 +153,6 @@ int spdk_accel_batch_prep_compare(struct spdk_io_channel *ch, struct spdk_accel_
int spdk_accel_submit_compare(struct spdk_io_channel *ch, void *src1, void *src2, uint64_t nbytes,
			      spdk_accel_completion_cb cb_fn, void *cb_arg);

/**
 * Synchronous call to prepare a fill request into a previously initialized batch
 *  created with spdk_accel_batch_create(). The callback will be called when the fill
 *  completes after the batch has been submitted by an asynchronous call to
 *  spdk_accel_batch_submit().
 *
 * \param ch I/O channel associated with this call.
 * \param batch Handle provided when the batch was started with spdk_accel_batch_create().
 * \param dst Destination to fill.
 * \param fill Constant byte to fill to the destination.
 * \param nbytes Length in bytes to fill.
 * \param cb_fn Called when this operation completes.
 * \param cb_arg Callback argument.
 *
 * \return 0 on success, negative errno on failure.
 */
int spdk_accel_batch_prep_fill(struct spdk_io_channel *ch, struct spdk_accel_batch *batch,
			       void *dst, uint8_t fill, uint64_t nbytes,
			       spdk_accel_completion_cb cb_fn, void *cb_arg);

/**
 * Submit a fill request.
 *
@@ -295,70 +170,6 @@ int spdk_accel_batch_prep_fill(struct spdk_io_channel *ch, struct spdk_accel_bat
int spdk_accel_submit_fill(struct spdk_io_channel *ch, void *dst, uint8_t fill, uint64_t nbytes,
			   spdk_accel_completion_cb cb_fn, void *cb_arg);

/**
 * Synchronous call to prepare a crc32c request into a previously initialized batch
 *  created with spdk_accel_batch_create(). The callback will be called when the crc32c
 *  completes after the batch has been submitted by an asynchronous call to
 *  spdk_accel_batch_submit().
 *
 * \param ch I/O channel associated with this call.
 * \param batch Handle provided when the batch was started with spdk_accel_batch_create().
 * \param crc_dst Destination to write the CRC-32C to.
 * \param src The source address for the data.
 * \param seed Four byte seed value.
 * \param nbytes Length in bytes.
 * \param cb_fn Called when this operation completes.
 * \param cb_arg Callback argument.
 *
 * \return 0 on success, negative errno on failure.
 */
int spdk_accel_batch_prep_crc32c(struct spdk_io_channel *ch, struct spdk_accel_batch *batch,
				 uint32_t *crc_dst, void *src, uint32_t seed, uint64_t nbytes,
				 spdk_accel_completion_cb cb_fn, void *cb_arg);

/**
 * Synchronous call to prepare a chained crc32c request into a previously initialized batch
 *  created with spdk_accel_batch_create(). The callback will be called when the crc32c
 *  completes after the batch has been submitted by an asynchronous call to
 *  spdk_accel_batch_submit().
 *
 * \param ch I/O channel associated with this call.
 * \param batch Handle provided when the batch was started with spdk_accel_batch_create().
 * \param crc_dst Destination to write the CRC-32C to.
 * \param iovs The io vector array which stores the src data and len.
 * \param iovcnt The size of the iov.
 * \param seed Four byte seed value.
 * \param cb_fn Called when this operation completes.
 * \param cb_arg Callback argument.
 *
 * \return 0 on success, negative errno on failure.
 */
int spdk_accel_batch_prep_crc32cv(struct spdk_io_channel *ch, struct spdk_accel_batch *batch,
				  uint32_t *crc_dst, struct iovec *iovs, uint32_t iovcnt, uint32_t seed,
				  spdk_accel_completion_cb cb_fn, void *cb_arg);

/**
 * Synchronous call to prepare a copy + crc32c request into a previously initialized batch
 *  created with spdk_accel_batch_create(). The callback will be called when the operation
 *  completes after the batch has been submitted by an asynchronous call to
 *  spdk_accel_batch_submit().
 *
 * \param ch I/O channel associated with this call.
 * \param batch Handle provided when the batch was started with spdk_accel_batch_create().
 * \param dst Destination to write the data to.
 * \param src The source address for the data.
 * \param crc_dst Destination to write the CRC-32C to.
 * \param seed Four byte seed value.
 * \param nbytes Length in bytes.
 * \param cb_fn Called when this operation completes.
 * \param cb_arg Callback argument.
 *
 * \return 0 on success, negative errno on failure.
 */
int spdk_accel_batch_prep_copy_crc32c(struct spdk_io_channel *ch, struct spdk_accel_batch *batch,
				      void *dst, void *src, uint32_t *crc_dst, uint32_t seed, uint64_t nbytes,
				      spdk_accel_completion_cb cb_fn, void *cb_arg);

/**
 * Submit a CRC-32C calculation request.
 *
+5 −23
Original line number Diff line number Diff line
@@ -49,9 +49,6 @@ struct accel_io_channel {
	struct spdk_io_channel		*sw_engine_ch;
	void				*task_pool_base;
	TAILQ_HEAD(, spdk_accel_task)	task_pool;
	void				*batch_pool_base;
	TAILQ_HEAD(, spdk_accel_batch)	batch_pool;
	TAILQ_HEAD(, spdk_accel_batch)	batches;
};

struct sw_accel_io_channel {
@@ -59,19 +56,6 @@ struct sw_accel_io_channel {
	TAILQ_HEAD(, spdk_accel_task)	tasks_to_complete;
};

struct spdk_accel_batch {
	/* Lists of commands in the batch. */
	TAILQ_HEAD(, spdk_accel_task)	hw_tasks;
	TAILQ_HEAD(, spdk_accel_task)	sw_tasks;
	/* Specific to the batch task itself. */
	int				status;
	uint32_t			count;
	spdk_accel_completion_cb	cb_fn;
	void				*cb_arg;
	struct accel_io_channel		*accel_ch;
	TAILQ_ENTRY(spdk_accel_batch)	link;
};

enum accel_opcode {
	ACCEL_OPCODE_MEMMOVE		= 0,
	ACCEL_OPCODE_MEMFILL		= 1,
@@ -84,7 +68,6 @@ enum accel_opcode {

struct spdk_accel_task {
	struct accel_io_channel			*accel_ch;
	struct spdk_accel_batch		*batch;
	spdk_accel_completion_cb		cb_fn;
	void					*cb_arg;
	struct {
@@ -118,7 +101,6 @@ struct spdk_accel_engine {
	uint64_t capabilities;
	uint64_t (*get_capabilities)(void);
	struct spdk_io_channel *(*get_io_channel)(void);
	uint32_t (*batch_get_max)(struct spdk_io_channel *ch);
	int (*submit_tasks)(struct spdk_io_channel *ch, struct spdk_accel_task *accel_task);
};

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

SO_VER := 7
SO_VER := 8
SO_MINOR := 0
SO_SUFFIX := $(SO_VER).$(SO_MINOR)

+10 −465

File changed.

Preview size limit exceeded, changes collapsed.

Loading