#define TEST_NUM_BUFS 10
#define TEST_NUM_SESSIONS 4
-#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-#endif
-
#ifndef TEST_DATA_SIZE
#define TEST_DATA_SIZE 4096
#endif
{
uint32_t i = 0, v_size = 0;
/* Load MODEX vector*/
- v_size = ARRAY_SIZE(modex_test_case);
+ v_size = RTE_DIM(modex_test_case);
for (i = 0; i < v_size; i++) {
if (test_vector.size >= (TEST_VECTOR_SIZE)) {
RTE_LOG(DEBUG, USER1,
test_vector.size++;
}
/* Load MODINV vector*/
- v_size = ARRAY_SIZE(modinv_test_case);
+ v_size = RTE_DIM(modinv_test_case);
for (i = 0; i < v_size; i++) {
if (test_vector.size >= (TEST_VECTOR_SIZE)) {
RTE_LOG(DEBUG, USER1,
test_vector.size++;
}
/* Load RSA vector*/
- v_size = ARRAY_SIZE(rsa_test_case_list);
+ v_size = RTE_DIM(rsa_test_case_list);
for (i = 0; i < v_size; i++) {
if (test_vector.size >= (TEST_VECTOR_SIZE)) {
RTE_LOG(DEBUG, USER1,
#include "test.h"
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#define REG_METRIC_COUNT 6
#define METRIC_LESSER_COUNT 3
#define KEY 1
};
/* Success Test: valid array and count size */
- err = rte_metrics_reg_names(&mnames[0], ARRAY_SIZE(mnames));
+ err = rte_metrics_reg_names(&mnames[0], RTE_DIM(mnames));
TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__);
return TEST_SUCCESS;
/* Failed Test: Invalid count size */
err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
- KEY, &value[0], ARRAY_SIZE(value));
+ KEY, &value[0], RTE_DIM(value));
TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
/* Failed Test: Invalid port_id(lower value) and valid data */
- err = rte_metrics_update_values(-2, KEY, &value[0], ARRAY_SIZE(value));
+ err = rte_metrics_update_values(-2, KEY, &value[0], RTE_DIM(value));
TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
/* Failed Test: Invalid port_id(higher value) and valid data */
- err = rte_metrics_update_values(39, 1, &value[0], ARRAY_SIZE(value));
+ err = rte_metrics_update_values(39, 1, &value[0], RTE_DIM(value));
TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
/* Failed Test: Invalid array */
err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
- KEY, NULL, ARRAY_SIZE(value));
+ KEY, NULL, RTE_DIM(value));
TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__);
return TEST_SUCCESS;
#define MAX_BURST 32
#define STACK_SIZE (RTE_MAX_LCORE * MAX_BURST)
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-
/*
* Push/pop bulk sizes, marked volatile so they aren't treated as compile-time
* constants.
struct thread_args args[2];
unsigned int i;
- for (i = 0; i < ARRAY_SIZE(bulk_sizes); i++) {
+ for (i = 0; i < RTE_DIM(bulk_sizes); i++) {
rte_atomic32_set(&lcore_barrier, 2);
args[0].sz = args[1].sz = bulk_sizes[i];
struct thread_args args[RTE_MAX_LCORE];
unsigned int i;
- for (i = 0; i < ARRAY_SIZE(bulk_sizes); i++) {
+ for (i = 0; i < RTE_DIM(bulk_sizes); i++) {
unsigned int lcore_id;
int cnt = 0;
double avg;
void *objs[MAX_BURST];
unsigned int sz, i;
- for (sz = 0; sz < ARRAY_SIZE(bulk_sizes); sz++) {
+ for (sz = 0; sz < RTE_DIM(bulk_sizes); sz++) {
uint64_t start = rte_rdtsc();
for (i = 0; i < iterations; i++) {