Show a patch.

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

{
    "id": 73544,
    "url": "https://patches.dpdk.org/api/patches/73544/",
    "web_url": "https://patches.dpdk.org/patch/73544/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<d674a8f3d369561305737630898f7eecf67b1237.1594238610.git.vladimir.medvedkin@intel.com>",
    "date": "2020-07-08T20:16:10",
    "name": "[v4,5/8] fib6: make lookup function type configurable",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b0707de522ea738683fffae156acdf032cf52a42",
    "submitter": {
        "id": 1216,
        "url": "https://patches.dpdk.org/api/people/1216/",
        "name": "Vladimir Medvedkin",
        "email": "vladimir.medvedkin@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/patch/73544/mbox/",
    "series": [
        {
            "id": 10896,
            "url": "https://patches.dpdk.org/api/series/10896/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10896",
            "date": "2020-07-08T20:16:05",
            "name": "fib: implement AVX512 vector lookup",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/10896/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73544/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/73544/checks/",
    "tags": {},
    "headers": {
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "IronPort-SDR": [
            "\n DjDNudaNGCkTVrlLLZYEEgXGDNXUZIvrvXzRD4eKy3DoVB25Y0asDXBz/I3zbPYgjHxQ3Oz2MZ\n OSYXryG7FwTg==",
            "\n uI7Tj6hLJhvR2aZCA1xAj6tq67UMc1R4NAT5DICoYJMv94j7cxN/R/0XXq+4qOfJVLXsPfpp63\n OG7JH1hz773g=="
        ],
        "X-Mailer": "git-send-email 2.17.1",
        "To": "dev@dpdk.org",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 9D233A0526;\n\tWed,  8 Jul 2020 22:17:38 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BB53F1DE93;\n\tWed,  8 Jul 2020 22:17:00 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id 944701DCB3\n for <dev@dpdk.org>; Wed,  8 Jul 2020 22:16:55 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 Jul 2020 13:16:55 -0700",
            "from silpixa00400322.ir.intel.com ([10.237.214.86])\n by fmsmga002.fm.intel.com with ESMTP; 08 Jul 2020 13:16:54 -0700"
        ],
        "X-BeenThere": "dev@dpdk.org",
        "X-Amp-File-Uploaded": "False",
        "Subject": "[dpdk-dev] [PATCH v4 5/8] fib6: make lookup function type\n\tconfigurable",
        "Cc": "konstantin.ananyev@intel.com,\n\tbruce.richardson@intel.com",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "In-Reply-To": [
            "<cover.1594238609.git.vladimir.medvedkin@intel.com>",
            "<cover.1594238609.git.vladimir.medvedkin@intel.com>"
        ],
        "X-ExtLoop1": "1",
        "Precedence": "list",
        "From": "Vladimir Medvedkin <vladimir.medvedkin@intel.com>",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9676\"; a=\"135346088\"",
            "E=Sophos;i=\"5.75,329,1589266800\"; d=\"scan'208\";a=\"135346088\"",
            "E=Sophos;i=\"5.75,329,1589266800\"; d=\"scan'208\";a=\"315988606\""
        ],
        "References": [
            "<cover.1594238609.git.vladimir.medvedkin@intel.com>",
            "<cover.1589890262.git.vladimir.medvedkin@intel.com>\n <cover.1594238609.git.vladimir.medvedkin@intel.com>"
        ],
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Errors-To": "dev-bounces@dpdk.org",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Message-Id": "\n <d674a8f3d369561305737630898f7eecf67b1237.1594238610.git.vladimir.medvedkin@intel.com>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Date": "Wed,  8 Jul 2020 21:16:10 +0100",
        "X-Mailman-Version": "2.1.15"
    },
    "content": "Add type argument to trie_get_lookup_fn()\nNow it only supports RTE_FIB6_TRIE_SCALAR\n\nAdd new rte_fib6_set_lookup_fn() - user can change lookup\nfunction type runtime.\n\nSigned-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>\n---\n lib/librte_fib/rte_fib6.c          | 20 +++++++++++++++++++-\n lib/librte_fib/rte_fib6.h          | 21 +++++++++++++++++++++\n lib/librte_fib/rte_fib_version.map |  1 +\n lib/librte_fib/trie.c              | 25 ++++++++++++++-----------\n lib/librte_fib/trie.h              |  2 +-\n 5 files changed, 56 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/lib/librte_fib/rte_fib6.c b/lib/librte_fib/rte_fib6.c\nindex a1f0db844..566cd5fb6 100644\n--- a/lib/librte_fib/rte_fib6.c\n+++ b/lib/librte_fib/rte_fib6.c\n@@ -107,7 +107,7 @@ init_dataplane(struct rte_fib6 *fib, __rte_unused int socket_id,\n \t\tfib->dp = trie_create(dp_name, socket_id, conf);\n \t\tif (fib->dp == NULL)\n \t\t\treturn -rte_errno;\n-\t\tfib->lookup = rte_trie_get_lookup_fn(conf);\n+\t\tfib->lookup = trie_get_lookup_fn(fib->dp, RTE_FIB6_TRIE_SCALAR);\n \t\tfib->modify = trie_modify;\n \t\treturn 0;\n \tdefault:\n@@ -319,3 +319,21 @@ rte_fib6_get_rib(struct rte_fib6 *fib)\n {\n \treturn (fib == NULL) ? NULL : fib->rib;\n }\n+\n+int\n+rte_fib6_set_lookup_fn(struct rte_fib6 *fib,\n+\tenum rte_fib_trie_lookup_type type)\n+{\n+\trte_fib6_lookup_fn_t fn;\n+\n+\tswitch (fib->type) {\n+\tcase RTE_FIB6_TRIE:\n+\t\tfn = trie_get_lookup_fn(fib->dp, type);\n+\t\tif (fn == NULL)\n+\t\t\treturn -EINVAL;\n+\t\tfib->lookup = fn;\n+\t\treturn 0;\n+\tdefault:\n+\t\treturn -EINVAL;\n+\t}\n+}\ndiff --git a/lib/librte_fib/rte_fib6.h b/lib/librte_fib/rte_fib6.h\nindex bbfcf23a8..e029c7624 100644\n--- a/lib/librte_fib/rte_fib6.h\n+++ b/lib/librte_fib/rte_fib6.h\n@@ -59,6 +59,10 @@ enum rte_fib_trie_nh_sz {\n \tRTE_FIB6_TRIE_8B\n };\n \n+enum rte_fib_trie_lookup_type {\n+\tRTE_FIB6_TRIE_SCALAR\n+};\n+\n /** FIB configuration structure */\n struct rte_fib6_conf {\n \tenum rte_fib6_type type; /**< Type of FIB struct */\n@@ -201,6 +205,23 @@ __rte_experimental\n struct rte_rib6 *\n rte_fib6_get_rib(struct rte_fib6 *fib);\n \n+/**\n+ * Set lookup function based on type\n+ *\n+ * @param fib\n+ *   FIB object handle\n+ * @param type\n+ *   type of lookup function\n+ *\n+ * @return\n+ *    -EINVAL on failure\n+ *    0 on success\n+ */\n+__rte_experimental\n+int\n+rte_fib6_set_lookup_fn(struct rte_fib6 *fib,\n+\tenum rte_fib_trie_lookup_type type);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_fib/rte_fib_version.map b/lib/librte_fib/rte_fib_version.map\nindex 216af66b3..9d1e181b3 100644\n--- a/lib/librte_fib/rte_fib_version.map\n+++ b/lib/librte_fib/rte_fib_version.map\n@@ -19,6 +19,7 @@ EXPERIMENTAL {\n \trte_fib6_lookup_bulk;\n \trte_fib6_get_dp;\n \trte_fib6_get_rib;\n+\trte_fib6_set_lookup_fn;\n \n \tlocal: *;\n };\ndiff --git a/lib/librte_fib/trie.c b/lib/librte_fib/trie.c\nindex 2ae2add4f..63c519a09 100644\n--- a/lib/librte_fib/trie.c\n+++ b/lib/librte_fib/trie.c\n@@ -59,13 +59,6 @@ enum edge {\n \tREDGE\n };\n \n-enum lookup_type {\n-\tMACRO,\n-\tINLINE,\n-\tUNI\n-};\n-static enum lookup_type test_lookup = MACRO;\n-\n static inline uint32_t\n get_tbl24_idx(const uint8_t *ip)\n {\n@@ -154,11 +147,18 @@ LOOKUP_FUNC(4b, uint32_t, 2)\n LOOKUP_FUNC(8b, uint64_t, 3)\n \n rte_fib6_lookup_fn_t\n-rte_trie_get_lookup_fn(struct rte_fib6_conf *conf)\n+trie_get_lookup_fn(void *p, enum rte_fib_trie_lookup_type type)\n {\n-\tenum rte_fib_trie_nh_sz nh_sz = conf->trie.nh_sz;\n+\tenum rte_fib_trie_nh_sz nh_sz;\n+\tstruct rte_trie_tbl *dp = p;\n \n-\tif (test_lookup == MACRO) {\n+\tif (dp == NULL)\n+\t\treturn NULL;\n+\n+\tnh_sz = dp->nh_sz;\n+\n+\tswitch (type) {\n+\tcase RTE_FIB6_TRIE_SCALAR:\n \t\tswitch (nh_sz) {\n \t\tcase RTE_FIB6_TRIE_2B:\n \t\t\treturn rte_trie_lookup_bulk_2b;\n@@ -166,9 +166,12 @@ rte_trie_get_lookup_fn(struct rte_fib6_conf *conf)\n \t\t\treturn rte_trie_lookup_bulk_4b;\n \t\tcase RTE_FIB6_TRIE_8B:\n \t\t\treturn rte_trie_lookup_bulk_8b;\n+\t\tdefault:\n+\t\t\treturn NULL;\n \t\t}\n+\tdefault:\n+\t\treturn NULL;\n \t}\n-\n \treturn NULL;\n }\n \ndiff --git a/lib/librte_fib/trie.h b/lib/librte_fib/trie.h\nindex bb750c5ae..0d5ef9a9f 100644\n--- a/lib/librte_fib/trie.h\n+++ b/lib/librte_fib/trie.h\n@@ -22,7 +22,7 @@ void\n trie_free(void *p);\n \n rte_fib6_lookup_fn_t\n-rte_trie_get_lookup_fn(struct rte_fib6_conf *fib_conf);\n+trie_get_lookup_fn(void *p, enum rte_fib_trie_lookup_type type);\n \n int\n trie_modify(struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE],\n",
    "prefixes": [
        "v4",
        "5/8"
    ]
}