diff options
author | Matias Elo <matias.elo@nokia.com> | 2023-08-28 09:46:08 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2023-10-20 14:43:52 +0300 |
commit | 21eac7e64094aaa2546ed6149dd1e3a858fe0c5a (patch) | |
tree | 69623ac759eb9647659fcd36df09d87fa21ebed4 /test/performance/odp_l2fwd.c | |
parent | 8e9ffd0b17f4995cba0b7753685ea6a7caf1416d (diff) |
test: performance: use new ODP_PKTIO_MAX_INDEX define
Replace MAX_PKTIO_INDEXES with ODP_PKTIO_MAX_INDEX API define, which value
is quaranteed to be >= odp_pktio_max_index() and odp_pktio_index().
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'test/performance/odp_l2fwd.c')
-rw-r--r-- | test/performance/odp_l2fwd.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index c6bcc558e..8b97ba34c 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -1,5 +1,5 @@ /* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia + * Copyright (c) 2019-2023, Nokia * Copyright (c) 2020-2021, Marvell * All rights reserved. * @@ -42,9 +42,6 @@ /* Maximum number of pktio interfaces */ #define MAX_PKTIOS 8 -/* Maximum pktio index table size */ -#define MAX_PKTIO_INDEXES 1024 - /* Default vector size */ #define DEFAULT_VEC_SIZE MAX_PKT_BURST @@ -200,7 +197,7 @@ typedef struct { /* Destination port lookup table. * Table index is pktio_index of the API. This is used by the sched * mode. */ - uint8_t dst_port_from_idx[MAX_PKTIO_INDEXES]; + uint8_t dst_port_from_idx[ODP_PKTIO_MAX_INDEX + 1]; /* Break workers loop if set to 1 */ odp_atomic_u32_t exit_threads; @@ -1411,8 +1408,10 @@ static void init_port_lookup_tbl(void) int pktio_idx = odp_pktio_index(pktio); int dst_port = find_dest_port(rx_idx); - if (pktio_idx < 0 || pktio_idx >= MAX_PKTIO_INDEXES) { - ODPH_ERR("Bad pktio index %i\n", pktio_idx); + if (pktio_idx < 0) { + ODPH_ERR("Reading pktio (%s) index failed: %i\n", + gbl_args->appl.if_names[rx_idx], pktio_idx); + exit(EXIT_FAILURE); } @@ -2216,10 +2215,6 @@ int main(int argc, char *argv[]) } } - if (odp_pktio_max_index() >= MAX_PKTIO_INDEXES) - ODPH_DBG("Warning: max pktio index (%u) is too large\n", - odp_pktio_max_index()); - bind_workers(); odp_schedule_config_init(&sched_config); |