test_bbdev: enable to be compiled on Windows
PATCH 1/1 test_bbdev: enable to be compiled on Windows
This patch fixes a few issues which were preventing this test from getting compiled on Windows:
1) VLAs were removed: Variable Length Arrays are not supported by MSVC. Where possible constant C arrays were used. Where that approach was not possible alloca() was called instead.
2) rte_os_shim is included because this test relies on getline() function, which is not provided by Windows APIs.
--- app/test-bbdev/main.c | 1 + app/test-bbdev/meson.build | 6 -- app/test-bbdev/test_bbdev.c | 8 +- app/test-bbdev/test_bbdev_perf.c | 126 ++++++++++++++------------ app/test-bbdev/test_bbdev_vector.c | 1 + lib/eal/windows/include/rte_os_shim.h | 1 + 6 files changed, 76 insertions(+), 67 deletions(-)
app/test-bbdev/main.c +1 -0
@@ -14,6 +14,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_lcore.h> +#include <rte_os_shim.h> #include "main.h"
app/test-bbdev/meson.build +0 -6
@@ -1,12 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation -if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() -endif - sources = files( 'main.c', 'test_bbdev.c',
app/test-bbdev/test_bbdev.c +5 -3
@@ -548,9 +548,9 @@ test_bbdev_op_pool(void)static int test_bbdev_op_type (void ) { +#define OPS_COUNT 32struct rte_mempool *mp_dec; -const unsigned int OPS_COUNT =32 ;struct rte_bbdev_dec_op *dec_ops_arr[OPS_COUNT ];struct rte_bbdev_enc_op *enc_ops_arr[OPS_COUNT ];
@@ -576,14 +576,15 @@ test_bbdev_op_type(void)rte_mempool_free (mp_dec);return TEST_SUCCESS ; +#undef OPS_COUNT }static int test_bbdev_op_pool_size (void ) { +#define OPS_COUNT 128struct rte_mempool *mp_none; -const unsigned int OPS_COUNT =128 ;struct rte_bbdev_enc_op *ops_enc_arr[OPS_COUNT ];struct rte_bbdev_enc_op *ops_ext_arr[OPS_COUNT ];struct rte_bbdev_enc_op *ops_ext2_arr[OPS_COUNT ];
@@ -627,6 +628,7 @@ test_bbdev_op_pool_size(void)rte_mempool_free (mp_none);return TEST_SUCCESS ; +#undef OPS_COUNT } static int
@@ -815,7 +817,7 @@ test_bbdev_driver_init(void)TEST_ASSERT (dev1->data->dev_id <RTE_BBDEV_MAX_DEVS ,"Failed test rte_bbdev_allocate: " -"invalid dev_id %" PRIu8", max number of devices %d " , +"invalid dev_id %" PRIu16", max number of devices %d " , dev1->data->dev_id,RTE_BBDEV_MAX_DEVS ); TEST_ASSERT(dev1->state == RTE_BBDEV_INITIALIZED,
app/test-bbdev/test_bbdev_perf.c +68 -58
318 lines not on this page · raw message
app/test-bbdev/test_bbdev_vector.c +1 -0
@@ -10,6 +10,7 @@#include <stdlib.h> #include <stdbool.h> #include <rte_malloc.h> +#include <rte_os_shim.h> #include "test_bbdev_vector.h"
lib/eal/windows/include/rte_os_shim.h +1 -0
@@ -7,6 +7,7 @@#include <rte_os.h> #include <rte_windows.h> +#include <getline.h> /** * @file
Signature · 1 line
2.49.0.vfs.0.3
Quoted 16 lines
-----Original Message-----
From: Andre Muezerie <[email protected]>
Sent: Thursday, June 12, 2025 8:25 AM
To: Chautru, Nicolas <[email protected]>; Dmitry Kozlyuk <[email protected]>; Tyler Retzlaff <[email protected]>
Cc: [email protected]; Andre Muezerie <[email protected]>
Subject: [PATCH]test_bbdev: enable to be compiled on WindowsThis patch fixes a few issues which were preventing this test from getting compiled on Windows:
1) VLAs were removed: Variable Length Arrays are not supported by MSVC. Where possible constant C arrays were used. Where that approach was not possible
alloca()was called instead.
Quoted 5 lines
2)
rte_os_shimis included because this test relies ongetline()function, which is not provided by Windows APIs.Signed-off-by Andre Muezerie <[email protected]>---
PATCH v2 1/1 test_bbdev: enable to be compiled on Windows
In reply to Andre MuezerieThis patch fixes a few issues which were preventing this test from getting compiled on Windows:
1) VLAs were removed: Variable Length Arrays are not supported by MSVC. Where possible constant C arrays were used. Where that approach was not possible alloca() was called instead.
2) rte_os_shim is included because this test relies on getline() function, which is not provided by Windows APIs.
--- app/test-bbdev/main.c | 1 + app/test-bbdev/meson.build | 6 -- app/test-bbdev/test_bbdev.c | 8 +- app/test-bbdev/test_bbdev_perf.c | 126 ++++++++++++++------------ app/test-bbdev/test_bbdev_vector.c | 1 + lib/eal/windows/include/rte_os_shim.h | 1 + 6 files changed, 76 insertions(+), 67 deletions(-)
app/test-bbdev/main.c +1 -0
@@ -14,6 +14,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_lcore.h> +#include <rte_os_shim.h> #include "main.h"
app/test-bbdev/meson.build +0 -6
@@ -1,12 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation -if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() -endif - sources = files( 'main.c', 'test_bbdev.c',
app/test-bbdev/test_bbdev.c +5 -3
@@ -548,9 +548,9 @@ test_bbdev_op_pool(void)static int test_bbdev_op_type (void ) { +#define OPS_COUNT 32struct rte_mempool *mp_dec; -const unsigned int OPS_COUNT =32 ;struct rte_bbdev_dec_op *dec_ops_arr[OPS_COUNT ];struct rte_bbdev_enc_op *enc_ops_arr[OPS_COUNT ];
@@ -576,14 +576,15 @@ test_bbdev_op_type(void)rte_mempool_free (mp_dec);return TEST_SUCCESS ; +#undef OPS_COUNT }static int test_bbdev_op_pool_size (void ) { +#define OPS_COUNT 128struct rte_mempool *mp_none; -const unsigned int OPS_COUNT =128 ;struct rte_bbdev_enc_op *ops_enc_arr[OPS_COUNT ];struct rte_bbdev_enc_op *ops_ext_arr[OPS_COUNT ];struct rte_bbdev_enc_op *ops_ext2_arr[OPS_COUNT ];
@@ -627,6 +628,7 @@ test_bbdev_op_pool_size(void)rte_mempool_free (mp_none);return TEST_SUCCESS ; +#undef OPS_COUNT } static int
@@ -815,7 +817,7 @@ test_bbdev_driver_init(void)TEST_ASSERT (dev1->data->dev_id <RTE_BBDEV_MAX_DEVS ,"Failed test rte_bbdev_allocate: " -"invalid dev_id %" PRIu8", max number of devices %d " , +"invalid dev_id %" PRIu16", max number of devices %d " , dev1->data->dev_id,RTE_BBDEV_MAX_DEVS ); TEST_ASSERT(dev1->state == RTE_BBDEV_INITIALIZED,
app/test-bbdev/test_bbdev_perf.c +68 -58
318 lines not on this page · raw message
app/test-bbdev/test_bbdev_vector.c +1 -0
@@ -10,6 +10,7 @@#include <stdlib.h> #include <stdbool.h> #include <rte_malloc.h> +#include <rte_os_shim.h> #include "test_bbdev_vector.h"
lib/eal/windows/include/rte_os_shim.h +1 -0
@@ -7,6 +7,7 @@#include <rte_os.h> #include <rte_windows.h> +#include <getline.h> /** * @file
Signature · 1 line
2.49.0.vfs.0.4
PATCH v3 1/1 test_bbdev: enable to be compiled on Windows
In reply to Andre MuezerieThis patch fixes a few issues which were preventing this test from getting compiled on Windows:
1) VLAs were removed: Variable Length Arrays are not supported by MSVC. Where possible constant C arrays were used. Where that approach was not possible alloca() was called instead.
2) rte_os_shim is included because this test relies on getline() function, which is not provided by Windows APIs.
--- app/test-bbdev/main.c | 1 + app/test-bbdev/meson.build | 6 -- app/test-bbdev/test_bbdev.c | 8 +- app/test-bbdev/test_bbdev_perf.c | 126 ++++++++++++++------------ app/test-bbdev/test_bbdev_vector.c | 1 + lib/eal/windows/include/rte_os_shim.h | 1 + 6 files changed, 76 insertions(+), 67 deletions(-)
app/test-bbdev/main.c +1 -0
@@ -14,6 +14,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_lcore.h> +#include <rte_os_shim.h> #include "main.h"
app/test-bbdev/meson.build +0 -6
@@ -1,12 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation -if is_windows - build = false - reason = 'not supported on Windows' - subdir_done() -endif - sources = files( 'main.c', 'test_bbdev.c',
app/test-bbdev/test_bbdev.c +5 -3
@@ -548,9 +548,9 @@ test_bbdev_op_pool(void)static int test_bbdev_op_type (void ) { +#define OPS_COUNT 32struct rte_mempool *mp_dec; -const unsigned int OPS_COUNT =32 ;struct rte_bbdev_dec_op *dec_ops_arr[OPS_COUNT ];struct rte_bbdev_enc_op *enc_ops_arr[OPS_COUNT ];
@@ -576,14 +576,15 @@ test_bbdev_op_type(void)rte_mempool_free (mp_dec);return TEST_SUCCESS ; +#undef OPS_COUNT }static int test_bbdev_op_pool_size (void ) { +#define OPS_COUNT 128struct rte_mempool *mp_none; -const unsigned int OPS_COUNT =128 ;struct rte_bbdev_enc_op *ops_enc_arr[OPS_COUNT ];struct rte_bbdev_enc_op *ops_ext_arr[OPS_COUNT ];struct rte_bbdev_enc_op *ops_ext2_arr[OPS_COUNT ];
@@ -627,6 +628,7 @@ test_bbdev_op_pool_size(void)rte_mempool_free (mp_none);return TEST_SUCCESS ; +#undef OPS_COUNT } static int
@@ -815,7 +817,7 @@ test_bbdev_driver_init(void)TEST_ASSERT (dev1->data->dev_id <RTE_BBDEV_MAX_DEVS ,"Failed test rte_bbdev_allocate: " -"invalid dev_id %" PRIu8", max number of devices %d " , +"invalid dev_id %" PRIu16", max number of devices %d " , dev1->data->dev_id,RTE_BBDEV_MAX_DEVS ); TEST_ASSERT(dev1->state == RTE_BBDEV_INITIALIZED,
app/test-bbdev/test_bbdev_perf.c +68 -58
318 lines not on this page · raw message
app/test-bbdev/test_bbdev_vector.c +1 -0
@@ -10,6 +10,7 @@#include <stdlib.h> #include <stdbool.h> #include <rte_malloc.h> +#include <rte_os_shim.h> #include "test_bbdev_vector.h"
lib/eal/windows/include/rte_os_shim.h +1 -0
@@ -7,6 +7,7 @@#include <rte_os.h> #include <rte_windows.h> +#include <getline.h> /** * @file
Signature · 1 line
2.50.1.vfs.0.0
David Marchand
AppliedQuoted 8 lines · Andre Muezerie
This patch fixes a few issues which were preventing this test from getting compiled on Windows:
1) VLAs were removed: Variable Length Arrays are not supported by MSVC. Where possible constant C arrays were used. Where that approach was not possible
alloca()was called instead.
Quoted 5 lines
2)
rte_os_shimis included because this test relies ongetline()function, which is not provided by Windows APIs.Signed-off-by Andre Muezerie <[email protected]>Acked-by Nicolas Chautru <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand