Commit f756d888 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Jim Harris
Browse files

nvme: deprecate spdk_nvme_accel_fn_table.submit_accel_crc32c



This callback only makes the TCP transport code a lot more complicated,
as it requires us to support three ways to calculate data digest: append
API, software fallback, and submit_accel_crc32c.  The append API is the
way forward, as it allows for offloading the crc32 calculation *and*
chaining it with other accel operations.

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


Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent d341bee7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -19,6 +19,13 @@ The tags can be matched with the level 4 headers below.

## Deprecation Notices

### nvme

#### `spdk_nvme_accel_fn_table.submit_accel_crc32c`

This callback is now deprecated and will be removed in the v25.01 release.  Please use the append
API (`append_crc32c`, `finish_sequence`, `reverse_sequence`, `abort_sequence`) instead.

### gpt

#### `old_gpt_guid`
+7 −0
Original line number Diff line number Diff line
@@ -6,6 +6,9 @@

#include "nvme_internal.h"

SPDK_LOG_DEPRECATION_REGISTER(nvme_accel_fn_submit_crc,
			      "spdk_nvme_accel_fn_table.submit_accel_crc32c", "v25.01", 0);

struct spdk_nvme_poll_group *
spdk_nvme_poll_group_create(void *ctx, struct spdk_nvme_accel_fn_table *table)
{
@@ -55,6 +58,10 @@ spdk_nvme_poll_group_create(void *ctx, struct spdk_nvme_accel_fn_table *table)
		return NULL;
	}

	if (group->accel_fn_table.submit_accel_crc32c != NULL) {
		SPDK_LOG_DEPRECATED(nvme_accel_fn_submit_crc);
	}

	group->ctx = ctx;
	STAILQ_INIT(&group->tgroups);

+0 −28
Original line number Diff line number Diff line
@@ -3545,33 +3545,6 @@ bdev_nvme_get_accel_channel(struct nvme_poll_group *group)
	return group->accel_channel;
}

static void
bdev_nvme_submit_accel_crc32c(void *ctx, uint32_t *dst, struct iovec *iov,
			      uint32_t iov_cnt, uint32_t seed,
			      spdk_nvme_accel_completion_cb cb_fn, void *cb_arg)
{
	struct spdk_io_channel *accel_ch;
	struct nvme_poll_group *group = ctx;
	int rc;

	assert(cb_fn != NULL);

	accel_ch = bdev_nvme_get_accel_channel(group);
	if (spdk_unlikely(accel_ch == NULL)) {
		cb_fn(cb_arg, -ENOMEM);
		return;
	}

	rc = spdk_accel_submit_crc32cv(accel_ch, dst, iov, iov_cnt, seed, cb_fn, cb_arg);
	if (rc) {
		/* For the two cases, spdk_accel_submit_crc32cv does not call the user's cb_fn */
		if (rc == -ENOMEM || rc == -EINVAL) {
			cb_fn(cb_arg, rc);
		}
		SPDK_ERRLOG("Cannot complete the accelerated crc32c operation with iov=%p\n", iov);
	}
}

static void
bdev_nvme_finish_sequence(void *seq, spdk_nvme_accel_completion_cb cb_fn, void *cb_arg)
{
@@ -3609,7 +3582,6 @@ bdev_nvme_append_crc32c(void *ctx, void **seq, uint32_t *dst, struct iovec *iovs

static struct spdk_nvme_accel_fn_table g_bdev_nvme_accel_fn_table = {
	.table_size		= sizeof(struct spdk_nvme_accel_fn_table),
	.submit_accel_crc32c	= bdev_nvme_submit_accel_crc32c,
	.append_crc32c		= bdev_nvme_append_crc32c,
	.finish_sequence	= bdev_nvme_finish_sequence,
	.reverse_sequence	= bdev_nvme_reverse_sequence,