get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 102999,
    "url": "https://patches.dpdk.org/api/patches/102999/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1635280335-164030-4-git-send-email-vladimir.medvedkin@intel.com/",
    "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",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1635280335-164030-4-git-send-email-vladimir.medvedkin@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1635280335-164030-4-git-send-email-vladimir.medvedkin@intel.com",
    "date": "2021-10-26T20:32:14",
    "name": "[v6,3/4] hash: enable gfni thash implementation",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "cca2efb8d54c3ad2580bf167548c8711b678a574",
    "submitter": {
        "id": 1216,
        "url": "https://patches.dpdk.org/api/people/1216/?format=api",
        "name": "Vladimir Medvedkin",
        "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/project/dpdk/patch/1635280335-164030-4-git-send-email-vladimir.medvedkin@intel.com/mbox/",
    "series": [
        {
            "id": 20026,
            "url": "https://patches.dpdk.org/api/series/20026/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=20026",
            "date": "2021-10-26T20:32:11",
            "name": "optimized Toeplitz hash implementation",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/20026/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/102999/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/102999/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id EE1A0A0547;\n\tTue, 26 Oct 2021 22:32:54 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6F3F74111C;\n\tTue, 26 Oct 2021 22:32:47 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 8775D410D5\n for <dev@dpdk.org>; Tue, 26 Oct 2021 22:32:42 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 26 Oct 2021 13:32:24 -0700",
            "from silpixa00400072.ir.intel.com ([10.237.222.213])\n by orsmga003.jf.intel.com with ESMTP; 26 Oct 2021 13:32:23 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10149\"; a=\"229866109\"",
            "E=Sophos;i=\"5.87,184,1631602800\"; d=\"scan'208\";a=\"229866109\"",
            "E=Sophos;i=\"5.87,184,1631602800\"; d=\"scan'208\";a=\"447258934\""
        ],
        "X-ExtLoop1": "1",
        "From": "Vladimir Medvedkin <vladimir.medvedkin@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "yipeng1.wang@intel.com, sameh.gobriel@intel.com,\n bruce.richardson@intel.com, konstantin.ananyev@intel.com,\n stephen@networkplumber.org, thomas@monjalon.net",
        "Date": "Tue, 26 Oct 2021 21:32:14 +0100",
        "Message-Id": "<1635280335-164030-4-git-send-email-vladimir.medvedkin@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": [
            "<1635280335-164030-1-git-send-email-vladimir.medvedkin@intel.com>",
            "<1630944239-363648-1-git-send-email-vladimir.medvedkin@intel.com>"
        ],
        "References": [
            "<1635280335-164030-1-git-send-email-vladimir.medvedkin@intel.com>",
            "<1630944239-363648-1-git-send-email-vladimir.medvedkin@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v6 3/4] hash: enable gfni thash implementation",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "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-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch enables new GFNI Toeplitz hash in\npredictable RSS library.\n\nSigned-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>\nAcked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n lib/hash/rte_thash.c | 42 ++++++++++++++++++++++++++++++++++++++----\n lib/hash/rte_thash.h | 19 +++++++++++++++++++\n lib/hash/version.map |  1 +\n 3 files changed, 58 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c\nindex e605a6f..242d0ff 100644\n--- a/lib/hash/rte_thash.c\n+++ b/lib/hash/rte_thash.c\n@@ -87,6 +87,8 @@ struct rte_thash_ctx {\n \tuint32_t\treta_sz_log;\t/** < size of the RSS ReTa in bits */\n \tuint32_t\tsubtuples_nb;\t/** < number of subtuples */\n \tuint32_t\tflags;\n+\tuint64_t\t*matrices;\n+\t/**< matrices used with rte_thash_gfni implementation */\n \tuint8_t\t\thash_key[0];\n };\n \n@@ -266,12 +268,28 @@ rte_thash_init_ctx(const char *name, uint32_t key_len, uint32_t reta_sz,\n \t\t\tctx->hash_key[i] = rte_rand();\n \t}\n \n+\tif (rte_thash_gfni_supported()) {\n+\t\tctx->matrices = rte_zmalloc(NULL, key_len * sizeof(uint64_t),\n+\t\t\tRTE_CACHE_LINE_SIZE);\n+\t\tif (ctx->matrices == NULL) {\n+\t\t\tRTE_LOG(ERR, HASH, \"Cannot allocate matrices\\n\");\n+\t\t\trte_errno = ENOMEM;\n+\t\t\tgoto free_ctx;\n+\t\t}\n+\n+\t\trte_thash_complete_matrix(ctx->matrices, ctx->hash_key,\n+\t\t\tkey_len);\n+\t}\n+\n \tte->data = (void *)ctx;\n \tTAILQ_INSERT_TAIL(thash_list, te, next);\n \n \trte_mcfg_tailq_write_unlock();\n \n \treturn ctx;\n+\n+free_ctx:\n+\trte_free(ctx);\n free_te:\n \trte_free(te);\n exit:\n@@ -385,6 +403,10 @@ generate_subkey(struct rte_thash_ctx *ctx, struct thash_lfsr *lfsr,\n \t\t\tset_bit(ctx->hash_key, get_rev_bit_lfsr(lfsr), i);\n \t}\n \n+\tif (ctx->matrices != NULL)\n+\t\trte_thash_complete_matrix(ctx->matrices, ctx->hash_key,\n+\t\t\tctx->key_len);\n+\n \treturn 0;\n }\n \n@@ -641,6 +663,12 @@ rte_thash_get_key(struct rte_thash_ctx *ctx)\n \treturn ctx->hash_key;\n }\n \n+const uint64_t *\n+rte_thash_get_gfni_matrices(struct rte_thash_ctx *ctx)\n+{\n+\treturn ctx->matrices;\n+}\n+\n static inline uint8_t\n read_unaligned_byte(uint8_t *ptr, unsigned int len, unsigned int offset)\n {\n@@ -752,11 +780,17 @@ rte_thash_adjust_tuple(struct rte_thash_ctx *ctx,\n \tattempts = RTE_MIN(attempts, 1U << (h->tuple_len - ctx->reta_sz_log));\n \n \tfor (i = 0; i < attempts; i++) {\n-\t\tfor (j = 0; j < (tuple_len / 4); j++)\n-\t\t\ttmp_tuple[j] =\n-\t\t\t\trte_be_to_cpu_32(*(uint32_t *)&tuple[j * 4]);\n+\t\tif (ctx->matrices != NULL)\n+\t\t\thash = rte_thash_gfni(ctx->matrices, tuple, tuple_len);\n+\t\telse {\n+\t\t\tfor (j = 0; j < (tuple_len / 4); j++)\n+\t\t\t\ttmp_tuple[j] =\n+\t\t\t\t\trte_be_to_cpu_32(\n+\t\t\t\t\t\t*(uint32_t *)&tuple[j * 4]);\n+\n+\t\t\thash = rte_softrss(tmp_tuple, tuple_len / 4, hash_key);\n+\t\t}\n \n-\t\thash = rte_softrss(tmp_tuple, tuple_len / 4, hash_key);\n \t\tadj_bits = rte_thash_get_complement(h, hash, desired_value);\n \n \t\t/*\ndiff --git a/lib/hash/rte_thash.h b/lib/hash/rte_thash.h\nindex 40146cf..c11ca0d 100644\n--- a/lib/hash/rte_thash.h\n+++ b/lib/hash/rte_thash.h\n@@ -419,6 +419,25 @@ const uint8_t *\n rte_thash_get_key(struct rte_thash_ctx *ctx);\n \n /**\n+ * Get a pointer to the toeplitz hash matrices contained in the context.\n+ * These matrices could be used with fast toeplitz hash implementation if\n+ * CPU supports GFNI.\n+ * Matrices changes after each addition of a helper.\n+ *\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * @param ctx\n+ *  Thash context\n+ * @return\n+ *  A pointer to the toeplitz hash key matrices on success\n+ *  NULL if GFNI is not supported.\n+ */\n+__rte_experimental\n+const uint64_t *\n+rte_thash_get_gfni_matrices(struct rte_thash_ctx *ctx);\n+\n+/**\n  * Function prototype for the rte_thash_adjust_tuple\n  * to check if adjusted tuple could be used.\n  * Generally it is some kind of lookup function to check\ndiff --git a/lib/hash/version.map b/lib/hash/version.map\nindex 153ab87..705c3f3 100644\n--- a/lib/hash/version.map\n+++ b/lib/hash/version.map\n@@ -49,5 +49,6 @@ EXPERIMENTAL {\n \n \t#added in 21.11\n \trte_thash_complete_matrix;\n+\trte_thash_get_gfni_matrices;\n \trte_thash_gfni_supported;\n };\n",
    "prefixes": [
        "v6",
        "3/4"
    ]
}