get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 12685,
    "url": "http://patches.dpdk.org/api/patches/12685/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1462969011-378-1-git-send-email-thomas.monjalon@6wind.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": "<1462969011-378-1-git-send-email-thomas.monjalon@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1462969011-378-1-git-send-email-thomas.monjalon@6wind.com",
    "date": "2016-05-11T12:16:51",
    "name": "[dpdk-dev,v2] app/test: isolate lpm performance cases",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "6db1c783a83707b664138de30e8c92887cfdaeb6",
    "submitter": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/people/1/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas.monjalon@6wind.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1462969011-378-1-git-send-email-thomas.monjalon@6wind.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/12685/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/12685/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id D15FA5A55;\n\tWed, 11 May 2016 14:17:18 +0200 (CEST)",
            "from mail-wm0-f50.google.com (mail-wm0-f50.google.com\n\t[74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 2846F5A08\n\tfor <dev@dpdk.org>; Wed, 11 May 2016 14:17:17 +0200 (CEST)",
            "by mail-wm0-f50.google.com with SMTP id g17so33179127wme.0\n\tfor <dev@dpdk.org>; Wed, 11 May 2016 05:17:17 -0700 (PDT)",
            "from XPS13.localdomain (184.203.134.77.rev.sfr.net.\n\t[77.134.203.184]) by smtp.gmail.com with ESMTPSA id\n\tr75sm35656765wme.18.2016.05.11.05.17.15\n\tfor <dev@dpdk.org> (version=TLSv1/SSLv3 cipher=OTHER);\n\tWed, 11 May 2016 05:17:15 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:subject:date:message-id:in-reply-to:references;\n\tbh=OTGLSUvTvKQtVuqvW6DHpiaPplenegiYUiq0kkE7zrc=;\n\tb=fPINjw3hAfgRjMEuvtOKCqt2C9YrDd32zKyk86e+GIOYknx/Fw9dwPsuIMk5/QDnY7\n\tQDgsFeWcXc2jfJ6CH2Pxw94uVb1FJlN/9YVECDYZfcjBcMD1sPrEokN5t3vc25P7Bmgw\n\tQlUk6FO+2H3t9oAzdj9xpIOh24+yIefgRDzWNKu37cHwUZlcuOjELvYsw4WSuVYLt9xV\n\t2UdkDOo5kS36Xvxgi2eiaMlbmONCbh03KZlfyG5rSmFOmUraIUshvSI3u1rCqvy0HQSX\n\t+WQijkBeUo/qJqnOZgroytdxpSt1ERLH4CeaYw0HgFhA29uAi4bQZuTjYZxB+3xkYdyV\n\tasyQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=OTGLSUvTvKQtVuqvW6DHpiaPplenegiYUiq0kkE7zrc=;\n\tb=WJMGeiBKGr6XTU917I67eKFksthd9JTmxwJ+8D8nSYApMo6CZPprAYSd/l1KWbyRKU\n\tb6dKH4Mkr1pZ9ygXIkw9Oelf+U1uhF0cTlhfs8hBJJMS7/M954ALUTMOQXjKHfGx/WVR\n\tSHrg63YJ/Mip5qihNHDG246UDwJEl7i3J7Wd5Ky5bsLYJFDCzmIxhSyXca6Mm0jJyZp+\n\tZAD2mF5Q2726SICHwaX0zC5sokWXrOuFiu7UYx4ZtVaKa1LrVgYiBzvRMYr7QG8f9zue\n\tb0mJds9kFGgd5KV1l+A7Fv+7o6IaA5AL5u8dtS1hHQZ5WlxulObbSEVhPyU+HkV92zbG\n\txjHg==",
        "X-Gm-Message-State": "AOPr4FXDlNE+gW7jNg72l9klbQ+WHZaty6rGuv6SOrAZvGLz2hg6/iVAv1Mt44ozDBKEnEtS",
        "X-Received": "by 10.28.24.82 with SMTP id 79mr24237663wmy.42.1462969036819;\n\tWed, 11 May 2016 05:17:16 -0700 (PDT)",
        "From": "Thomas Monjalon <thomas.monjalon@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Wed, 11 May 2016 14:16:51 +0200",
        "Message-Id": "<1462969011-378-1-git-send-email-thomas.monjalon@6wind.com>",
        "X-Mailer": "git-send-email 2.7.0",
        "In-Reply-To": "<1462551208-4300-1-git-send-email-thomas.monjalon@6wind.com>",
        "References": "<1462551208-4300-1-git-send-email-thomas.monjalon@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH v2] app/test: isolate lpm performance cases",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://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": "<http://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": "The LPM performance tests should not be mixed with\nfunctional tests: they are long and show some statistics.\n\nLPM6 functional tests are added to parallel tests.\n\nSigned-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>\n---\nv2: move LPM6 autotest in parallel tests\n\n app/test/Makefile         |   2 +\n app/test/autotest_data.py |  19 ++--\n app/test/test_lpm.c       | 211 +--------------------------------------\n app/test/test_lpm6.c      | 155 +----------------------------\n app/test/test_lpm6_perf.c | 191 +++++++++++++++++++++++++++++++++++\n app/test/test_lpm_perf.c  | 249 ++++++++++++++++++++++++++++++++++++++++++++++\n 6 files changed, 454 insertions(+), 373 deletions(-)\n create mode 100644 app/test/test_lpm6_perf.c\n create mode 100644 app/test/test_lpm_perf.c",
    "diff": "diff --git a/app/test/Makefile b/app/test/Makefile\nindex a4907d5..f269fe0 100644\n--- a/app/test/Makefile\n+++ b/app/test/Makefile\n@@ -89,7 +89,9 @@ SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_functions.c\n SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_scaling.c\n \n SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_lpm.c\n+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-y += test_debug.c\n SRCS-y += test_errno.c\ndiff --git a/app/test/autotest_data.py b/app/test/autotest_data.py\nindex dde4511..8a92bb4 100644\n--- a/app/test/autotest_data.py\n+++ b/app/test/autotest_data.py\n@@ -174,6 +174,12 @@ parallel_test_group_list = [\n \t\t \"Report\" :\tNone,\n \t\t},\n \t\t{\n+\t\t\t\"Name\" :    \"LPM6 autotest\",\n+\t\t\t\"Command\" : \"lpm6_autotest\",\n+\t\t\t\"Func\" :    default_autotest,\n+\t\t\t\"Report\" :  None,\n+\t\t},\n+\t\t{\n \t\t \"Name\" :\t\"IVSHMEM autotest\",\n \t\t \"Command\" : \t\"ivshmem_autotest\",\n \t\t \"Func\" :\tdefault_autotest,\n@@ -450,19 +456,6 @@ non_parallel_test_group_list = [\n \t]\n },\n {\n-\t\"Prefix\" :\t\"lpm6\",\n-\t\"Memory\" :\t\"512\",\n-\t\"Tests\" :\n-\t[\n-\t\t{\n-                 \"Name\" :       \"LPM6 autotest\",\n-                 \"Command\" :    \"lpm6_autotest\",\n-                 \"Func\" :       default_autotest,\n-                 \"Report\" :     None,\n-                },\n-\t]\n-},\n-{\n \t\"Prefix\":\t\"timer_perf\",\n \t\"Memory\" :\tper_sockets(512),\n \t\"Tests\" :\ndiff --git a/app/test/test_lpm.c b/app/test/test_lpm.c\nindex 40fbbc6..f6930fb 100644\n--- a/app/test/test_lpm.c\n+++ b/app/test/test_lpm.c\n@@ -34,20 +34,10 @@\n #include <stdio.h>\n #include <stdint.h>\n #include <stdlib.h>\n-#include <errno.h>\n-#include <sys/queue.h>\n \n-#include <rte_common.h>\n-#include <rte_cycles.h>\n-#include <rte_memory.h>\n-#include <rte_random.h>\n-#include <rte_branch_prediction.h>\n-#include <rte_ip.h>\n-#include <time.h>\n+#include <rte_lpm.h>\n \n #include \"test.h\"\n-\n-#include \"rte_lpm.h\"\n #include \"test_lpm_routes.h\"\n #include \"test_xmmt_ops.h\"\n \n@@ -78,7 +68,6 @@ static int32_t test14(void);\n static int32_t test15(void);\n static int32_t test16(void);\n static int32_t test17(void);\n-static int32_t perf_test(void);\n \n rte_lpm_test tests[] = {\n /* Test Cases */\n@@ -100,7 +89,6 @@ rte_lpm_test tests[] = {\n \ttest15,\n \ttest16,\n \ttest17,\n-\tperf_test,\n };\n \n #define NUM_LPM_TESTS (sizeof(tests)/sizeof(tests[0]))\n@@ -1230,202 +1218,7 @@ test17(void)\n }\n \n /*\n- * Lookup performance test\n- */\n-\n-#define ITERATIONS (1 << 10)\n-#define BATCH_SIZE (1 << 12)\n-#define BULK_SIZE 32\n-\n-static 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-int32_t\n-perf_test(void)\n-{\n-\tstruct rte_lpm *lpm = NULL;\n-\tstruct rte_lpm_config config;\n-\n-\tconfig.max_rules = 1000000;\n-\tconfig.number_tbl8s = NUMBER_TBL8S;\n-\tconfig.flags = 0;\n-\tuint64_t begin, total_time, lpm_used_entries = 0;\n-\tunsigned i, j;\n-\tuint32_t next_hop_add = 0xAA, next_hop_return = 0;\n-\tint status = 0;\n-\tuint64_t cache_line_counter = 0;\n-\tint64_t count = 0;\n-\n-\trte_srand(rte_rdtsc());\n-\n-\tprintf(\"No. routes = %u\\n\", (unsigned) NUM_ROUTE_ENTRIES);\n-\n-\tprint_route_distribution(large_route_table, (uint32_t) NUM_ROUTE_ENTRIES);\n-\n-\tlpm = rte_lpm_create(__func__, SOCKET_ID_ANY, &config);\n-\tTEST_LPM_ASSERT(lpm != NULL);\n-\n-\t/* Measue add. */\n-\tbegin = rte_rdtsc();\n-\n-\tfor (i = 0; i < NUM_ROUTE_ENTRIES; i++) {\n-\t\tif (rte_lpm_add(lpm, large_route_table[i].ip,\n-\t\t\t\tlarge_route_table[i].depth, next_hop_add) == 0)\n-\t\t\tstatus++;\n-\t}\n-\t/* End Timer. */\n-\ttotal_time = rte_rdtsc() - begin;\n-\n-\tprintf(\"Unique added entries = %d\\n\", status);\n-\t/* Obtain add statistics. */\n-\tfor (i = 0; i < RTE_LPM_TBL24_NUM_ENTRIES; i++) {\n-\t\tif (lpm->tbl24[i].valid)\n-\t\t\tlpm_used_entries++;\n-\n-\t\tif (i % 32 == 0) {\n-\t\t\tif ((uint64_t)count < lpm_used_entries) {\n-\t\t\t\tcache_line_counter++;\n-\t\t\t\tcount = lpm_used_entries;\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-\tprintf(\"Used table 24 entries = %u (%g%%)\\n\",\n-\t\t\t(unsigned) lpm_used_entries,\n-\t\t\t(lpm_used_entries * 100.0) / RTE_LPM_TBL24_NUM_ENTRIES);\n-\tprintf(\"64 byte Cache entries used = %u (%u bytes)\\n\",\n-\t\t\t(unsigned) cache_line_counter, (unsigned) cache_line_counter * 64);\n-\n-\tprintf(\"Average LPM Add: %g cycles\\n\",\n-\t\t\t(double)total_time / NUM_ROUTE_ENTRIES);\n-\n-\t/* Measure single Lookup */\n-\ttotal_time = 0;\n-\tcount = 0;\n-\n-\tfor (i = 0; i < ITERATIONS; i++) {\n-\t\tstatic uint32_t ip_batch[BATCH_SIZE];\n-\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-\n-\t\tfor (j = 0; j < BATCH_SIZE; j++) {\n-\t\t\tif (rte_lpm_lookup(lpm, ip_batch[j], &next_hop_return) != 0)\n-\t\t\t\tcount++;\n-\t\t}\n-\n-\t\ttotal_time += rte_rdtsc() - begin;\n-\n-\t}\n-\tprintf(\"Average LPM 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\tuint32_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\tunsigned k;\n-\t\t\trte_lpm_lookup_bulk(lpm, &ip_batch[j], next_hops, BULK_SIZE);\n-\t\t\tfor (k = 0; k < BULK_SIZE; k++)\n-\t\t\t\tif (unlikely(!(next_hops[k] & RTE_LPM_LOOKUP_SUCCESS)))\n-\t\t\t\t\tcount++;\n-\t\t}\n-\n-\t\ttotal_time += rte_rdtsc() - begin;\n-\t}\n-\tprintf(\"BULK LPM 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 LookupX4 */\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\tuint32_t next_hops[4];\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 += RTE_DIM(next_hops)) {\n-\t\t\tunsigned k;\n-\t\t\txmm_t ipx4;\n-\n-\t\t\tipx4 = vect_loadu_sil128((xmm_t *)(ip_batch + j));\n-\t\t\tipx4 = *(xmm_t *)(ip_batch + j);\n-\t\t\trte_lpm_lookupx4(lpm, ipx4, next_hops, UINT32_MAX);\n-\t\t\tfor (k = 0; k < RTE_DIM(next_hops); k++)\n-\t\t\t\tif (unlikely(next_hops[k] == UINT32_MAX))\n-\t\t\t\t\tcount++;\n-\t\t}\n-\n-\t\ttotal_time += rte_rdtsc() - begin;\n-\t}\n-\tprintf(\"LPM LookupX4: %.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_ROUTE_ENTRIES; i++) {\n-\t\t/* rte_lpm_delete(lpm, ip, depth) */\n-\t\tstatus += rte_lpm_delete(lpm, large_route_table[i].ip,\n-\t\t\t\tlarge_route_table[i].depth);\n-\t}\n-\n-\ttotal_time += rte_rdtsc() - begin;\n-\n-\tprintf(\"Average LPM Delete: %g cycles\\n\",\n-\t\t\t(double)total_time / NUM_ROUTE_ENTRIES);\n-\n-\trte_lpm_delete_all(lpm);\n-\trte_lpm_free(lpm);\n-\n-\treturn PASS;\n-}\n-\n-/*\n- * Do all unit and performance tests.\n+ * Do all unit tests.\n  */\n \n static int\ndiff --git a/app/test/test_lpm6.c b/app/test/test_lpm6.c\nindex b464342..9163cd7 100644\n--- a/app/test/test_lpm6.c\n+++ b/app/test/test_lpm6.c\n@@ -30,25 +30,16 @@\n  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n  */\n+\n #include <stdio.h>\n #include <stdint.h>\n #include <stdlib.h>\n #include <string.h>\n-#include <errno.h>\n-#include <sys/queue.h>\n-\n-#include <time.h>\n-\n-#include \"test.h\"\n \n-#include <rte_common.h>\n-#include <rte_cycles.h>\n #include <rte_memory.h>\n-#include <rte_random.h>\n-#include <rte_branch_prediction.h>\n-#include <rte_ip.h>\n+#include <rte_lpm6.h>\n \n-#include \"rte_lpm6.h\"\n+#include \"test.h\"\n #include \"test_lpm6_routes.h\"\n \n #define TEST_LPM_ASSERT(cond) do {                                            \\\n@@ -88,7 +79,6 @@ static int32_t test24(void);\n static int32_t test25(void);\n static int32_t test26(void);\n static int32_t test27(void);\n-static int32_t perf_test(void);\n \n rte_lpm6_test tests6[] = {\n /* Test Cases */\n@@ -120,7 +110,6 @@ rte_lpm6_test tests6[] = {\n \ttest25,\n \ttest26,\n \ttest27,\n-\tperf_test,\n };\n \n #define NUM_LPM6_TESTS                (sizeof(tests6)/sizeof(tests6[0]))\n@@ -1762,143 +1751,7 @@ test27(void)\n }\n \n /*\n- * Lookup performance test\n- */\n-\n-#define ITERATIONS (1 << 10)\n-#define BATCH_SIZE 100000\n-\n-static void\n-print_route_distribution(const struct rules_tbl_entry *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 <= 128; 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-int32_t\n-perf_test(void)\n-{\n-\tstruct rte_lpm6 *lpm = NULL;\n-\tstruct rte_lpm6_config config;\n-\tuint64_t begin, total_time;\n-\tunsigned i, j;\n-\tuint8_t next_hop_add = 0xAA, next_hop_return = 0;\n-\tint status = 0;\n-\tint64_t count = 0;\n-\n-\tconfig.max_rules = 1000000;\n-\tconfig.number_tbl8s = NUMBER_TBL8S;\n-\tconfig.flags = 0;\n-\n-\trte_srand(rte_rdtsc());\n-\n-\tprintf(\"No. routes = %u\\n\", (unsigned) NUM_ROUTE_ENTRIES);\n-\n-\tprint_route_distribution(large_route_table, (uint32_t) NUM_ROUTE_ENTRIES);\n-\n-\tlpm = rte_lpm6_create(__func__, SOCKET_ID_ANY, &config);\n-\tTEST_LPM_ASSERT(lpm != NULL);\n-\n-\t/* Measure add. */\n-\tbegin = rte_rdtsc();\n-\n-\tfor (i = 0; i < NUM_ROUTE_ENTRIES; i++) {\n-\t\tif (rte_lpm6_add(lpm, large_route_table[i].ip,\n-\t\t\t\tlarge_route_table[i].depth, next_hop_add) == 0)\n-\t\t\tstatus++;\n-\t}\n-\t/* End Timer. */\n-\ttotal_time = rte_rdtsc() - begin;\n-\n-\tprintf(\"Unique added entries = %d\\n\", status);\n-\tprintf(\"Average LPM Add: %g cycles\\n\",\n-\t\t\t(double)total_time / NUM_ROUTE_ENTRIES);\n-\n-\t/* Measure single Lookup */\n-\ttotal_time = 0;\n-\tcount = 0;\n-\n-\tfor (i = 0; i < ITERATIONS; i ++) {\n-\t\tbegin = rte_rdtsc();\n-\n-\t\tfor (j = 0; j < NUM_IPS_ENTRIES; j ++) {\n-\t\t\tif (rte_lpm6_lookup(lpm, large_ips_table[j].ip,\n-\t\t\t\t\t&next_hop_return) != 0)\n-\t\t\t\tcount++;\n-\t\t}\n-\n-\t\ttotal_time += rte_rdtsc() - begin;\n-\n-\t}\n-\tprintf(\"Average LPM 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-\n-\tuint8_t ip_batch[NUM_IPS_ENTRIES][16];\n-\tint16_t next_hops[NUM_IPS_ENTRIES];\n-\n-\tfor (i = 0; i < NUM_IPS_ENTRIES; i++)\n-\t\tmemcpy(ip_batch[i], large_ips_table[i].ip, 16);\n-\n-\tfor (i = 0; i < ITERATIONS; i ++) {\n-\n-\t\t/* Lookup per batch */\n-\t\tbegin = rte_rdtsc();\n-\t\trte_lpm6_lookup_bulk_func(lpm, ip_batch, next_hops, NUM_IPS_ENTRIES);\n-\t\ttotal_time += rte_rdtsc() - begin;\n-\n-\t\tfor (j = 0; j < NUM_IPS_ENTRIES; j++)\n-\t\t\tif (next_hops[j] < 0)\n-\t\t\t\tcount++;\n-\t}\n-\tprintf(\"BULK LPM 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_ROUTE_ENTRIES; i++) {\n-\t\t/* rte_lpm_delete(lpm, ip, depth) */\n-\t\tstatus += rte_lpm6_delete(lpm, large_route_table[i].ip,\n-\t\t\t\tlarge_route_table[i].depth);\n-\t}\n-\n-\ttotal_time += rte_rdtsc() - begin;\n-\n-\tprintf(\"Average LPM Delete: %g cycles\\n\",\n-\t\t\t(double)total_time / NUM_ROUTE_ENTRIES);\n-\n-\trte_lpm6_delete_all(lpm);\n-\trte_lpm6_free(lpm);\n-\n-\treturn PASS;\n-}\n-\n-/*\n- * Do all unit and performance tests.\n+ * Do all unit tests.\n  */\n static int\n test_lpm6(void)\ndiff --git a/app/test/test_lpm6_perf.c b/app/test/test_lpm6_perf.c\nnew file mode 100644\nindex 0000000..b7d4631\n--- /dev/null\n+++ b/app/test/test_lpm6_perf.c\n@@ -0,0 +1,191 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of Intel Corporation nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <stdio.h>\n+#include <stdint.h>\n+#include <stdlib.h>\n+#include <string.h>\n+\n+#include <rte_cycles.h>\n+#include <rte_random.h>\n+#include <rte_memory.h>\n+#include <rte_lpm6.h>\n+\n+#include \"test.h\"\n+#include \"test_lpm6_routes.h\"\n+\n+#define TEST_LPM_ASSERT(cond) do {                                            \\\n+\tif (!(cond)) {                                                        \\\n+\t\tprintf(\"Error at line %d: \\n\", __LINE__);                     \\\n+\t\treturn -1;                                                    \\\n+\t}                                                                     \\\n+} while(0)\n+\n+#define ITERATIONS (1 << 10)\n+#define BATCH_SIZE 100000\n+#define NUMBER_TBL8S                                           (1 << 16)\n+\n+static void\n+print_route_distribution(const struct rules_tbl_entry *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 <= 128; 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+static int\n+test_lpm6_perf(void)\n+{\n+\tstruct rte_lpm6 *lpm = NULL;\n+\tstruct rte_lpm6_config config;\n+\tuint64_t begin, total_time;\n+\tunsigned i, j;\n+\tuint8_t next_hop_add = 0xAA, next_hop_return = 0;\n+\tint status = 0;\n+\tint64_t count = 0;\n+\n+\tconfig.max_rules = 1000000;\n+\tconfig.number_tbl8s = NUMBER_TBL8S;\n+\tconfig.flags = 0;\n+\n+\trte_srand(rte_rdtsc());\n+\n+\tprintf(\"No. routes = %u\\n\", (unsigned) NUM_ROUTE_ENTRIES);\n+\n+\tprint_route_distribution(large_route_table, (uint32_t) NUM_ROUTE_ENTRIES);\n+\n+\tlpm = rte_lpm6_create(__func__, SOCKET_ID_ANY, &config);\n+\tTEST_LPM_ASSERT(lpm != NULL);\n+\n+\t/* Measure add. */\n+\tbegin = rte_rdtsc();\n+\n+\tfor (i = 0; i < NUM_ROUTE_ENTRIES; i++) {\n+\t\tif (rte_lpm6_add(lpm, large_route_table[i].ip,\n+\t\t\t\tlarge_route_table[i].depth, next_hop_add) == 0)\n+\t\t\tstatus++;\n+\t}\n+\t/* End Timer. */\n+\ttotal_time = rte_rdtsc() - begin;\n+\n+\tprintf(\"Unique added entries = %d\\n\", status);\n+\tprintf(\"Average LPM Add: %g cycles\\n\",\n+\t\t\t(double)total_time / NUM_ROUTE_ENTRIES);\n+\n+\t/* Measure single Lookup */\n+\ttotal_time = 0;\n+\tcount = 0;\n+\n+\tfor (i = 0; i < ITERATIONS; i ++) {\n+\t\tbegin = rte_rdtsc();\n+\n+\t\tfor (j = 0; j < NUM_IPS_ENTRIES; j ++) {\n+\t\t\tif (rte_lpm6_lookup(lpm, large_ips_table[j].ip,\n+\t\t\t\t\t&next_hop_return) != 0)\n+\t\t\t\tcount++;\n+\t\t}\n+\n+\t\ttotal_time += rte_rdtsc() - begin;\n+\n+\t}\n+\tprintf(\"Average LPM 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+\n+\tuint8_t ip_batch[NUM_IPS_ENTRIES][16];\n+\tint16_t next_hops[NUM_IPS_ENTRIES];\n+\n+\tfor (i = 0; i < NUM_IPS_ENTRIES; i++)\n+\t\tmemcpy(ip_batch[i], large_ips_table[i].ip, 16);\n+\n+\tfor (i = 0; i < ITERATIONS; i ++) {\n+\n+\t\t/* Lookup per batch */\n+\t\tbegin = rte_rdtsc();\n+\t\trte_lpm6_lookup_bulk_func(lpm, ip_batch, next_hops, NUM_IPS_ENTRIES);\n+\t\ttotal_time += rte_rdtsc() - begin;\n+\n+\t\tfor (j = 0; j < NUM_IPS_ENTRIES; j++)\n+\t\t\tif (next_hops[j] < 0)\n+\t\t\t\tcount++;\n+\t}\n+\tprintf(\"BULK LPM 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_ROUTE_ENTRIES; i++) {\n+\t\t/* rte_lpm_delete(lpm, ip, depth) */\n+\t\tstatus += rte_lpm6_delete(lpm, large_route_table[i].ip,\n+\t\t\t\tlarge_route_table[i].depth);\n+\t}\n+\n+\ttotal_time += rte_rdtsc() - begin;\n+\n+\tprintf(\"Average LPM Delete: %g cycles\\n\",\n+\t\t\t(double)total_time / NUM_ROUTE_ENTRIES);\n+\n+\trte_lpm6_delete_all(lpm);\n+\trte_lpm6_free(lpm);\n+\n+\treturn 0;\n+}\n+\n+static struct test_command lpm6_perf_cmd = {\n+\t.command = \"lpm6_perf_autotest\",\n+\t.callback = test_lpm6_perf,\n+};\n+REGISTER_TEST_COMMAND(lpm6_perf_cmd);\ndiff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c\nnew file mode 100644\nindex 0000000..41da811\n--- /dev/null\n+++ b/app/test/test_lpm_perf.c\n@@ -0,0 +1,249 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of Intel Corporation nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\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_lpm.h>\n+\n+#include \"test.h\"\n+#include \"test_lpm_routes.h\"\n+#include \"test_xmmt_ops.h\"\n+\n+#define TEST_LPM_ASSERT(cond) do {                                            \\\n+\tif (!(cond)) {                                                        \\\n+\t\tprintf(\"Error at line %d: \\n\", __LINE__);                     \\\n+\t\treturn -1;                                                    \\\n+\t}                                                                     \\\n+} while(0)\n+\n+#define ITERATIONS (1 << 10)\n+#define BATCH_SIZE (1 << 12)\n+#define BULK_SIZE 32\n+\n+static 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+static int\n+test_lpm_perf(void)\n+{\n+\tstruct rte_lpm *lpm = NULL;\n+\tstruct rte_lpm_config config;\n+\n+\tconfig.max_rules = 1000000;\n+\tconfig.number_tbl8s = 256;\n+\tconfig.flags = 0;\n+\tuint64_t begin, total_time, lpm_used_entries = 0;\n+\tunsigned i, j;\n+\tuint32_t next_hop_add = 0xAA, next_hop_return = 0;\n+\tint status = 0;\n+\tuint64_t cache_line_counter = 0;\n+\tint64_t count = 0;\n+\n+\trte_srand(rte_rdtsc());\n+\n+\tprintf(\"No. routes = %u\\n\", (unsigned) NUM_ROUTE_ENTRIES);\n+\n+\tprint_route_distribution(large_route_table, (uint32_t) NUM_ROUTE_ENTRIES);\n+\n+\tlpm = rte_lpm_create(__func__, SOCKET_ID_ANY, &config);\n+\tTEST_LPM_ASSERT(lpm != NULL);\n+\n+\t/* Measue add. */\n+\tbegin = rte_rdtsc();\n+\n+\tfor (i = 0; i < NUM_ROUTE_ENTRIES; i++) {\n+\t\tif (rte_lpm_add(lpm, large_route_table[i].ip,\n+\t\t\t\tlarge_route_table[i].depth, next_hop_add) == 0)\n+\t\t\tstatus++;\n+\t}\n+\t/* End Timer. */\n+\ttotal_time = rte_rdtsc() - begin;\n+\n+\tprintf(\"Unique added entries = %d\\n\", status);\n+\t/* Obtain add statistics. */\n+\tfor (i = 0; i < RTE_LPM_TBL24_NUM_ENTRIES; i++) {\n+\t\tif (lpm->tbl24[i].valid)\n+\t\t\tlpm_used_entries++;\n+\n+\t\tif (i % 32 == 0) {\n+\t\t\tif ((uint64_t)count < lpm_used_entries) {\n+\t\t\t\tcache_line_counter++;\n+\t\t\t\tcount = lpm_used_entries;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\tprintf(\"Used table 24 entries = %u (%g%%)\\n\",\n+\t\t\t(unsigned) lpm_used_entries,\n+\t\t\t(lpm_used_entries * 100.0) / RTE_LPM_TBL24_NUM_ENTRIES);\n+\tprintf(\"64 byte Cache entries used = %u (%u bytes)\\n\",\n+\t\t\t(unsigned) cache_line_counter, (unsigned) cache_line_counter * 64);\n+\n+\tprintf(\"Average LPM Add: %g cycles\\n\",\n+\t\t\t(double)total_time / NUM_ROUTE_ENTRIES);\n+\n+\t/* Measure single Lookup */\n+\ttotal_time = 0;\n+\tcount = 0;\n+\n+\tfor (i = 0; i < ITERATIONS; i++) {\n+\t\tstatic uint32_t ip_batch[BATCH_SIZE];\n+\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+\n+\t\tfor (j = 0; j < BATCH_SIZE; j++) {\n+\t\t\tif (rte_lpm_lookup(lpm, ip_batch[j], &next_hop_return) != 0)\n+\t\t\t\tcount++;\n+\t\t}\n+\n+\t\ttotal_time += rte_rdtsc() - begin;\n+\n+\t}\n+\tprintf(\"Average LPM 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\tuint32_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\tunsigned k;\n+\t\t\trte_lpm_lookup_bulk(lpm, &ip_batch[j], next_hops, BULK_SIZE);\n+\t\t\tfor (k = 0; k < BULK_SIZE; k++)\n+\t\t\t\tif (unlikely(!(next_hops[k] & RTE_LPM_LOOKUP_SUCCESS)))\n+\t\t\t\t\tcount++;\n+\t\t}\n+\n+\t\ttotal_time += rte_rdtsc() - begin;\n+\t}\n+\tprintf(\"BULK LPM 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 LookupX4 */\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\tuint32_t next_hops[4];\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 += RTE_DIM(next_hops)) {\n+\t\t\tunsigned k;\n+\t\t\txmm_t ipx4;\n+\n+\t\t\tipx4 = vect_loadu_sil128((xmm_t *)(ip_batch + j));\n+\t\t\tipx4 = *(xmm_t *)(ip_batch + j);\n+\t\t\trte_lpm_lookupx4(lpm, ipx4, next_hops, UINT32_MAX);\n+\t\t\tfor (k = 0; k < RTE_DIM(next_hops); k++)\n+\t\t\t\tif (unlikely(next_hops[k] == UINT32_MAX))\n+\t\t\t\t\tcount++;\n+\t\t}\n+\n+\t\ttotal_time += rte_rdtsc() - begin;\n+\t}\n+\tprintf(\"LPM LookupX4: %.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_ROUTE_ENTRIES; i++) {\n+\t\t/* rte_lpm_delete(lpm, ip, depth) */\n+\t\tstatus += rte_lpm_delete(lpm, large_route_table[i].ip,\n+\t\t\t\tlarge_route_table[i].depth);\n+\t}\n+\n+\ttotal_time += rte_rdtsc() - begin;\n+\n+\tprintf(\"Average LPM Delete: %g cycles\\n\",\n+\t\t\t(double)total_time / NUM_ROUTE_ENTRIES);\n+\n+\trte_lpm_delete_all(lpm);\n+\trte_lpm_free(lpm);\n+\n+\treturn 0;\n+}\n+\n+static struct test_command lpm_perf_cmd = {\n+\t.command = \"lpm_perf_autotest\",\n+\t.callback = test_lpm_perf,\n+};\n+REGISTER_TEST_COMMAND(lpm_perf_cmd);\n",
    "prefixes": [
        "dpdk-dev",
        "v2"
    ]
}