Show a patch.

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

{
    "id": 73541,
    "url": "https://patches.dpdk.org/api/patches/73541/?format=api",
    "web_url": "https://patches.dpdk.org/patch/73541/",
    "project": {
        "id": 1,
        "url": "https://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"
    },
    "msgid": "<9c33e906ffc464d32c792c35a238d57df0b16295.1594238610.git.vladimir.medvedkin@intel.com>",
    "date": "2020-07-08T20:16:07",
    "name": "[v4,2/8] fib: make lookup function type configurable",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6bfaf9490e8348122301ab544ffc849e3847eb50",
    "submitter": {
        "id": 1216,
        "url": "https://patches.dpdk.org/api/people/1216/?format=api",
        "name": "Medvedkin, Vladimir",
        "email": "vladimir.medvedkin@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/patch/73541/mbox/",
    "series": [
        {
            "id": 10896,
            "url": "https://patches.dpdk.org/api/series/10896/?format=api",
            "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/73541/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/73541/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9676\"; a=\"135346081\"",
            "E=Sophos;i=\"5.75,329,1589266800\"; d=\"scan'208\";a=\"135346081\"",
            "E=Sophos;i=\"5.75,329,1589266800\"; d=\"scan'208\";a=\"315988586\""
        ],
        "IronPort-SDR": [
            "\n Jiml9sgBTIrMe8UBsLlkZ2ZOWhuWVTZwdccxlY4M50lfWLMg7AzuqGiCepX3NQ7BdeMru31Cpj\n CpDcG9eYkg4g==",
            "\n 9t4o8FDPxI/xgtNOkrD772HMa9+tYXD2ltfYdDRQ++Dbkiy1sMQft8ShfjVYL/c+CUNMqNk1MZ\n 0f+tzHnfYwdA=="
        ],
        "X-Amp-File-Uploaded": "False",
        "Precedence": "list",
        "X-Mailman-Version": "2.1.15",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-BeenThere": "dev@dpdk.org",
        "References": [
            "<cover.1594238609.git.vladimir.medvedkin@intel.com>",
            "<cover.1589890262.git.vladimir.medvedkin@intel.com>\n <cover.1594238609.git.vladimir.medvedkin@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v4 2/8] fib: make lookup function type\n\tconfigurable",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 45791A0526;\n\tWed,  8 Jul 2020 22:17:11 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D963A1DCBD;\n\tWed,  8 Jul 2020 22:16:55 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id 866CE1D942\n for <dev@dpdk.org>; Wed,  8 Jul 2020 22:16:51 +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:51 -0700",
            "from silpixa00400322.ir.intel.com ([10.237.214.86])\n by fmsmga002.fm.intel.com with ESMTP; 08 Jul 2020 13:16:50 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Mailer": "git-send-email 2.17.1",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-ExtLoop1": "1",
        "Date": "Wed,  8 Jul 2020 21:16:07 +0100",
        "To": "dev@dpdk.org",
        "From": "Vladimir Medvedkin <vladimir.medvedkin@intel.com>",
        "In-Reply-To": [
            "<cover.1594238609.git.vladimir.medvedkin@intel.com>",
            "<cover.1594238609.git.vladimir.medvedkin@intel.com>"
        ],
        "Cc": "konstantin.ananyev@intel.com,\n\tbruce.richardson@intel.com",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "\n <9c33e906ffc464d32c792c35a238d57df0b16295.1594238610.git.vladimir.medvedkin@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "Add type argument to dir24_8_get_lookup_fn()\nNow it supports 3 different lookup implementations:\n RTE_FIB_DIR24_8_SCALAR_MACRO\n RTE_FIB_DIR24_8_SCALAR_INLINE\n RTE_FIB_DIR24_8_SCALAR_UNI\n\nAdd new rte_fib_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/dir24_8.c           | 32 +++++++++++++++++++-----------\n lib/librte_fib/dir24_8.h           |  2 +-\n lib/librte_fib/rte_fib.c           | 21 +++++++++++++++++++-\n lib/librte_fib/rte_fib.h           | 23 +++++++++++++++++++++\n lib/librte_fib/rte_fib_version.map |  1 +\n 5 files changed, 65 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/lib/librte_fib/dir24_8.c b/lib/librte_fib/dir24_8.c\nindex c9dce3cbc..825d061fd 100644\n--- a/lib/librte_fib/dir24_8.c\n+++ b/lib/librte_fib/dir24_8.c\n@@ -45,13 +45,6 @@ struct dir24_8_tbl {\n \n #define ROUNDUP(x, y)\t RTE_ALIGN_CEIL(x, (1 << (32 - y)))\n \n-enum lookup_type {\n-\tMACRO,\n-\tINLINE,\n-\tUNI\n-};\n-enum lookup_type test_lookup = MACRO;\n-\n static inline void *\n get_tbl24_p(struct dir24_8_tbl *dp, uint32_t ip, uint8_t nh_sz)\n {\n@@ -253,11 +246,18 @@ dir24_8_lookup_bulk_uni(void *p, const uint32_t *ips,\n }\n \n rte_fib_lookup_fn_t\n-dir24_8_get_lookup_fn(struct rte_fib_conf *fib_conf)\n+dir24_8_get_lookup_fn(void *p, enum rte_fib_dir24_8_lookup_type type)\n {\n-\tenum rte_fib_dir24_8_nh_sz nh_sz = fib_conf->dir24_8.nh_sz;\n+\tenum rte_fib_dir24_8_nh_sz nh_sz;\n+\tstruct dir24_8_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_FIB_DIR24_8_SCALAR_MACRO:\n \t\tswitch (nh_sz) {\n \t\tcase RTE_FIB_DIR24_8_1B:\n \t\t\treturn dir24_8_lookup_bulk_1b;\n@@ -267,8 +267,10 @@ dir24_8_get_lookup_fn(struct rte_fib_conf *fib_conf)\n \t\t\treturn dir24_8_lookup_bulk_4b;\n \t\tcase RTE_FIB_DIR24_8_8B:\n \t\t\treturn dir24_8_lookup_bulk_8b;\n+\t\tdefault:\n+\t\t\treturn NULL;\n \t\t}\n-\t} else if (test_lookup == INLINE) {\n+\tcase RTE_FIB_DIR24_8_SCALAR_INLINE:\n \t\tswitch (nh_sz) {\n \t\tcase RTE_FIB_DIR24_8_1B:\n \t\t\treturn dir24_8_lookup_bulk_0;\n@@ -278,9 +280,15 @@ dir24_8_get_lookup_fn(struct rte_fib_conf *fib_conf)\n \t\t\treturn dir24_8_lookup_bulk_2;\n \t\tcase RTE_FIB_DIR24_8_8B:\n \t\t\treturn dir24_8_lookup_bulk_3;\n+\t\tdefault:\n+\t\t\treturn NULL;\n \t\t}\n-\t} else\n+\tcase RTE_FIB_DIR24_8_SCALAR_UNI:\n \t\treturn dir24_8_lookup_bulk_uni;\n+\tdefault:\n+\t\treturn NULL;\n+\t}\n+\n \treturn NULL;\n }\n \ndiff --git a/lib/librte_fib/dir24_8.h b/lib/librte_fib/dir24_8.h\nindex 1ec437c0c..53c5dd29e 100644\n--- a/lib/librte_fib/dir24_8.h\n+++ b/lib/librte_fib/dir24_8.h\n@@ -22,7 +22,7 @@ void\n dir24_8_free(void *p);\n \n rte_fib_lookup_fn_t\n-dir24_8_get_lookup_fn(struct rte_fib_conf *conf);\n+dir24_8_get_lookup_fn(void *p, enum rte_fib_dir24_8_lookup_type type);\n \n int\n dir24_8_modify(struct rte_fib *fib, uint32_t ip, uint8_t depth,\ndiff --git a/lib/librte_fib/rte_fib.c b/lib/librte_fib/rte_fib.c\nindex e0908084f..b9f6efbb1 100644\n--- a/lib/librte_fib/rte_fib.c\n+++ b/lib/librte_fib/rte_fib.c\n@@ -107,7 +107,8 @@ init_dataplane(struct rte_fib *fib, __rte_unused int socket_id,\n \t\tfib->dp = dir24_8_create(dp_name, socket_id, conf);\n \t\tif (fib->dp == NULL)\n \t\t\treturn -rte_errno;\n-\t\tfib->lookup = dir24_8_get_lookup_fn(conf);\n+\t\tfib->lookup = dir24_8_get_lookup_fn(fib->dp,\n+\t\t\tRTE_FIB_DIR24_8_SCALAR_MACRO);\n \t\tfib->modify = dir24_8_modify;\n \t\treturn 0;\n \tdefault:\n@@ -317,3 +318,21 @@ rte_fib_get_rib(struct rte_fib *fib)\n {\n \treturn (fib == NULL) ? NULL : fib->rib;\n }\n+\n+int\n+rte_fib_set_lookup_fn(struct rte_fib *fib,\n+\tenum rte_fib_dir24_8_lookup_type type)\n+{\n+\trte_fib_lookup_fn_t fn;\n+\n+\tswitch (fib->type) {\n+\tcase RTE_FIB_DIR24_8:\n+\t\tfn = dir24_8_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_fib.h b/lib/librte_fib/rte_fib.h\nindex 84ee774d2..892898c6f 100644\n--- a/lib/librte_fib/rte_fib.h\n+++ b/lib/librte_fib/rte_fib.h\n@@ -58,6 +58,12 @@ enum rte_fib_dir24_8_nh_sz {\n \tRTE_FIB_DIR24_8_8B\n };\n \n+enum rte_fib_dir24_8_lookup_type {\n+\tRTE_FIB_DIR24_8_SCALAR_MACRO,\n+\tRTE_FIB_DIR24_8_SCALAR_INLINE,\n+\tRTE_FIB_DIR24_8_SCALAR_UNI\n+};\n+\n /** FIB configuration structure */\n struct rte_fib_conf {\n \tenum rte_fib_type type; /**< Type of FIB struct */\n@@ -196,6 +202,23 @@ __rte_experimental\n struct rte_rib *\n rte_fib_get_rib(struct rte_fib *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_fib_set_lookup_fn(struct rte_fib *fib,\n+\tenum rte_fib_dir24_8_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 9527417d2..216af66b3 100644\n--- a/lib/librte_fib/rte_fib_version.map\n+++ b/lib/librte_fib/rte_fib_version.map\n@@ -9,6 +9,7 @@ EXPERIMENTAL {\n \trte_fib_lookup_bulk;\n \trte_fib_get_dp;\n \trte_fib_get_rib;\n+\trte_fib_set_lookup_fn;\n \n \trte_fib6_add;\n \trte_fib6_create;\n",
    "prefixes": [
        "v4",
        "2/8"
    ]
}