From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 393D1A04B5; Sun, 25 Oct 2020 19:10:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C39F63257; Sun, 25 Oct 2020 19:08:34 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 46C302B81 for ; Sun, 25 Oct 2020 19:08:21 +0100 (CET) IronPort-SDR: K04h4KOnXZXoAiGJcM8GgVWmvEVw+c59FgQm9e7B6pOGbs8yI7kEcF49gInFdDEnCRfxhEqeGz W2k8hsXKvoew== X-IronPort-AV: E=McAfee;i="6000,8403,9785"; a="167943687" X-IronPort-AV: E=Sophos;i="5.77,416,1596524400"; d="scan'208";a="167943687" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2020 11:08:21 -0700 IronPort-SDR: RbhaOmQVTQRWwj3/vDDnTW7plAPKJ7yUkqieAbnP66xO8kHYHIY1jpRPr38PP3qYuJt/UImY6O aiOe1ibELg7w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,416,1596524400"; d="scan'208";a="322300894" Received: from silpixa00400072.ir.intel.com ([10.237.222.213]) by orsmga006.jf.intel.com with ESMTP; 25 Oct 2020 11:08:19 -0700 From: Vladimir Medvedkin To: dev@dpdk.org Cc: david.marchand@redhat.com, jerinj@marvell.com, mdr@ashroe.eu, thomas@monjalon.net, konstantin.ananyev@intel.com, bruce.richardson@intel.com, ciara.power@intel.com Date: Sun, 25 Oct 2020 18:08:01 +0000 Message-Id: <83f277aa67a039ef468c4ccb19f0cace99e2b926.1603649185.git.vladimir.medvedkin@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v14 8/8] fib: remove unnecessary type of fib X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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 --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 1af2a5f..4d2af84 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 d4e5d91..8b78113 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 8512584..0a679a3 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 2b2a1c8..4d43a84 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 */ -- 2.7.4