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 D9907A04B5; Tue, 27 Oct 2020 16:14:58 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 564F1BC8C; Tue, 27 Oct 2020 16:12:13 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 0A10D6883 for ; Tue, 27 Oct 2020 16:11:55 +0100 (CET) IronPort-SDR: zBOK9VcaQnkRbbwxqvYX7wwDJIgigUylFoaRhDvid0H594Ej0BiGBxCXhG4B6kqjFLK/vuwXNX xi71RYCVxhQw== X-IronPort-AV: E=McAfee;i="6000,8403,9786"; a="168197299" X-IronPort-AV: E=Sophos;i="5.77,424,1596524400"; d="scan'208";a="168197299" 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; 27 Oct 2020 08:11:55 -0700 IronPort-SDR: ySHmNN9uqtbHoOlIcjKNFiRgZivopf4h2235WLYVCWZCKuTvWpYw414IJRS2TwaPiWmu4qoWbJ azQK5feCKJjw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,424,1596524400"; d="scan'208";a="322963874" Received: from silpixa00400072.ir.intel.com ([10.237.222.213]) by orsmga006.jf.intel.com with ESMTP; 27 Oct 2020 08:11:53 -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: Tue, 27 Oct 2020 15:11:31 +0000 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v15 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 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 */ -- 2.7.4