Windows SDK headers define `min` and `max` macros which break definition of `struct rte_param_log2_range`. Rename the structure fields to `minimum` and `maximum` to allow inclusion of both DPDK and Windows headers in the same file. Deprecation notice: https://mails.dpdk.org/archives/dev/2021-July/215270.html
Signed-off-by: Dmitry Kozlyuk <dmitry.kozl...@gmail.com> --- app/test-compress-perf/comp_perf_test_common.c | 6 +++--- app/test-compress-perf/main.c | 2 +- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_20_11.rst | 3 +++ drivers/compress/isal/isal_compress_pmd_ops.c | 4 ++-- drivers/compress/mlx5/mlx5_compress.c | 2 +- drivers/compress/octeontx/otx_zip_pmd.c | 4 ++-- drivers/compress/qat/qat_comp_pmd.c | 2 +- drivers/compress/zlib/zlib_pmd_ops.c | 4 ++-- lib/compressdev/rte_compressdev.h | 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/test-compress-perf/comp_perf_test_common.c b/app/test-compress-perf/comp_perf_test_common.c index b402a0d839..b85323049f 100644 --- a/app/test-compress-perf/comp_perf_test_common.c +++ b/app/test-compress-perf/comp_perf_test_common.c @@ -35,10 +35,10 @@ param_range_check(uint16_t size, const struct rte_param_log2_range *range) unsigned int next_size; /* Check lower/upper bounds */ - if (size < range->min) + if (size < range->minimum) return -1; - if (size > range->max) + if (size > range->maximum) return -1; /* If range is actually only one value, size is correct */ @@ -46,7 +46,7 @@ param_range_check(uint16_t size, const struct rte_param_log2_range *range) return 0; /* Check if value is one of the supported sizes */ - for (next_size = range->min; next_size <= range->max; + for (next_size = range->minimum; next_size <= range->maximum; next_size += range->increment) if (size == next_size) return 0; diff --git a/app/test-compress-perf/main.c b/app/test-compress-perf/main.c index cc9951a9b1..9fe6160f4a 100644 --- a/app/test-compress-perf/main.c +++ b/app/test-compress-perf/main.c @@ -93,7 +93,7 @@ comp_perf_check_capabilities(struct comp_test_data *test_data, uint8_t cdev_id) } } else /* Set window size to PMD maximum if none was specified */ - test_data->window_sz = cap->window_size.max; + test_data->window_sz = cap->window_size.maximum; /* Check if chained mbufs is supported */ if (test_data->max_sgl_segs > 1 && diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 76a4abfd6b..7b848528ff 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -196,9 +196,6 @@ Deprecation Notices and ``rte_vhost_driver_set_protocol_features`` functions will be removed and the API functions will be made stable in DPDK 21.11. -* compressdev: ``min`` and ``max`` fields of ``rte_param_log2_range`` structure - will be renamed in DPDK 21.11 to avoid conflict with Windows Sockets headers. - * cryptodev: ``min`` and ``max`` fields of ``rte_crypto_param_range`` structure will be renamed in DPDK 21.11 to avoid conflict with Windows Sockets headers. diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index d07fd815dc..d93790c3b1 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -662,6 +662,9 @@ API Changes * sched: Removed ``tb_rate``, ``tc_rate``, ``tc_period`` and ``tb_size`` from ``struct rte_sched_subport_params``. +* compressdev: Renamed ``min`` and ``max`` fields of ``rte_param_log2_range`` + structure to ``minimum`` and ``maximum``, respectively. + ABI Changes ----------- diff --git a/drivers/compress/isal/isal_compress_pmd_ops.c b/drivers/compress/isal/isal_compress_pmd_ops.c index 9b42147a0b..3a736794dc 100644 --- a/drivers/compress/isal/isal_compress_pmd_ops.c +++ b/drivers/compress/isal/isal_compress_pmd_ops.c @@ -22,8 +22,8 @@ static const struct rte_compressdev_capabilities isal_pmd_capabilities[] = { RTE_COMP_FF_CRC32_CHECKSUM | RTE_COMP_FF_ADLER32_CHECKSUM, .window_size = { - .min = 15, - .max = 15, + .minimum = 15, + .maximum = 15, .increment = 0 }, }, diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index c5e0a83a8c..5ec936c7db 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -90,7 +90,7 @@ static const struct rte_compressdev_capabilities mlx5_caps[] = { RTE_COMP_FF_SHAREABLE_PRIV_XFORM | RTE_COMP_FF_HUFFMAN_FIXED | RTE_COMP_FF_HUFFMAN_DYNAMIC, - .window_size = {.min = 10, .max = 15, .increment = 1}, + .window_size = {.minimum = 10, .maximum = 15, .increment = 1}, }, { .algo = RTE_COMP_ALGO_LIST_END, diff --git a/drivers/compress/octeontx/otx_zip_pmd.c b/drivers/compress/octeontx/otx_zip_pmd.c index dd62285b86..9b8aef9809 100644 --- a/drivers/compress/octeontx/otx_zip_pmd.c +++ b/drivers/compress/octeontx/otx_zip_pmd.c @@ -19,8 +19,8 @@ static const struct rte_compressdev_capabilities RTE_COMP_FF_HUFFMAN_DYNAMIC, /* Non sharable Priv XFORM and Stateless */ .window_size = { - .min = 1, - .max = 14, + .minimum = 1, + .maximum = 14, .increment = 1 /* size supported 2^1 to 2^14 */ }, diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c index caac7839e9..b79d35b85d 100644 --- a/drivers/compress/qat/qat_comp_pmd.c +++ b/drivers/compress/qat/qat_comp_pmd.c @@ -29,7 +29,7 @@ static const struct rte_compressdev_capabilities qat_comp_gen_capabilities[] = { RTE_COMP_FF_OOP_SGL_IN_LB_OUT | RTE_COMP_FF_OOP_LB_IN_SGL_OUT | RTE_COMP_FF_STATEFUL_DECOMPRESSION, - .window_size = {.min = 15, .max = 15, .increment = 0} }, + .window_size = {.minimum = 15, .maximum = 15, .increment = 0} }, {RTE_COMP_ALGO_LIST_END, 0, {0, 0, 0} } }; static void diff --git a/drivers/compress/zlib/zlib_pmd_ops.c b/drivers/compress/zlib/zlib_pmd_ops.c index 0a73aed949..50222f942e 100644 --- a/drivers/compress/zlib/zlib_pmd_ops.c +++ b/drivers/compress/zlib/zlib_pmd_ops.c @@ -16,8 +16,8 @@ static const struct rte_compressdev_capabilities zlib_pmd_capabilities[] = { RTE_COMP_FF_HUFFMAN_FIXED | RTE_COMP_FF_HUFFMAN_DYNAMIC), .window_size = { - .min = 8, - .max = 15, + .minimum = 8, + .maximum = 15, .increment = 1 }, }, diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h index 2840c27c6c..c6cea3e9c4 100644 --- a/lib/compressdev/rte_compressdev.h +++ b/lib/compressdev/rte_compressdev.h @@ -30,8 +30,8 @@ extern "C" { * Final value will be 2^value. */ struct rte_param_log2_range { - uint8_t min; /**< Minimum log2 value */ - uint8_t max; /**< Maximum log2 value */ + uint8_t minimum; /**< Minimum log2 value */ + uint8_t maximum; /**< Maximum log2 value */ uint8_t increment; /**< If a range of sizes are supported, * this parameter is used to indicate -- 2.29.3