diff mbox series

[v15,8/8] fib: remove unnecessary type of fib

Message ID fe11e07d15e93ae0808db34c51f271cd854b68cc.1603811281.git.vladimir.medvedkin@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers show
Series fib: implement AVX512 vector lookup | expand

Checks

Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Vladimir Medvedkin Oct. 27, 2020, 3:11 p.m. UTC
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 <vladimir.medvedkin@intel.com>
---
 app/test/test_fib.c       | 2 +-
 app/test/test_fib6.c      | 2 +-
 lib/librte_fib/rte_fib.c  | 2 +-
 lib/librte_fib/rte_fib.h  | 3 +--
 lib/librte_fib/rte_fib6.c | 2 +-
 lib/librte_fib/rte_fib6.h | 3 +--
 6 files changed, 6 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/app/test/test_fib.c b/app/test/test_fib.c
index ca80a5d..e46b993 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 af589fe..74abfc7 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 398dbf9..b354d4b 100644
--- a/lib/librte_fib/rte_fib.c
+++ b/lib/librte_fib/rte_fib.c
@@ -159,7 +159,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 8688c93..9a49313 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 1f5af0f..44cc0c9 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 887de7b..adb5005 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 */