Commit 172d5791 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

dif: Match enum spdk_dif_pi_format with NVMe spec



In enum spdk_dif_pi_format, 16b guard PI = 1, 32b guard PI = 2, and
64b guard PI = 3.

However, in the NVMe specification, 16b guard PI = 0, 32b guard PI = 1,
and 64b guard PI = 2.

These do not match.

Furthermore, if there is no metadata or PI is disabled, enum
spdk_dif_pi_format will not be initialized. In the current enum
spdk_dif_pi_format, 0 is undefined. This is not desirable.

Hence, subtract -1 from each of enum spdk_dif_pi_format.

The last patch bumped SO_VER of lib/util forcefully.
Hence, users will be able to detect this change and recompile their
applications.

Signed-off-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I103330e50363afa9a154fe72f1c0bd4c82d74e24
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23624


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Community-CI: Mellanox Build Bot
parent beff2ded
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -44,6 +44,13 @@ The `framework_get_reactors` RPC method supports getting pid and tid.
Added `framework_get_governor` RPC to retrieve the power governor name,
power env and the frequencies available, frequency set to the cpu cores.

### dif

Each element in `enum spdk_dif_pi_format` was subtracted by 1 to match the definition
of the Protection Information Format in the NVMe specification. This is necessary change
but breaks ABI compatibility. Please recompile your application if you added code using
this enum of older SPDK.

## v24.05

### accel
+3 −3
Original line number Diff line number Diff line
@@ -47,9 +47,9 @@ enum spdk_dif_check_type {
};

enum spdk_dif_pi_format {
	SPDK_DIF_PI_FORMAT_16 = 1,
	SPDK_DIF_PI_FORMAT_32 = 2,
	SPDK_DIF_PI_FORMAT_64 = 3
	SPDK_DIF_PI_FORMAT_16 = 0,
	SPDK_DIF_PI_FORMAT_32 = 1,
	SPDK_DIF_PI_FORMAT_64 = 2,
};

struct spdk_dif_ctx_init_ext_opts {