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

modules/accel/iaa: add IAA accel_fw module



And associated RPC to enable.

Signed-off-by: default avatarpaul luse <paul.e.luse@intel.com>
Change-Id: I06785bcd8b8957293ad41d13bab556fe62f29fd5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12765


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 0ff560ea
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ the destination is persistent.

The RPC `idxd_scan_accel_engine` has been renamed to `dsa_scan_accel_engine`

The RPC `iaa_scan_accel_engine` has been added.

Many HW related structs/functions with the name `idxd` have been renamed `dsa`
to more accurately represent the HW they are associated with.

+31 −0
Original line number Diff line number Diff line
@@ -1529,6 +1529,37 @@ Example response:
}
~~~

### iaa_scan_accel_engine {#rpc_iaa_scan_accel_engine}

Enable IAA accel engine offload.
This feature is considered as experimental.

#### Parameters

None

#### Example

Example request:

~~~json
{
  "jsonrpc": "2.0",
  "method": "iaa_scan_accel_engine",
  "id": 1
}
~~~

Example response:

~~~json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": true
}
~~~

### ioat_scan_accel_engine {#rpc_ioat_scan_accel_engine}

Enable ioat accel engine offload.
+45 −1
Original line number Diff line number Diff line
@@ -54,7 +54,9 @@ enum accel_opcode {
	ACCEL_OPC_COMPARE		= 3,
	ACCEL_OPC_CRC32C		= 4,
	ACCEL_OPC_COPY_CRC32C		= 5,
	ACCEL_OPC_LAST			= 6,
	ACCEL_OPC_COMPRESS		= 6,
	ACCEL_OPC_DECOMPRESS		= 7,
	ACCEL_OPC_LAST			= 8,
};

/**
@@ -246,6 +248,48 @@ int spdk_accel_submit_copy_crc32cv(struct spdk_io_channel *ch, void *dst, struct
				   uint32_t iovcnt, uint32_t *crc_dst, uint32_t seed,
				   int flags, spdk_accel_completion_cb cb_fn, void *cb_arg);

/**
 * Build and submit a memory compress request.
 *
 * This function will build the compress descriptor and submit it.
 *
 * \param ch I/O channel associated with this call
 * \param dst Destination to compress to.
 * \param src Source to read from.
 * \param nbytes_dst Length in bytes of output buffer.
 * \param nbytes_src Length in bytes of input buffer.
 * \param output_size The size of the compressed data
 * \param flags Flags, optional flags that can vary per operation.
 * \param cb_fn Callback function which will be called when the request is complete.
 * \param cb_arg Opaque value which will be passed back as the arg parameter in
 * the completion callback.
 *
 * \return 0 on success, negative errno on failure.
 */
int spdk_accel_submit_compress(struct spdk_io_channel *ch, void *dst, void *src,
			       uint64_t nbytes_dst, uint64_t nbytes_src, uint32_t *output_size,
			       int flags, spdk_accel_completion_cb cb_fn, void *cb_arg);

/**
 * Build and submit a memory decompress request.
 *
 * This function will build the decompress descriptor and submit it.
 *
 * \param ch I/O channel associated with this call
 * \param dst Destination. Must be large enough to hold decompressed data.
 * \param src Source to read from.
 * \param nbytes_dst Length in bytes of output buffer.
 * \param nbytes_src Length in bytes of input buffer.
 * \param flags Flags, optional flags that can vary per operation.
 * \param cb_fn Callback function which will be called when the request is complete.
 * \param cb_arg Opaque value which will be passed back as the arg parameter in
 * the completion callback.
 *
 * \return 0 on success, negative errno on failure.
 */
int spdk_accel_submit_decompress(struct spdk_io_channel *ch, void *dst, void *src,
				 uint64_t nbytes_dst, uint64_t nbytes_src, int flags,
				 spdk_accel_completion_cb cb_fn, void *cb_arg);

struct spdk_json_write_ctx;

+5 −1
Original line number Diff line number Diff line
@@ -74,9 +74,13 @@ struct spdk_accel_task {
		uint32_t			seed;
		uint64_t			fill_pattern;
	};
	union {
		uint32_t		*crc_dst;
		uint32_t		*output_size;
	};
	enum accel_opcode		op_code;
	uint64_t			nbytes;
	uint64_t			nbytes_dst;
	int				flags;
	int				status;
	TAILQ_ENTRY(spdk_accel_task)	link;
+3 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@
#define TRACE_GROUP_ACCEL_DSA	0x9
#define TRACE_GROUP_THREAD	0xA
#define TRACE_GROUP_NVME_PCIE	0xB
#define TRACE_GROUP_ACCEL_IAA	0xC

/* Bdev tracepoint definitions */
#define TRACE_BDEV_IO_START		SPDK_TPOINT_ID(TRACE_GROUP_BDEV, 0x0)
@@ -168,5 +169,7 @@
/* idxd trace definitions */
#define TRACE_ACCEL_DSA_OP_SUBMIT	SPDK_TPOINT_ID(TRACE_GROUP_ACCEL_DSA, 0x0)
#define TRACE_ACCEL_DSA_OP_COMPLETE	SPDK_TPOINT_ID(TRACE_GROUP_ACCEL_DSA, 0x1)
#define TRACE_ACCEL_IAA_OP_SUBMIT	SPDK_TPOINT_ID(TRACE_GROUP_ACCEL_IAA, 0x0)
#define TRACE_ACCEL_IAA_OP_COMPLETE	SPDK_TPOINT_ID(TRACE_GROUP_ACCEL_IAA, 0x1)

#endif /* SPDK_INTERNAL_TRACE_DEFS */
Loading