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

accel/dpdk_cryptodev: provide buffer alignment requirements



QAT requires the buffers to be aligned to a block size, while other
engines have no such requirements.

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


Reviewed-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <jim.harris@gmail.com>
parent 4864545d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ endif
DEPDIRS-accel_ioat := log ioat thread jsonrpc rpc accel
DEPDIRS-accel_dsa := log idxd thread $(JSON_LIBS) accel trace
DEPDIRS-accel_iaa := log idxd thread $(JSON_LIBS) accel trace
DEPDIRS-accel_dpdk_cryptodev := log thread $(JSON_LIBS) accel
DEPDIRS-accel_dpdk_cryptodev := log thread $(JSON_LIBS) accel util
DEPDIRS-accel_dpdk_compressdev := log thread $(JSON_LIBS) accel util

ifeq ($(CONFIG_RDMA_PROV),mlx5_dv)
+24 −0
Original line number Diff line number Diff line
@@ -1501,6 +1501,29 @@ accel_dpdk_cryptodev_write_config_json(struct spdk_json_write_ctx *w)
	spdk_json_write_object_end(w);
}

static int
accel_dpdk_cryptodev_get_operation_info(enum spdk_accel_opcode opcode,
					const struct spdk_accel_operation_exec_ctx *ctx,
					struct spdk_accel_opcode_info *info)
{
	if (!accel_dpdk_cryptodev_supports_opcode(opcode)) {
		SPDK_ERRLOG("Received unexpected opcode: %d", opcode);
		assert(false);
		return -EINVAL;
	}

	switch (g_dpdk_cryptodev_driver) {
	case ACCEL_DPDK_CRYPTODEV_DRIVER_QAT:
		info->required_alignment = spdk_u32log2(ctx->block_size);
		break;
	default:
		info->required_alignment = 0;
		break;
	}

	return 0;
}

static struct spdk_accel_module_if g_accel_dpdk_cryptodev_module = {
	.module_init		= accel_dpdk_cryptodev_init,
	.module_fini		= accel_dpdk_cryptodev_fini,
@@ -1513,4 +1536,5 @@ static struct spdk_accel_module_if g_accel_dpdk_cryptodev_module = {
	.crypto_key_init	= accel_dpdk_cryptodev_key_init,
	.crypto_key_deinit	= accel_dpdk_cryptodev_key_deinit,
	.crypto_supports_cipher	= accel_dpdk_cryptodev_supports_cipher,
	.get_operation_info	= accel_dpdk_cryptodev_get_operation_info,
};