get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/35332/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 35332,
    "url": "http://patches.dpdk.org/api/patches/35332/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1519249495-16594-3-git-send-email-medvedkinv@gmail.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1519249495-16594-3-git-send-email-medvedkinv@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1519249495-16594-3-git-send-email-medvedkinv@gmail.com",
    "date": "2018-02-21T21:44:55",
    "name": "[dpdk-dev,v2,2/2] Add autotests for RIB library",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "e246f09629358fca04511a45a986f4d52a1abba6",
    "submitter": {
        "id": 210,
        "url": "http://patches.dpdk.org/api/people/210/?format=api",
        "name": "Vladimir Medvedkin",
        "email": "medvedkinv@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1519249495-16594-3-git-send-email-medvedkinv@gmail.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/35332/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/35332/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4592B7CE7;\n\tWed, 21 Feb 2018 22:09:12 +0100 (CET)",
            "from mailrelay1.rambler.ru (mailrelay1.rambler.ru [81.19.66.239])\n\tby dpdk.org (Postfix) with ESMTP id 62F792C66\n\tfor <dev@dpdk.org>; Wed, 21 Feb 2018 22:09:09 +0100 (CET)",
            "from test02.park.rambler.ru (dpdk01.infra.rambler.ru\n\t[10.16.253.100])\n\tby mailrelay1.rambler.ru (Postfix) with ESMTP id 3zmqq86vVPzLmB;\n\tThu, 22 Feb 2018 00:09:08 +0300 (MSK)"
        ],
        "From": "Medvedkin Vladimir <medvedkinv@gmail.com>",
        "To": "dev@dpdk.org",
        "Cc": "Medvedkin Vladimir <medvedkinv@gmail.com>",
        "Date": "Wed, 21 Feb 2018 21:44:55 +0000",
        "Message-Id": "<1519249495-16594-3-git-send-email-medvedkinv@gmail.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1519249495-16594-1-git-send-email-medvedkinv@gmail.com>",
        "References": "<1519249495-16594-1-git-send-email-medvedkinv@gmail.com>",
        "X-Rcpt-To": "<medvedkinv@gmail.com>, <dev@dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH v2 2/2] Add autotests for RIB library",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Signed-off-by: Medvedkin Vladimir <medvedkinv@gmail.com>\n---\n test/test/Makefile               |   5 +\n test/test/test_rib.c             | 330 +++++++++++++++++++++++++++++++++++++++\n test/test/test_rib_generate_rt.c | 297 +++++++++++++++++++++++++++++++++++\n test/test/test_rib_generate_rt.h |  38 +++++\n test/test/test_rib_lpm_comp.c    | 187 ++++++++++++++++++++++\n test/test/test_rib_perf.c        | 163 +++++++++++++++++++\n 6 files changed, 1020 insertions(+)\n create mode 100644 test/test/test_rib.c\n create mode 100644 test/test/test_rib_generate_rt.c\n create mode 100644 test/test/test_rib_generate_rt.h\n create mode 100644 test/test/test_rib_lpm_comp.c\n create mode 100644 test/test/test_rib_perf.c",
    "diff": "diff --git a/test/test/Makefile b/test/test/Makefile\nindex a88cc38..7644f6d 100644\n--- a/test/test/Makefile\n+++ b/test/test/Makefile\n@@ -119,6 +119,11 @@ SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_lpm_perf.c\n SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_lpm6.c\n SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_lpm6_perf.c\n \n+SRCS-$(CONFIG_RTE_LIBRTE_RIB) += test_rib.c\n+SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_rib_generate_rt.c\n+SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_rib_perf.c\n+SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_rib_lpm_comp.c\n+\n SRCS-y += test_debug.c\n SRCS-y += test_errno.c\n SRCS-y += test_tailq.c\ndiff --git a/test/test/test_rib.c b/test/test/test_rib.c\nnew file mode 100644\nindex 0000000..305ae34\n--- /dev/null\n+++ b/test/test/test_rib.c\n@@ -0,0 +1,330 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Vladimir Medvedkin <medvedkinv@gmail.com>\n+ */\n+\n+#include <stdio.h>\n+#include <stdint.h>\n+#include <stdlib.h>\n+\n+#include <rte_ip.h>\n+#include <rte_rib.h>\n+\n+#include \"test.h\"\n+#include \"test_xmmt_ops.h\"\n+#include <rte_dir24_8.h>\n+\n+\n+#define TEST_RIB_ASSERT(cond) do {\t\t\t\t\\\n+\tif (!(cond)) {\t\t\t\t\t\t\\\n+\t\tprintf(\"Error at line %d:\\n\", __LINE__);\t\\\n+\t\treturn -1;\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\\\n+} while (0)\n+\n+typedef int32_t (*rte_rib_test)(void);\n+\n+static int32_t test0(void);\n+static int32_t test1(void);\n+static int32_t test2(void);\n+static int32_t test3(void);\n+static int32_t test4(void);\n+static int32_t test5(void);\n+\n+static rte_rib_test tests[] = {\n+/* Test Cases */\n+\ttest0,\n+\ttest1,\n+\ttest2,\n+\ttest3,\n+\ttest4,\n+\ttest5\n+};\n+\n+#define NUM_RIB_TESTS (sizeof(tests)/sizeof(tests[0]))\n+#define MAX_DEPTH 32\n+#define MAX_RULES (1 << 22)\n+#define NUMBER_TBL8S 4096\n+#define PASS 0\n+\n+/*\n+ * Check that rte_rib_create fails gracefully for incorrect user input\n+ * arguments\n+ */\n+int32_t\n+test0(void)\n+{\n+\tstruct rte_rib *rib = NULL;\n+\tstruct rte_rib_conf config;\n+\n+\tconfig.type = RTE_RIB_DIR24_8_1B;\n+\tconfig.alloc_type = RTE_RIB_MALLOC;\n+\tconfig.max_nodes = MAX_RULES;\n+\tconfig.node_sz = sizeof(struct rte_rib_node);\n+\n+\t/* rte_rib_create: rib name == NULL */\n+\trib = rte_rib_create(NULL, SOCKET_ID_ANY, &config);\n+\tTEST_RIB_ASSERT(rib == NULL);\n+\n+\t/* rte_rib_create: config == NULL */\n+\trib = rte_rib_create(__func__, SOCKET_ID_ANY, NULL);\n+\tTEST_RIB_ASSERT(rib == NULL);\n+\n+\t/* socket_id < -1 is invalid */\n+\trib = rte_rib_create(__func__, -2, &config);\n+\tTEST_RIB_ASSERT(rib == NULL);\n+\n+\t/* rte_rib_create: max_nodes = 0 */\n+\tconfig.max_nodes = 0;\n+\trib = rte_rib_create(__func__, SOCKET_ID_ANY, &config);\n+\tTEST_RIB_ASSERT(rib == NULL);\n+\tconfig.max_nodes = MAX_RULES;\n+\n+\t/* rte_rib_create: node_sz = 0 */\n+\tconfig.node_sz = 0;\n+\trib = rte_rib_create(__func__, SOCKET_ID_ANY, &config);\n+\tTEST_RIB_ASSERT(rib == NULL);\n+\tconfig.node_sz = sizeof(struct rte_rib_node);\n+\n+\t/* rte_rib_create: invalid alloc type */\n+\tconfig.alloc_type = RTE_RIB_ALLOC_MAX;\n+\trib = rte_rib_create(__func__, SOCKET_ID_ANY, &config);\n+\tTEST_RIB_ASSERT(rib == NULL);\n+\tconfig.alloc_type = RTE_RIB_MALLOC;\n+\n+\t/* rte_rib_create: invalid type */\n+\tconfig.type = RTE_RIB_TYPE_MAX;\n+\trib = rte_rib_create(__func__, SOCKET_ID_ANY, &config);\n+\tTEST_RIB_ASSERT(rib == NULL);\n+\n+\treturn PASS;\n+}\n+\n+/*\n+ * Create rib table then delete rib table 10 times\n+ * for every rib type/node alloc type\n+ * Use a slightly different rules size each time\n+ * */\n+int32_t\n+test1(void)\n+{\n+\tstruct rte_rib *rib = NULL;\n+\tstruct rte_rib_conf config;\n+\tint32_t i, j, k;\n+\n+\tconfig.node_sz = sizeof(struct rte_rib_node);\n+\n+\tfor (k = RTE_RIB_MALLOC; k < RTE_RIB_ALLOC_MAX; k++) {\n+\t\tconfig.alloc_type = k;\n+\t\tfor (j = RTE_RIB_DIR24_8_1B; j < RTE_RIB_TYPE_MAX; j++) {\n+\t\t\tconfig.type = j;\n+\t\t\t/* rte_rib_free: Free NULL */\n+\t\t\tfor (i = 0; i < 2; i++) {\n+\t\t\t\tconfig.max_nodes = MAX_RULES - i;\n+\t\t\t\trib = rte_rib_create(__func__, SOCKET_ID_ANY,\n+\t\t\t\t\t&config);\n+\t\t\t\tTEST_RIB_ASSERT(rib != NULL);\n+\t\t\t\trte_rib_free(rib);\n+\t\t\t}\n+\t\t}\n+\t}\n+\t/* Can not test free so return success */\n+\treturn PASS;\n+}\n+\n+/*\n+ * Call rte_rib_free for NULL pointer user input. Note: free has no return and\n+ * therefore it is impossible to check for failure but this test is added to\n+ * increase function coverage metrics and to validate that freeing null does\n+ * not crash.\n+ */\n+int32_t\n+test2(void)\n+{\n+\tstruct rte_rib *rib = NULL;\n+\tstruct rte_rib_conf config;\n+\n+\tconfig.type = RTE_RIB_DIR24_8_1B;\n+\tconfig.alloc_type = RTE_RIB_MALLOC;\n+\tconfig.max_nodes = MAX_RULES;\n+\tconfig.node_sz = sizeof(struct rte_rib_node);\n+\n+\trib = rte_rib_create(__func__, SOCKET_ID_ANY, &config);\n+\tTEST_RIB_ASSERT(rib != NULL);\n+\n+\trte_rib_free(rib);\n+\trte_rib_free(NULL);\n+\treturn PASS;\n+}\n+\n+/*\n+ * Check that rte_rib_add fails gracefully for incorrect user input arguments\n+ */\n+int32_t\n+test3(void)\n+{\n+\tstruct rte_rib *rib = NULL;\n+\tstruct rte_rib_conf config;\n+\tuint32_t ip = IPv4(0, 0, 0, 0);\n+\tuint64_t next_hop = 100;\n+\tuint8_t depth = 24;\n+\tint32_t status = 0;\n+\n+\tconfig.type = RTE_RIB_DIR24_8_1B;\n+\tconfig.alloc_type = RTE_RIB_MALLOC;\n+\tconfig.max_nodes = MAX_RULES;\n+\tconfig.node_sz = sizeof(struct rte_rib_node);\n+\n+\t/* rte_rib_add: rib == NULL */\n+\tstatus = rte_rib_add(NULL, ip, depth, next_hop);\n+\tTEST_RIB_ASSERT(status < 0);\n+\n+\t/*Create vaild rib to use in rest of test. */\n+\trib = rte_rib_create(__func__, SOCKET_ID_ANY, &config);\n+\tTEST_RIB_ASSERT(rib != NULL);\n+\n+\t/* rte_rib_add: depth > MAX_DEPTH */\n+\tstatus = rte_rib_add(rib, ip, (MAX_DEPTH + 1), next_hop);\n+\tTEST_RIB_ASSERT(status < 0);\n+\n+\trte_rib_free(rib);\n+\n+\treturn PASS;\n+}\n+\n+/*\n+ * Check that rte_rib_delete fails gracefully for incorrect user input\n+ * arguments\n+ */\n+int32_t\n+test4(void)\n+{\n+\tstruct rte_rib *rib = NULL;\n+\tstruct rte_rib_conf config;\n+\tuint32_t ip = IPv4(0, 0, 0, 0);\n+\tuint8_t depth = 24;\n+\tint32_t status = 0;\n+\n+\tconfig.type = RTE_RIB_DIR24_8_1B;\n+\tconfig.alloc_type = RTE_RIB_MALLOC;\n+\tconfig.max_nodes = MAX_RULES;\n+\tconfig.node_sz = sizeof(struct rte_rib_node);\n+\n+\t/* rte_rib_delete: rib == NULL */\n+\tstatus = rte_rib_delete(NULL, ip, depth);\n+\tTEST_RIB_ASSERT(status < 0);\n+\n+\t/*Create vaild rib to use in rest of test. */\n+\trib = rte_rib_create(__func__, SOCKET_ID_ANY, &config);\n+\tTEST_RIB_ASSERT(rib != NULL);\n+\n+\t/* rte_rib_delete: depth > MAX_DEPTH */\n+\tstatus = rte_rib_delete(rib, ip, (MAX_DEPTH + 1));\n+\tTEST_RIB_ASSERT(status < 0);\n+\n+\trte_rib_free(rib);\n+\n+\treturn PASS;\n+}\n+\n+/*\n+ * Call add, lookup and delete for a single rule with depth <= 24\n+ */\n+int32_t\n+test5(void)\n+{\n+\tstruct rte_rib *rib = NULL;\n+\tstruct rte_rib_conf config;\n+\n+\tuint32_t ip = IPv4(190, 2, 0, 0);\n+\tuint64_t next_hop_add = 10;\n+\tuint64_t next_hop_return = 20;\n+\tuint64_t next_hop_default = 14;\n+\tuint8_t depth = 24;\n+\tuint32_t status = 0;\n+\n+\tconfig.type = RTE_RIB_DIR24_8_1B;\n+\tconfig.alloc_type = RTE_RIB_MALLOC;\n+\tconfig.max_nodes = MAX_RULES;\n+\tconfig.node_sz = sizeof(struct rte_rib_node);\n+\tconfig.def_nh = next_hop_default;\n+\n+\trib = rte_rib_create(__func__, SOCKET_ID_ANY, &config);\n+\tTEST_RIB_ASSERT(rib != NULL);\n+\n+\tstatus = rte_rib_add(rib, ip, depth, next_hop_add);\n+\tTEST_RIB_ASSERT(status == 0);\n+\n+\tstatus = rte_rib_fib_lookup_bulk(rib, &ip, &next_hop_return, 1);\n+\tTEST_RIB_ASSERT((status == 0) && (next_hop_return == next_hop_add));\n+\n+\tstatus = rte_rib_delete(rib, ip, depth);\n+\tTEST_RIB_ASSERT(status == 0);\n+\tstatus = rte_rib_fib_lookup_bulk(rib, &ip, &next_hop_return, 1);\n+\tTEST_RIB_ASSERT(next_hop_return == next_hop_default);\n+\n+\trte_rib_free(rib);\n+\n+\treturn PASS;\n+}\n+\n+\n+\n+/*\n+ * Check that rte_rib_tree_* fails gracefully for incorrect user input\n+ * arguments\n+ */\n+/*\n+\n+int i;\n+struct rte_dir24_8_tbl *fib = (struct rte_dir24_8_tbl *)rib->fib;\n+uint8_t *tmp = (uint8_t *)fib->tbl24;\n+for (i = 0; i < (1 << 24); i++) {\n+\tif (tmp[i] != 0) {\n+\t\tprintf(\"I = %d; tmp = %d\\n\", i, tmp[i]);\n+\t}\n+}\n+\n+\n+int32_t\n+testX(void)\n+{\n+\tstruct rte_rib *rib = NULL;\n+\tstruct rte_rib_conf config;\n+\tuint32_t ip = IPv4(0, 0, 0, 0);\n+\tuint8_t depth = 24;\n+\tint32_t status = 0;\n+\n+\tconfig.type = RTE_RIB_DIR24_8_1B;\n+\tconfig.alloc_type = RTE_RIB_MALLOC;\n+\tconfig.max_nodes = MAX_RULES;\n+\tconfig.node_sz = sizeof(struct rte_rib_node);\n+\n+\trib = rte_rib_create(__func__, SOCKET_ID_ANY, &config);\n+\tTEST_RIB_ASSERT(rib != NULL);\n+\n+\n+}\n+*/\n+\n+\n+/*\n+ * Do all unit tests.\n+ */\n+static int\n+test_rib(void)\n+{\n+\tunsigned i;\n+\tint status, global_status = 0;\n+\n+\tfor (i = 0; i < NUM_RIB_TESTS; i++) {\n+\t\tstatus = tests[i]();\n+\t\tif (status < 0) {\n+\t\t\tprintf(\"ERROR: RIB Test %u: FAIL\\n\", i);\n+\t\t\tglobal_status = status;\n+\t\t}\n+\t}\n+\n+\treturn global_status;\n+}\n+\n+REGISTER_TEST_COMMAND(rib_autotest, test_rib);\ndiff --git a/test/test/test_rib_generate_rt.c b/test/test/test_rib_generate_rt.c\nnew file mode 100644\nindex 0000000..9c30967\n--- /dev/null\n+++ b/test/test/test_rib_generate_rt.c\n@@ -0,0 +1,297 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Vladimir Medvedkin <medvedkinv@gmail.com>\n+ */\n+\n+#include <stdio.h>\n+#include <stdint.h>\n+#include <stdlib.h>\n+#include <math.h>\n+\n+#include <rte_random.h>\n+#include <rte_cycles.h>\n+#include <rte_ip.h>\n+\n+#include \"test_rib_generate_rt.h\"\n+\n+static uint32_t max_route_entries;\n+static uint32_t num_route_entries;\n+\n+/* All following numbers of each depth of each common IP class are just\n+ * got from previous large constant table in app/test/test_rib_routes.h .\n+ * In order to match similar performance, they keep same depth and IP\n+ * address coverage as previous constant table. These numbers don't\n+ * include any private local IP address. As previous large const rule\n+ * table was just dumped from a real router, there are no any IP address\n+ * in class C or D.\n+ */\n+static struct route_rule_count rule_count = {\n+\t.a = { /* IP class A in which the most significant bit is 0 */\n+\t\t    0, /* depth =  1 */\n+\t\t    0, /* depth =  2 */\n+\t\t    1, /* depth =  3 */\n+\t\t    0, /* depth =  4 */\n+\t\t    2, /* depth =  5 */\n+\t\t    1, /* depth =  6 */\n+\t\t    3, /* depth =  7 */\n+\t\t  185, /* depth =  8 */\n+\t\t   26, /* depth =  9 */\n+\t\t   16, /* depth = 10 */\n+\t\t   39, /* depth = 11 */\n+\t\t  144, /* depth = 12 */\n+\t\t  233, /* depth = 13 */\n+\t\t  528, /* depth = 14 */\n+\t\t  866, /* depth = 15 */\n+\t\t 3856, /* depth = 16 */\n+\t\t 3268, /* depth = 17 */\n+\t\t 5662, /* depth = 18 */\n+\t\t17301, /* depth = 19 */\n+\t\t22226, /* depth = 20 */\n+\t\t11147, /* depth = 21 */\n+\t\t16746, /* depth = 22 */\n+\t\t17120, /* depth = 23 */\n+\t\t77578, /* depth = 24 */\n+\t\t  401, /* depth = 25 */\n+\t\t  656, /* depth = 26 */\n+\t\t 1107, /* depth = 27 */\n+\t\t 1121, /* depth = 28 */\n+\t\t 2316, /* depth = 29 */\n+\t\t  717, /* depth = 30 */\n+\t\t   10, /* depth = 31 */\n+\t\t   66  /* depth = 32 */\n+\t},\n+\t.b = { /* IP class A in which the most 2 significant bits are 10 */\n+\t\t    0, /* depth =  1 */\n+\t\t    0, /* depth =  2 */\n+\t\t    0, /* depth =  3 */\n+\t\t    0, /* depth =  4 */\n+\t\t    1, /* depth =  5 */\n+\t\t    1, /* depth =  6 */\n+\t\t    1, /* depth =  7 */\n+\t\t    3, /* depth =  8 */\n+\t\t    3, /* depth =  9 */\n+\t\t   30, /* depth = 10 */\n+\t\t   25, /* depth = 11 */\n+\t\t  168, /* depth = 12 */\n+\t\t  305, /* depth = 13 */\n+\t\t  569, /* depth = 14 */\n+\t\t 1129, /* depth = 15 */\n+\t\t50800, /* depth = 16 */\n+\t\t 1645, /* depth = 17 */\n+\t\t 1820, /* depth = 18 */\n+\t\t 3506, /* depth = 19 */\n+\t\t 3258, /* depth = 20 */\n+\t\t 3424, /* depth = 21 */\n+\t\t 4971, /* depth = 22 */\n+\t\t 6885, /* depth = 23 */\n+\t\t39771, /* depth = 24 */\n+\t\t  424, /* depth = 25 */\n+\t\t  170, /* depth = 26 */\n+\t\t  443, /* depth = 27 */\n+\t\t   92, /* depth = 28 */\n+\t\t  366, /* depth = 29 */\n+\t\t  377, /* depth = 30 */\n+\t\t    2, /* depth = 31 */\n+\t\t  200  /* depth = 32 */\n+\t},\n+\t.c = { /* IP class A in which the most 3 significant bits are 110 */\n+\t\t     0, /* depth =  1 */\n+\t\t     0, /* depth =  2 */\n+\t\t     0, /* depth =  3 */\n+\t\t     0, /* depth =  4 */\n+\t\t     0, /* depth =  5 */\n+\t\t     0, /* depth =  6 */\n+\t\t     0, /* depth =  7 */\n+\t\t    12, /* depth =  8 */\n+\t\t     8, /* depth =  9 */\n+\t\t     9, /* depth = 10 */\n+\t\t    33, /* depth = 11 */\n+\t\t    69, /* depth = 12 */\n+\t\t   237, /* depth = 13 */\n+\t\t  1007, /* depth = 14 */\n+\t\t  1717, /* depth = 15 */\n+\t\t 14663, /* depth = 16 */\n+\t\t  8070, /* depth = 17 */\n+\t\t 16185, /* depth = 18 */\n+\t\t 48261, /* depth = 19 */\n+\t\t 36870, /* depth = 20 */\n+\t\t 33960, /* depth = 21 */\n+\t\t 50638, /* depth = 22 */\n+\t\t 61422, /* depth = 23 */\n+\t\t466549, /* depth = 24 */\n+\t\t  1829, /* depth = 25 */\n+\t\t  4824, /* depth = 26 */\n+\t\t  4927, /* depth = 27 */\n+\t\t  5914, /* depth = 28 */\n+\t\t 10254, /* depth = 29 */\n+\t\t  4905, /* depth = 30 */\n+\t\t     1, /* depth = 31 */\n+\t\t   716  /* depth = 32 */\n+\t}\n+};\n+\n+static void generate_random_rule_prefix(struct route_rule *rt,\n+\tuint32_t ip_class, uint8_t depth)\n+{\n+/* IP address class A, the most significant bit is 0 */\n+#define IP_HEAD_MASK_A\t\t\t0x00000000\n+#define IP_HEAD_BIT_NUM_A\t\t1\n+\n+/* IP address class B, the most significant 2 bits are 10 */\n+#define IP_HEAD_MASK_B\t\t\t0x80000000\n+#define IP_HEAD_BIT_NUM_B\t\t2\n+\n+/* IP address class C, the most significant 3 bits are 110 */\n+#define IP_HEAD_MASK_C\t\t\t0xC0000000\n+#define IP_HEAD_BIT_NUM_C\t\t3\n+\n+\tuint32_t class_depth;\n+\tuint32_t range;\n+\tuint32_t mask;\n+\tuint32_t step;\n+\tuint32_t start;\n+\tuint32_t fixed_bit_num;\n+\tuint32_t ip_head_mask;\n+\tuint32_t rule_num;\n+\tuint32_t k;\n+\tstruct route_rule *ptr_rule;\n+\n+\tif (ip_class == IP_CLASS_A) {        /* IP Address class A */\n+\t\tfixed_bit_num = IP_HEAD_BIT_NUM_A;\n+\t\tip_head_mask = IP_HEAD_MASK_A;\n+\t\trule_num = rule_count.a[depth - 1];\n+\t} else if (ip_class == IP_CLASS_B) { /* IP Address class B */\n+\t\tfixed_bit_num = IP_HEAD_BIT_NUM_B;\n+\t\tip_head_mask = IP_HEAD_MASK_B;\n+\t\trule_num = rule_count.b[depth - 1];\n+\t} else {                             /* IP Address class C */\n+\t\tfixed_bit_num = IP_HEAD_BIT_NUM_C;\n+\t\tip_head_mask = IP_HEAD_MASK_C;\n+\t\trule_num = rule_count.c[depth - 1];\n+\t}\n+\n+\tif ((rule_num == 0) || ((num_route_entries + rule_num) >=\n+\t\tmax_route_entries))\n+\t\treturn;\n+\n+\t/* the number of rest bits which don't include the most significant\n+\t * fixed bits for this IP address class\n+\t */\n+\tclass_depth = depth - fixed_bit_num;\n+\n+\t/* range is the maximum number of rules for this depth and\n+\t * this IP address class\n+\t */\n+\trange = 1 << class_depth;\n+\n+\t/* only mask the most depth significant generated bits\n+\t * except fixed bits for IP address class\n+\t */\n+\tmask = range - 1;\n+\n+\t/* Widen coverage of IP address in generated rules */\n+\tif (range <= rule_num)\n+\t\tstep = 1;\n+\telse\n+\t\tstep = round((double)range / rule_num);\n+\n+\t/* Only generate rest bits except the most significant\n+\t * fixed bits for IP address class\n+\t */\n+\tstart = rte_rand() & mask;\n+\tptr_rule = &rt[num_route_entries];\n+\tfor (k = 0; k < rule_num; k++) {\n+\t\tptr_rule->ip = (start << (RTE_RIB_MAXDEPTH - depth))\n+\t\t\t| ip_head_mask;\n+\t\tptr_rule->depth = depth;\n+\t\tptr_rule++;\n+\t\tstart = (start + step) & mask;\n+\t}\n+\tnum_route_entries += rule_num;\n+}\n+\n+static void insert_rule_in_random_pos(struct route_rule *rt,\n+\tuint32_t ip, uint8_t depth)\n+{\n+\tuint32_t pos;\n+\tint try_count = 0;\n+\tstruct route_rule tmp;\n+\n+\tdo {\n+\t\tpos = rte_rand();\n+\t\ttry_count++;\n+\t} while ((try_count < 10) && (pos > num_route_entries));\n+\n+\tif ((pos > num_route_entries) || (pos > max_route_entries))\n+\t\tpos = num_route_entries >> 1;\n+\n+\ttmp = rt[pos];\n+\trt[pos].ip = ip;\n+\trt[pos].depth = depth;\n+\tif (num_route_entries < max_route_entries)\n+\t\trt[num_route_entries++] = tmp;\n+}\n+\n+uint32_t\n+generate_large_route_rule_table(uint32_t num_routes, struct route_rule *rt)\n+{\n+\tuint32_t ip_class;\n+\tuint8_t  depth;\n+\n+\trte_srand(rte_rdtsc());\n+\tnum_route_entries = 0;\n+\tmax_route_entries = num_routes;\n+\tfor (ip_class = IP_CLASS_A; ip_class <= IP_CLASS_C; ip_class++) {\n+\t\tfor (depth = 1; depth <= RTE_RIB_MAXDEPTH; depth++)\n+\t\t\tgenerate_random_rule_prefix(rt, ip_class, depth);\n+\t}\n+\t/* Add following rules to keep same as previous large constant table,\n+\t * they are 4 rules with private local IP address and 1 all-zeros prefix\n+\t * with depth = 8.\n+\t */\n+\tinsert_rule_in_random_pos(rt, IPv4(0, 0, 0, 0), 8);\n+\tinsert_rule_in_random_pos(rt, IPv4(10, 2, 23, 147), 32);\n+\tinsert_rule_in_random_pos(rt, IPv4(192, 168, 100, 10), 24);\n+\tinsert_rule_in_random_pos(rt, IPv4(192, 168, 25, 100), 24);\n+\tinsert_rule_in_random_pos(rt, IPv4(192, 168, 129, 124), 32);\n+\n+\treturn num_route_entries;\n+}\n+\n+void\n+print_route_distribution(const struct route_rule *table, uint32_t n)\n+{\n+\tunsigned i, j;\n+\n+\tprintf(\"Route distribution per prefix width:\\n\");\n+\tprintf(\"DEPTH    QUANTITY (PERCENT)\\n\");\n+\tprintf(\"---------------------------\\n\");\n+\n+\t/* Count depths. */\n+\tfor (i = 1; i <= 32; i++) {\n+\t\tunsigned depth_counter = 0;\n+\t\tdouble percent_hits;\n+\n+\t\tfor (j = 0; j < n; j++)\n+\t\t\tif (table[j].depth == (uint8_t) i)\n+\t\t\t\tdepth_counter++;\n+\n+\t\tpercent_hits = ((double)depth_counter)/((double)n) * 100;\n+\t\tprintf(\"%.2u%15u (%.2f)\\n\", i, depth_counter, percent_hits);\n+\t}\n+\tprintf(\"\\n\");\n+}\n+\n+void\n+shuffle_rt(struct route_rule *rt, uint32_t n)\n+{\n+\tuint32_t pos;\n+\tstruct route_rule tmp;\n+\tuint32_t i;\n+\n+\tfor (i = 0; i < n; i++) {\n+\t\tpos = rte_rand() % n;\n+\t\ttmp = rt[pos];\n+\t\trt[pos] = rt[i];\n+\t\trt[i] = tmp;\n+\t}\n+}\ndiff --git a/test/test/test_rib_generate_rt.h b/test/test/test_rib_generate_rt.h\nnew file mode 100644\nindex 0000000..90573c7\n--- /dev/null\n+++ b/test/test/test_rib_generate_rt.h\n@@ -0,0 +1,38 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Vladimir Medvedkin <medvedkinv@gmail.com>\n+ */\n+\n+#ifndef _TEST_RIB_GENERATE_RT_H_\n+#define _TEST_RIB_GENERATE_RT_H_\n+\n+#define RTE_RIB_MAXDEPTH\t32\n+\n+struct route_rule {\n+\tuint64_t nh;\n+\tuint32_t ip;\n+\tuint8_t depth;\n+};\n+\n+enum {\n+\tIP_CLASS_A,\n+\tIP_CLASS_B,\n+\tIP_CLASS_C\n+};\n+\n+/* struct route_rule_count defines the total number of rules in following a/b/c\n+ * each item in a[]/b[]/c[] is the number of common IP address class A/B/C, not\n+ * including the ones for private local network.\n+ */\n+struct route_rule_count {\n+\tuint32_t a[RTE_RIB_MAXDEPTH];\n+\tuint32_t b[RTE_RIB_MAXDEPTH];\n+\tuint32_t c[RTE_RIB_MAXDEPTH];\n+};\n+\n+\n+uint32_t generate_large_route_rule_table(uint32_t num_routes,\n+\tstruct route_rule *rt);\n+void print_route_distribution(const struct route_rule *table, uint32_t n);\n+void shuffle_rt(struct route_rule *rt, uint32_t n);\n+\n+#endif /* _TEST_RIB_GENERATE_RT_H_ */\ndiff --git a/test/test/test_rib_lpm_comp.c b/test/test/test_rib_lpm_comp.c\nnew file mode 100644\nindex 0000000..d89e91c\n--- /dev/null\n+++ b/test/test/test_rib_lpm_comp.c\n@@ -0,0 +1,187 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Vladimir Medvedkin <medvedkinv@gmail.com>\n+ */\n+\n+#include <stdio.h>\n+#include <stdint.h>\n+#include <stdlib.h>\n+\n+#include <rte_random.h>\n+#include <rte_cycles.h>\n+#include <rte_branch_prediction.h>\n+#include <rte_ip.h>\n+#include <rte_malloc.h>\n+#include <rte_lpm.h>\n+#include <rte_rib.h>\n+\n+#include \"test.h\"\n+#include \"test_xmmt_ops.h\"\n+#include \"test_rib_generate_rt.h\"\n+\n+#define TEST_RIB_ASSERT(cond) do {\t\t\t\t\\\n+\tif (!(cond)) {\t\t\t\t\t\t\\\n+\t\tprintf(\"Error at line %d:\\n\", __LINE__);\t\\\n+\t\treturn -1;\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\\\n+} while (0)\n+\n+#define ITERATIONS (1 << 15)\n+#define BATCH_SIZE (1 << 7)\n+#define BULK_SIZE 32\n+#define LPM_NH_MASK\t((1 << 24) - 1)\n+\n+static const uint64_t default_nh;\n+\n+static int\n+test_lookup(struct rte_rib *rib, struct rte_lpm *lpm)\n+{\n+\tstatic uint32_t ip_batch[BATCH_SIZE];\n+\tuint64_t rib_next_hops[BULK_SIZE];\n+\tuint32_t lpm_next_hops[BULK_SIZE];\n+\tint i, j, k;\n+\n+\tfor (i = 0; i < ITERATIONS; i++) {\n+\t\tfor (j = 0; j < BATCH_SIZE; j++)\n+\t\t\tip_batch[j] = rte_rand();\n+\n+\t\tfor (j = 0; j < BATCH_SIZE; j += BULK_SIZE) {\n+\t\t\trte_rib_fib_lookup_bulk(rib, &ip_batch[j],\n+\t\t\t\trib_next_hops, BULK_SIZE);\n+\t\t\trte_lpm_lookup_bulk(lpm, &ip_batch[j],\n+\t\t\t\tlpm_next_hops, BULK_SIZE);\n+\t\t\tfor (k = 0; k < BULK_SIZE; k++) {\n+\t\t\t\tif (likely(lpm_next_hops[k] &\n+\t\t\t\t\tRTE_LPM_LOOKUP_SUCCESS))\n+\t\t\t\t\tlpm_next_hops[k] &= LPM_NH_MASK;\n+\t\t\t\telse\n+\t\t\t\t\tlpm_next_hops[k] = default_nh;\n+\t\t\t}\n+\t\t\tfor (k = 0; k < BULK_SIZE; k++)\n+\t\t\t\tTEST_RIB_ASSERT(rib_next_hops[k] ==\n+\t\t\t\t\t\tlpm_next_hops[k]);\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n+static int\n+test_rib_lpm_comp(void)\n+{\n+\tstruct rte_rib *rib = NULL;\n+\tstruct rte_lpm *lpm = NULL;\n+\tstruct route_rule *rt = NULL;\n+\tunsigned i;\n+\tint rib_add = 0, lpm_add = 0;\n+\tint ret, nh_bits, nr_tbl8;\n+\tuint32_t num_routes;\n+\tstruct rte_rib_conf conf;\n+\tstruct rte_lpm_config config;\n+\n+\trte_srand(rte_rdtsc());\n+\n+\tconf.max_nodes = 3000000;\n+\tconf.node_sz = sizeof(struct rte_rib_node);\n+\tconf.type = RTE_RIB_DIR24_8_8B;\n+\tconf.alloc_type = RTE_RIB_MEMPOOL;\n+\tconf.def_nh\t= default_nh;\n+\n+\tnh_bits = RTE_MIN(((1 << (3 + conf.type)) - 2), 24);\n+\tnr_tbl8 = RTE_MIN((1 << nh_bits), 65536);\n+\tconfig.number_tbl8s = nr_tbl8;\n+\tconfig.max_rules = 2000000;\n+\tconfig.flags = 0;\n+\n+\tnum_routes = 1200000;\n+\n+\trt = rte_zmalloc(\"struct route_rule *\", sizeof(struct route_rule) *\n+\t\tnum_routes + 5, 0);\n+\tTEST_RIB_ASSERT(rt != NULL);\n+\n+\tnum_routes = generate_large_route_rule_table(num_routes, rt);\n+\tTEST_RIB_ASSERT(num_routes != 0);\n+\tprintf(\"No. routes = %u\\n\", (unsigned) num_routes);\n+\n+\tshuffle_rt(rt, num_routes);\n+\n+\tprint_route_distribution(rt, (uint32_t) num_routes);\n+\n+\trib = rte_rib_create(__func__, SOCKET_ID_ANY, &conf);\n+\tTEST_RIB_ASSERT(rib != NULL);\n+\n+\tlpm = rte_lpm_create(__func__, SOCKET_ID_ANY, &config);\n+\tTEST_RIB_ASSERT(lpm != NULL);\n+\n+\tfor (i = 0; i < num_routes; i++)\n+\t\trt[i].nh = rte_rand() & ((1ULL << nh_bits) - 1);\n+\n+\tfor (i = 0; i < num_routes; i++) {\n+\t\tret = rte_rib_add(rib, rt[i].ip, rt[i].depth, rt[i].nh);\n+\t\tif (ret == 0)\n+\t\t\trib_add++;\n+\t\telse\n+\t\t\tcontinue;\n+\n+\t\tret = rte_lpm_add(lpm, rt[i].ip, rt[i].depth, rt[i].nh);\n+\t\tif (ret == 0)\n+\t\t\tlpm_add++;\n+\t\telse {\n+\t\t\trte_rib_delete(rib, rt[i].ip, rt[i].depth);\n+\t\t\trib_add--;\n+\t\t}\n+\t}\n+\tTEST_RIB_ASSERT(rib_add == lpm_add);\n+\n+\tret = test_lookup(rib, lpm);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n+\tfor (i = 0; i < num_routes; i++) {\n+\t\tif ((i % 3) == 0) {\n+\t\t\tret = rte_rib_delete(rib, rt[i].ip, rt[i].depth);\n+\t\t\tif (ret == 0)\n+\t\t\t\trib_add--;\n+\t\t\telse\n+\t\t\t\tcontinue;\n+\n+\t\t\tret = rte_lpm_delete(lpm, rt[i].ip, rt[i].depth);\n+\t\t\tif (ret == 0)\n+\t\t\t\tlpm_add--;\n+\t\t}\n+\t}\n+\tTEST_RIB_ASSERT(rib_add == lpm_add);\n+\n+\tret = test_lookup(rib, lpm);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n+\tfor (i = 0; i < num_routes; i++) {\n+\t\tif ((i % 6) == 0) {\n+\t\t\tret = rte_rib_add(rib, rt[i].ip, rt[i].depth, rt[i].nh);\n+\t\t\tif (ret == 0)\n+\t\t\t\trib_add++;\n+\t\t\telse\n+\t\t\t\tcontinue;\n+\n+\t\t\tret = rte_lpm_add(lpm, rt[i].ip, rt[i].depth, rt[i].nh);\n+\t\t\tif (ret == 0)\n+\t\t\t\tlpm_add++;\n+\t\t\telse {\n+\t\t\t\trte_rib_delete(rib, rt[i].ip, rt[i].depth);\n+\t\t\t\trib_add--;\n+\t\t\t}\n+\t\t}\n+\t}\n+\tTEST_RIB_ASSERT(rib_add == lpm_add);\n+\n+\tret = test_lookup(rib, lpm);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n+\trte_rib_free(rib);\n+\trte_lpm_free(lpm);\n+\trte_free(rt);\n+\n+\treturn 0;\n+}\n+\n+REGISTER_TEST_COMMAND(rib_lpm_comp_autotest, test_rib_lpm_comp);\ndiff --git a/test/test/test_rib_perf.c b/test/test/test_rib_perf.c\nnew file mode 100644\nindex 0000000..f03475e\n--- /dev/null\n+++ b/test/test/test_rib_perf.c\n@@ -0,0 +1,163 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Vladimir Medvedkin <medvedkinv@gmail.com>\n+ */\n+\n+#include <stdio.h>\n+#include <stdint.h>\n+#include <stdlib.h>\n+\n+#include <rte_cycles.h>\n+#include <rte_random.h>\n+#include <rte_branch_prediction.h>\n+#include <rte_ip.h>\n+#include <rte_malloc.h>\n+#include <rte_rib.h>\n+#include <rte_dir24_8.h>\n+\n+#include \"test.h\"\n+#include \"test_xmmt_ops.h\"\n+#include \"test_rib_generate_rt.h\"\n+\n+#define TEST_RIB_ASSERT(cond) do {\t\t\t\t\\\n+\tif (!(cond)) {\t\t\t\t\t\t\\\n+\t\tprintf(\"Error at line %d:\\n\", __LINE__);\t\\\n+\t\treturn -1;\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\\\n+} while (0)\n+\n+#define ITERATIONS (1 << 15)\n+#define BATCH_SIZE (1 << 12)\n+#define BULK_SIZE 32\n+\n+static int\n+test_rib_perf(void)\n+{\n+\tstruct rte_rib *rib = NULL;\n+\tstruct rte_rib_conf conf;\n+\tstruct route_rule *rt;\n+\tuint64_t begin, total_time;\n+\tuint64_t next_hop_add;\n+\tuint64_t default_nh = 0;\n+\tint64_t count = 0;\n+\tunsigned i, j;\n+\tint status = 0;\n+\tint ret;\n+\tuint32_t num_routes;\n+\n+\tconf.max_nodes = 3000000;\n+\tconf.node_sz = sizeof(struct rte_rib_node);\n+\tconf.type = RTE_RIB_DIR24_8_4B;\n+\tconf.alloc_type = RTE_RIB_MEMPOOL;\n+\tconf.def_nh = default_nh;\n+\trte_srand(rte_rdtsc());\n+\n+\tnum_routes = 1200000;\n+\n+\trt = rte_zmalloc(\"struct route_rule *\", sizeof(struct route_rule) *\n+\t\tnum_routes, 0);\n+\tTEST_RIB_ASSERT(rt != NULL);\n+\n+\tnum_routes = generate_large_route_rule_table(num_routes, rt);\n+\tTEST_RIB_ASSERT(num_routes != 0);\n+\n+\tprintf(\"No. routes = %u\\n\", (unsigned) num_routes);\n+\n+\tshuffle_rt(rt, num_routes);\n+\n+\tprint_route_distribution(rt, (uint32_t) num_routes);\n+\n+\trib = rte_rib_create(__func__, SOCKET_ID_ANY, &conf);\n+\tTEST_RIB_ASSERT(rib != NULL);\n+\n+\t/* Measue add. */\n+\tbegin = rte_rdtsc();\n+\n+\tfor (i = 0; i < num_routes; i++) {\n+\t\tdo {\n+\t\t\tnext_hop_add = rte_rand() & ((1ULL << 30) - 1);\n+\t\t} while (next_hop_add == default_nh);\n+\n+\t\tret = rte_rib_add(rib, rt[i].ip, rt[i].depth, next_hop_add);\n+\t\tif ((ret == 0))\n+\t\t\tstatus++;\n+\t}\n+\n+\ttotal_time = rte_rdtsc() - begin;\n+\n+\tprintf(\"Unique added entries = %d\\n\", status);\n+\tprintf(\"Average RIB Add: %g cycles\\n\",\n+\t\t\t(double)total_time / num_routes);\n+\n+\t/* Measure Lookup */\n+\ttotal_time = 0;\n+\tcount = 0;\n+\tfor (i = 0; i < ITERATIONS; i++) {\n+\t\tstatic uint32_t ip_batch[BATCH_SIZE];\n+\t\tuint64_t nh_64;\n+\t\t/* Create array of random IP addresses */\n+\t\tfor (j = 0; j < BATCH_SIZE; j++)\n+\t\t\tip_batch[j] = rte_rand();\n+\n+\t\t/* Lookup per batch */\n+\t\tbegin = rte_rdtsc();\n+\t\tfor (j = 0; j < BATCH_SIZE; j++) {\n+\t\t\tret = rte_dir24_8_lookup(rib->fib, ip_batch[j], &nh_64);\n+\t\t\tif (unlikely(nh_64 == default_nh))\n+\t\t\t\tcount++;\n+\t\t}\n+\t\ttotal_time += rte_rdtsc() - begin;\n+\t}\n+\n+\tprintf(\"RIB Lookup: %.1f cycles (fails = %.1f%%)\\n\",\n+\t\t\t(double)total_time / ((double)ITERATIONS * BATCH_SIZE),\n+\t\t\t(count * 100.0) / (double)(ITERATIONS * BATCH_SIZE));\n+\n+\t/* Measure bulk Lookup */\n+\ttotal_time = 0;\n+\tcount = 0;\n+\tfor (i = 0; i < ITERATIONS; i++) {\n+\t\tstatic uint32_t ip_batch[BATCH_SIZE];\n+\t\tuint64_t next_hops[BULK_SIZE];\n+\n+\t\t/* Create array of random IP addresses */\n+\t\tfor (j = 0; j < BATCH_SIZE; j++)\n+\t\t\tip_batch[j] = rte_rand();\n+\n+\t\t/* Lookup per batch */\n+\t\tbegin = rte_rdtsc();\n+\t\tfor (j = 0; j < BATCH_SIZE; j += BULK_SIZE)\n+\t\t\trte_rib_fib_lookup_bulk(rib, &ip_batch[j], next_hops,\n+\t\t\t\tBULK_SIZE);\n+\n+\t\ttotal_time += rte_rdtsc() - begin;\n+\t\tfor (j = 0; j < BULK_SIZE; j++) {\n+\t\t\tif (next_hops[j] == default_nh)\n+\t\t\t\tcount++;\n+\t\t}\n+\t}\n+\tprintf(\"BULK RIB Lookup: %.1f cycles (fails = %.1f%%)\\n\",\n+\t\t\t(double)total_time / ((double)ITERATIONS * BATCH_SIZE),\n+\t\t\t(count * 100.0) / (double)(ITERATIONS * BATCH_SIZE));\n+\n+\t/* Delete */\n+\tstatus = 0;\n+\tbegin = rte_rdtsc();\n+\n+\tfor (i = 0; i < num_routes; i++) {\n+\t\tret = rte_rib_delete(rib, rt[i].ip, rt[i].depth);\n+\t\tif (ret == 0)\n+\t\t\tstatus++;\n+\t}\n+\n+\ttotal_time = rte_rdtsc() - begin;\n+\n+\tprintf(\"Average RIB Delete: %g cycles\\n\",\n+\t\t\t(double)total_time / num_routes);\n+\n+\trte_rib_free(rib);\n+\trte_free(rt);\n+\n+\treturn 0;\n+}\n+\n+REGISTER_TEST_COMMAND(rib_perf_autotest, test_rib_perf);\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "2/2"
    ]
}