From: Vladimir Medvedkin Date: Tue, 27 Oct 2020 15:11:31 +0000 (+0000) Subject: fib: remove maximum type enums X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4f66d3be5654990c2f0df948f1a3cc895e9cbfbf;p=dpdk.git fib: remove maximum type enums FIB type RTE_FIB_TYPE_MAX is used only for sanity checks, remove it to prevent applications start using it. The same is for FIB6's RTE_FIB6_TYPE_MAX. Signed-off-by: Vladimir Medvedkin Acked-by: David Marchand --- diff --git a/app/test/test_fib.c b/app/test/test_fib.c index ca80a5dd2f..e46b9934fe 100644 --- a/app/test/test_fib.c +++ b/app/test/test_fib.c @@ -61,7 +61,7 @@ test_create_invalid(void) "Call succeeded with invalid parameters\n"); config.max_routes = MAX_ROUTES; - config.type = RTE_FIB_TYPE_MAX; + config.type = RTE_FIB_DIR24_8 + 1; fib = rte_fib_create(__func__, SOCKET_ID_ANY, &config); RTE_TEST_ASSERT(fib == NULL, "Call succeeded with invalid parameters\n"); diff --git a/app/test/test_fib6.c b/app/test/test_fib6.c index af589fe8cb..74abfc7a5d 100644 --- a/app/test/test_fib6.c +++ b/app/test/test_fib6.c @@ -63,7 +63,7 @@ test_create_invalid(void) "Call succeeded with invalid parameters\n"); config.max_routes = MAX_ROUTES; - config.type = RTE_FIB6_TYPE_MAX; + config.type = RTE_FIB6_TRIE + 1; fib = rte_fib6_create(__func__, SOCKET_ID_ANY, &config); RTE_TEST_ASSERT(fib == NULL, "Call succeeded with invalid parameters\n"); diff --git a/lib/librte_fib/rte_fib.c b/lib/librte_fib/rte_fib.c index e0908084fe..18a422c3de 100644 --- a/lib/librte_fib/rte_fib.c +++ b/lib/librte_fib/rte_fib.c @@ -158,7 +158,7 @@ rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf) /* Check user arguments. */ if ((name == NULL) || (conf == NULL) || (conf->max_routes < 0) || - (conf->type >= RTE_FIB_TYPE_MAX)) { + (conf->type > RTE_FIB_DIR24_8)) { rte_errno = EINVAL; return NULL; } diff --git a/lib/librte_fib/rte_fib.h b/lib/librte_fib/rte_fib.h index 84ee774d2d..a58ac3caea 100644 --- a/lib/librte_fib/rte_fib.h +++ b/lib/librte_fib/rte_fib.h @@ -34,8 +34,7 @@ struct rte_rib; /** Type of FIB struct */ enum rte_fib_type { RTE_FIB_DUMMY, /**< RIB tree based FIB */ - RTE_FIB_DIR24_8, /**< DIR24_8 based FIB */ - RTE_FIB_TYPE_MAX + RTE_FIB_DIR24_8 /**< DIR24_8 based FIB */ }; /** Modify FIB function */ diff --git a/lib/librte_fib/rte_fib6.c b/lib/librte_fib/rte_fib6.c index a1f0db844a..9652ac71d6 100644 --- a/lib/librte_fib/rte_fib6.c +++ b/lib/librte_fib/rte_fib6.c @@ -160,7 +160,7 @@ rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf) /* Check user arguments. */ if ((name == NULL) || (conf == NULL) || (conf->max_routes < 0) || - (conf->type >= RTE_FIB6_TYPE_MAX)) { + (conf->type > RTE_FIB6_TRIE)) { rte_errno = EINVAL; return NULL; } diff --git a/lib/librte_fib/rte_fib6.h b/lib/librte_fib/rte_fib6.h index bbfcf23a85..338a416fb8 100644 --- a/lib/librte_fib/rte_fib6.h +++ b/lib/librte_fib/rte_fib6.h @@ -35,8 +35,7 @@ struct rte_rib6; /** Type of FIB struct */ enum rte_fib6_type { RTE_FIB6_DUMMY, /**< RIB6 tree based FIB */ - RTE_FIB6_TRIE, /**< TRIE based fib */ - RTE_FIB6_TYPE_MAX + RTE_FIB6_TRIE /**< TRIE based fib */ }; /** Modify FIB function */