get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 123636,
    "url": "http://patches.dpdk.org/api/patches/123636/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230210010724.890413-12-stephen@networkplumber.org/",
    "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": "<20230210010724.890413-12-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230210010724.890413-12-stephen@networkplumber.org",
    "date": "2023-02-10T01:07:19",
    "name": "[v3,11/16] hash: replace RTE_LOGTYPE_HASH with dynamic type",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9d2ca5fb3f0211e31685b4d9346ed5d9836ba1da",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230210010724.890413-12-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 26935,
            "url": "http://patches.dpdk.org/api/series/26935/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26935",
            "date": "2023-02-10T01:07:08",
            "name": "Replace use of static logtypes",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/26935/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/123636/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/123636/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 3691241C58;\n\tFri, 10 Feb 2023 02:09:12 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 060F642D61;\n\tFri, 10 Feb 2023 02:08:21 +0100 (CET)",
            "from mail-pj1-f49.google.com (mail-pj1-f49.google.com\n [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id 7A13642D20\n for <dev@dpdk.org>; Fri, 10 Feb 2023 02:08:15 +0100 (CET)",
            "by mail-pj1-f49.google.com with SMTP id pj3so3756004pjb.1\n for <dev@dpdk.org>; Thu, 09 Feb 2023 17:08:15 -0800 (PST)",
            "from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])\n by smtp.gmail.com with ESMTPSA id\n jd9-20020a170903260900b0019625428cefsm2103023plb.281.2023.02.09.17.08.13\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 09 Feb 2023 17:08:13 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20210112.gappssmtp.com; s=20210112;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=AQAJJTqjTskC+oEt/E/VEGrTfvC38UgFYNoSiBgmG8Y=;\n b=EFBay0K8hOh2iTpj+9+6pDWf/C8poua1hQ8iqgJIvCuFn3zl+qY6G86CZB5M6Y1pYA\n xsrHrptq2MZ336tFOQkPDgAhtvG4MtJsz/lsypZWE250iKEGDmGus9CCysfRvOiDb+bQ\n y3D49pewC89+V/izOScMmfcqZXVT5PE1zSV0FkZVtY71901qwSrJeY6PFGacTd+wdcFY\n 4BcMVbfNcCuY/EotIDsRN7DU7nOdGRSZELoRBD/wexIZbz3KXzKV7s5WyVlCQoIPSgS8\n yRwtMU33E39buBd2l4ir8OEzuH3GFO+3MnCGQujAwMmPKzEKeX9Fpu1qORhdkfQDG9Sw\n eE7w==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=AQAJJTqjTskC+oEt/E/VEGrTfvC38UgFYNoSiBgmG8Y=;\n b=ne6kgEAOuS1hqiQAcT8qqjx63gm53tgZurLBjB4EOvCf1hUACpQfg5PteA3IS+Dk8o\n zn3QKCQPMMVuCNR8XShW1mDJYnjgDVj7+oERqbfA6F0tjqbFgUseatzITGPUvVp3nVzW\n cSEVibdsl0XbUSmV3nTG9KfcWNCDp6DU21FIHb/xq/wk6rR22xeODAzXu555sc7YqNLp\n R8dAlvwpviLPVaKo469aadShK4p4ud0Ac7jTyzebAMFgEull3SFcV8ES9cJ2ay1C3rgC\n xqYOcMS5IZyM7ipOsN8qgvETcyDTsvkMGVNJX3gsoKwI9T6ABIe497UazmDaAucf54Ix\n iAlw==",
        "X-Gm-Message-State": "AO0yUKU3ZtNFFxTTcxfMQ2sRhISvhBT5JAhRLslGaNXDYdDs/hklNjAY\n FSxw/qnxfiHCp82AgcO4RkJP5MHa6guhGv4JBOs=",
        "X-Google-Smtp-Source": "\n AK7set9DLjYs1FDQvUe9c2hBksmwlmFqOse8nseaRg+MCSrF/MwqIT2AyZreg0gyhl6wB1DjcjTNuw==",
        "X-Received": "by 2002:a17:903:110e:b0:19a:7217:32a9 with SMTP id\n n14-20020a170903110e00b0019a721732a9mr369177plh.26.1675991294214;\n Thu, 09 Feb 2023 17:08:14 -0800 (PST)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Yipeng Wang <yipeng1.wang@intel.com>,\n Sameh Gobriel <sameh.gobriel@intel.com>,\n Bruce Richardson <bruce.richardson@intel.com>,\n Vladimir Medvedkin <vladimir.medvedkin@intel.com>",
        "Subject": "[PATCH v3 11/16] hash: replace RTE_LOGTYPE_HASH with dynamic type",
        "Date": "Thu,  9 Feb 2023 17:07:19 -0800",
        "Message-Id": "<20230210010724.890413-12-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.39.1",
        "In-Reply-To": "<20230210010724.890413-1-stephen@networkplumber.org>",
        "References": "<20230207204151.1503491-1-stephen@networkplumber.org>\n <20230210010724.890413-1-stephen@networkplumber.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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"
    },
    "content": "A little more complex here since the one hash library actually\nhas multiple routines in it.  Split up the logtypes for\nhash and toeplitz.\n\nThe hash crc file has another issue around logging.\nIt is calling RTE_LOG during a constructor which is maybe\nproblematic because this will all run before the DPDK library\nhas finished initializing logging.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n lib/eal/common/eal_common_log.c |  1 -\n lib/eal/include/rte_log.h       |  2 +-\n lib/hash/rte_cuckoo_hash.c      | 60 ++++++++++++++++++---------------\n lib/hash/rte_fbk_hash.c         | 10 ++++--\n lib/hash/rte_hash_crc.h         |  6 ++--\n lib/hash/rte_thash.c            | 53 ++++++++++++++++++++++-------\n lib/hash/rte_thash_gfni.h       | 24 ++++---------\n lib/hash/version.map            |  4 +++\n 8 files changed, 95 insertions(+), 65 deletions(-)",
    "diff": "diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c\nindex b0c625a02cdf..97120543d808 100644\n--- a/lib/eal/common/eal_common_log.c\n+++ b/lib/eal/common/eal_common_log.c\n@@ -350,7 +350,6 @@ struct logtype {\n static const struct logtype logtype_strings[] = {\n \t{RTE_LOGTYPE_EAL,        \"lib.eal\"},\n \t{RTE_LOGTYPE_PMD,        \"pmd\"},\n-\t{RTE_LOGTYPE_HASH,       \"lib.hash\"},\n \t{RTE_LOGTYPE_METER,      \"lib.meter\"},\n \t{RTE_LOGTYPE_SCHED,      \"lib.sched\"},\n \t{RTE_LOGTYPE_PORT,       \"lib.port\"},\ndiff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h\nindex 69d3d07252ec..afbd67d55b45 100644\n--- a/lib/eal/include/rte_log.h\n+++ b/lib/eal/include/rte_log.h\n@@ -32,7 +32,7 @@ extern \"C\" {\n \t\t\t\t /* was RTE_LOGTYPE_MEMPOOL */\n \t\t\t\t /* was RTE_LOGTYPE_TIMER */\n #define RTE_LOGTYPE_PMD        5 /**< Log related to poll mode driver. */\n-#define RTE_LOGTYPE_HASH       6 /**< Log related to hash table. */\n+\t\t\t\t /* was RTE_LOGTYPE_HASH */\n \t\t\t\t /* was RTE_LOGTYPE_LPM */\n \t\t\t\t /* was RTE_LOGTYPE_KNI */\n \t\t\t\t /* was RTE_LOGTYPE_ACL */\ndiff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c\nindex 829b79c89a27..a5ca21b74e2a 100644\n--- a/lib/hash/rte_cuckoo_hash.c\n+++ b/lib/hash/rte_cuckoo_hash.c\n@@ -26,6 +26,12 @@\n #include \"rte_hash.h\"\n #include \"rte_cuckoo_hash.h\"\n \n+RTE_LOG_REGISTER_SUFFIX(hash_logtype, cuckoo, INFO);\n+\n+#define HASH_LOG(level, fmt, args...)\t\t\t\\\n+\trte_log(RTE_LOG_ ## level, hash_logtype,\t\\\n+\t\t\"%s(): \" fmt \"\\n\", __func__, ##args)\n+\n /* Mask of all flags supported by this version */\n #define RTE_HASH_EXTRA_FLAGS_MASK (RTE_HASH_EXTRA_FLAGS_TRANS_MEM_SUPPORT | \\\n \t\t\t\t   RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD | \\\n@@ -159,7 +165,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \thash_list = RTE_TAILQ_CAST(rte_hash_tailq.head, rte_hash_list);\n \n \tif (params == NULL) {\n-\t\tRTE_LOG(ERR, HASH, \"rte_hash_create has no parameters\\n\");\n+\t\tHASH_LOG(ERR, \"null parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -168,13 +174,13 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \t\t\t(params->entries < RTE_HASH_BUCKET_ENTRIES) ||\n \t\t\t(params->key_len == 0)) {\n \t\trte_errno = EINVAL;\n-\t\tRTE_LOG(ERR, HASH, \"rte_hash_create has invalid parameters\\n\");\n+\t\tHASH_LOG(ERR, \"invalid parameters\");\n \t\treturn NULL;\n \t}\n \n \tif (params->extra_flag & ~RTE_HASH_EXTRA_FLAGS_MASK) {\n \t\trte_errno = EINVAL;\n-\t\tRTE_LOG(ERR, HASH, \"rte_hash_create: unsupported extra flags\\n\");\n+\t\tHASH_LOG(ERR, \"unsupported extra flags\");\n \t\treturn NULL;\n \t}\n \n@@ -182,8 +188,8 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \tif ((params->extra_flag & RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY) &&\n \t    (params->extra_flag & RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF)) {\n \t\trte_errno = EINVAL;\n-\t\tRTE_LOG(ERR, HASH, \"rte_hash_create: choose rw concurrency or \"\n-\t\t\t\"rw concurrency lock free\\n\");\n+\t\tHASH_LOG(ERR,\n+\t\t\t \"choose rw concurrency or rw concurrency lock free\");\n \t\treturn NULL;\n \t}\n \n@@ -233,7 +239,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \tr = rte_ring_create_elem(ring_name, sizeof(uint32_t),\n \t\t\trte_align32pow2(num_key_slots), params->socket_id, 0);\n \tif (r == NULL) {\n-\t\tRTE_LOG(ERR, HASH, \"memory allocation failed\\n\");\n+\t\tHASH_LOG(ERR, \"memory allocation failed\");\n \t\tgoto err;\n \t}\n \n@@ -249,8 +255,8 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \t\t\t\tparams->socket_id, 0);\n \n \t\tif (r_ext == NULL) {\n-\t\t\tRTE_LOG(ERR, HASH, \"ext buckets memory allocation \"\n-\t\t\t\t\t\t\t\t\"failed\\n\");\n+\t\t\tHASH_LOG(ERR,\n+\t\t\t\t \"ext buckets memory allocation failed\");\n \t\t\tgoto err;\n \t\t}\n \t}\n@@ -275,7 +281,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \n \tte = rte_zmalloc(\"HASH_TAILQ_ENTRY\", sizeof(*te), 0);\n \tif (te == NULL) {\n-\t\tRTE_LOG(ERR, HASH, \"tailq entry allocation failed\\n\");\n+\t\tHASH_LOG(ERR, \"tailq entry allocation failed\");\n \t\tgoto err_unlock;\n \t}\n \n@@ -283,7 +289,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \t\t\t\t\tRTE_CACHE_LINE_SIZE, params->socket_id);\n \n \tif (h == NULL) {\n-\t\tRTE_LOG(ERR, HASH, \"memory allocation failed\\n\");\n+\t\tHASH_LOG(ERR, \"memory allocation failed\");\n \t\tgoto err_unlock;\n \t}\n \n@@ -292,7 +298,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \t\t\t\tRTE_CACHE_LINE_SIZE, params->socket_id);\n \n \tif (buckets == NULL) {\n-\t\tRTE_LOG(ERR, HASH, \"buckets memory allocation failed\\n\");\n+\t\tHASH_LOG(ERR, \"buckets memory allocation failed\");\n \t\tgoto err_unlock;\n \t}\n \n@@ -302,8 +308,8 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \t\t\t\tnum_buckets * sizeof(struct rte_hash_bucket),\n \t\t\t\tRTE_CACHE_LINE_SIZE, params->socket_id);\n \t\tif (buckets_ext == NULL) {\n-\t\t\tRTE_LOG(ERR, HASH, \"ext buckets memory allocation \"\n-\t\t\t\t\t\t\t\"failed\\n\");\n+\t\t\tHASH_LOG(ERR,\n+\t\t\t\t \"ext buckets memory allocation failed\");\n \t\t\tgoto err_unlock;\n \t\t}\n \t\t/* Populate ext bkt ring. We reserve 0 similar to the\n@@ -318,8 +324,8 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \t\t\text_bkt_to_free = rte_zmalloc(NULL, sizeof(uint32_t) *\n \t\t\t\t\t\t\t\tnum_key_slots, 0);\n \t\t\tif (ext_bkt_to_free == NULL) {\n-\t\t\t\tRTE_LOG(ERR, HASH, \"ext bkt to free memory allocation \"\n-\t\t\t\t\t\t\t\t\"failed\\n\");\n+\t\t\t\tHASH_LOG(ERR,\n+\t\t\t\t\t \"ext bkt to free memory allocation failed\");\n \t\t\t\tgoto err_unlock;\n \t\t\t}\n \t\t}\n@@ -334,7 +340,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \t\t\tRTE_CACHE_LINE_SIZE, params->socket_id);\n \n \tif (k == NULL) {\n-\t\tRTE_LOG(ERR, HASH, \"memory allocation failed\\n\");\n+\t\tHASH_LOG(ERR, \"memory allocation failed\");\n \t\tgoto err_unlock;\n \t}\n \n@@ -342,7 +348,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \t\t\tRTE_CACHE_LINE_SIZE, params->socket_id);\n \n \tif (tbl_chng_cnt == NULL) {\n-\t\tRTE_LOG(ERR, HASH, \"memory allocation failed\\n\");\n+\t\tHASH_LOG(ERR, \"memory allocation failed\");\n \t\tgoto err_unlock;\n \t}\n \n@@ -390,7 +396,7 @@ rte_hash_create(const struct rte_hash_parameters *params)\n \t\t\t\tsizeof(struct lcore_cache) * RTE_MAX_LCORE,\n \t\t\t\tRTE_CACHE_LINE_SIZE, params->socket_id);\n \t\tif (local_free_slots == NULL) {\n-\t\t\tRTE_LOG(ERR, HASH, \"local free slots memory allocation failed\\n\");\n+\t\t\tHASH_LOG(ERR, \"local free slots memory allocation failed\");\n \t\t\tgoto err_unlock;\n \t\t}\n \t}\n@@ -624,7 +630,7 @@ rte_hash_reset(struct rte_hash *h)\n \t\t/* Reclaim all the resources */\n \t\trte_rcu_qsbr_dq_reclaim(h->dq, ~0, NULL, &pending, NULL);\n \t\tif (pending != 0)\n-\t\t\tRTE_LOG(ERR, HASH, \"RCU reclaim all resources failed\\n\");\n+\t\t\tHASH_LOG(ERR, \"RCU reclaim all resources failed\");\n \t}\n \n \tmemset(h->buckets, 0, h->num_buckets * sizeof(struct rte_hash_bucket));\n@@ -1498,9 +1504,8 @@ __hash_rcu_qsbr_free_resource(void *p, void *e, unsigned int n)\n \t/* Return key indexes to free slot ring */\n \tret = free_slot(h, rcu_dq_entry.key_idx);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, HASH,\n-\t\t\t\"%s: could not enqueue free slots in global ring\\n\",\n-\t\t\t\t__func__);\n+\t\tHASH_LOG(ERR,\n+\t\t\t \"could not enqueue free slots in global ring\");\n \t}\n }\n \n@@ -1527,7 +1532,7 @@ rte_hash_rcu_qsbr_add(struct rte_hash *h, struct rte_hash_rcu_config *cfg)\n \n \thash_rcu_cfg = rte_zmalloc(NULL, sizeof(struct rte_hash_rcu_config), 0);\n \tif (hash_rcu_cfg == NULL) {\n-\t\tRTE_LOG(ERR, HASH, \"memory allocation failed\\n\");\n+\t\tHASH_LOG(ERR, \"memory allocation failed\");\n \t\treturn 1;\n \t}\n \n@@ -1551,7 +1556,7 @@ rte_hash_rcu_qsbr_add(struct rte_hash *h, struct rte_hash_rcu_config *cfg)\n \t\th->dq = rte_rcu_qsbr_dq_create(&params);\n \t\tif (h->dq == NULL) {\n \t\t\trte_free(hash_rcu_cfg);\n-\t\t\tRTE_LOG(ERR, HASH, \"HASH defer queue creation failed\\n\");\n+\t\t\tHASH_LOG(ERR, \"HASH defer queue creation failed\");\n \t\t\treturn 1;\n \t\t}\n \t} else {\n@@ -1580,9 +1585,8 @@ remove_entry(const struct rte_hash *h, struct rte_hash_bucket *bkt,\n \tint ret = free_slot(h, bkt->key_idx[i]);\n \n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, HASH,\n-\t\t\t\"%s: could not enqueue free slots in global ring\\n\",\n-\t\t\t\t__func__);\n+\t\tHASH_LOG(ERR,\n+\t\t\t \"could not enqueue free slots in global ring\");\n \t}\n }\n \n@@ -1770,7 +1774,7 @@ __rte_hash_del_key_with_hash(const struct rte_hash *h, const void *key,\n \t\t} else if (h->dq)\n \t\t\t/* Push into QSBR FIFO if using RTE_HASH_QSBR_MODE_DQ */\n \t\t\tif (rte_rcu_qsbr_dq_enqueue(h->dq, &rcu_dq_entry) != 0)\n-\t\t\t\tRTE_LOG(ERR, HASH, \"Failed to push QSBR FIFO\\n\");\n+\t\t\t\tHASH_LOG(ERR, \"Failed to push QSBR FIFO\");\n \t}\n \t__hash_rw_writer_unlock(h);\n \treturn ret;\ndiff --git a/lib/hash/rte_fbk_hash.c b/lib/hash/rte_fbk_hash.c\nindex 538b23a4030a..37edb5e2c7fe 100644\n--- a/lib/hash/rte_fbk_hash.c\n+++ b/lib/hash/rte_fbk_hash.c\n@@ -18,6 +18,12 @@\n \n #include \"rte_fbk_hash.h\"\n \n+RTE_LOG_REGISTER_SUFFIX(fbk_hash_logtype, fbk, INFO);\n+\n+#define HASH_LOG(level, fmt, args...)\t\t\t\\\n+\trte_log(RTE_LOG_ ## level, fbk_hash_logtype,\t\\\n+\t\t\"%s(): \" fmt \"\\n\", __func__, ##args)\n+\n TAILQ_HEAD(rte_fbk_hash_list, rte_tailq_entry);\n \n static struct rte_tailq_elem rte_fbk_hash_tailq = {\n@@ -114,7 +120,7 @@ rte_fbk_hash_create(const struct rte_fbk_hash_params *params)\n \n \tte = rte_zmalloc(\"FBK_HASH_TAILQ_ENTRY\", sizeof(*te), 0);\n \tif (te == NULL) {\n-\t\tRTE_LOG(ERR, HASH, \"Failed to allocate tailq entry\\n\");\n+\t\tHASH_LOG(ERR, \"Failed to allocate tailq entry\");\n \t\tgoto exit;\n \t}\n \n@@ -122,7 +128,7 @@ rte_fbk_hash_create(const struct rte_fbk_hash_params *params)\n \tht = rte_zmalloc_socket(hash_name, mem_size,\n \t\t\t0, params->socket_id);\n \tif (ht == NULL) {\n-\t\tRTE_LOG(ERR, HASH, \"Failed to allocate fbk hash table\\n\");\n+\t\tHASH_LOG(ERR, \"Failed to allocate fbk hash table\");\n \t\trte_free(te);\n \t\tgoto exit;\n \t}\ndiff --git a/lib/hash/rte_hash_crc.h b/lib/hash/rte_hash_crc.h\nindex 0249ad16c5b6..3bb38880c4ea 100644\n--- a/lib/hash/rte_hash_crc.h\n+++ b/lib/hash/rte_hash_crc.h\n@@ -63,7 +63,7 @@ rte_hash_crc_set_alg(uint8_t alg)\n \n #if defined RTE_ARCH_X86\n \tif (!(alg & CRC32_SSE42_x64))\n-\t\tRTE_LOG(WARNING, HASH,\n+\t\tfprintf(stderr,\n \t\t\t\"Unsupported CRC32 algorithm requested using CRC32_x64/CRC32_SSE42\\n\");\n \tif (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T) || alg == CRC32_SSE42)\n \t\tcrc32_alg = CRC32_SSE42;\n@@ -73,14 +73,14 @@ rte_hash_crc_set_alg(uint8_t alg)\n \n #if defined RTE_ARCH_ARM64\n \tif (!(alg & CRC32_ARM64))\n-\t\tRTE_LOG(WARNING, HASH,\n+\t\tfprintf(stderr,\n \t\t\t\"Unsupported CRC32 algorithm requested using CRC32_ARM64\\n\");\n \tif (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32))\n \t\tcrc32_alg = CRC32_ARM64;\n #endif\n \n \tif (crc32_alg == CRC32_SW)\n-\t\tRTE_LOG(WARNING, HASH,\n+\t\tfprintf(stderr,\n \t\t\t\"Unsupported CRC32 algorithm requested using CRC32_SW\\n\");\n }\n \ndiff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c\nindex 0249883b8d07..fddc14e57588 100644\n--- a/lib/hash/rte_thash.c\n+++ b/lib/hash/rte_thash.c\n@@ -13,6 +13,12 @@\n #include <rte_log.h>\n #include <rte_malloc.h>\n \n+RTE_LOG_REGISTER_SUFFIX(rte_thash_logtype, thash, INFO);\n+\n+#define HASH_LOG(level, fmt, args...)\t\t\t\\\n+\trte_log(RTE_LOG_ ## level, rte_thash_logtype,\t\\\n+\t\t\"%s(): \" fmt \"\\n\", __func__, ##args)\n+\n #define THASH_NAME_LEN\t\t64\n #define TOEPLITZ_HASH_LEN\t32\n \n@@ -104,6 +110,28 @@ rte_thash_gfni_supported(void)\n \treturn 0;\n };\n \n+#ifndef RTE_THASH_GFNI_DEFINED\n+uint32_t\n+rte_thash_gfni(const uint64_t *mtrx __rte_unused,\n+\tconst uint8_t *key __rte_unused, int len __rte_unused)\n+{\n+\tHASH_LOG(ERR, \"is undefined under given arch\");\n+\treturn 0;\n+}\n+\n+void\n+rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused,\n+\tint len __rte_unused, uint8_t *tuple[] __rte_unused,\n+\tuint32_t val[], uint32_t num)\n+{\n+\tunsigned int i;\n+\n+\tHASH_LOG(ERR, \"is undefined under given arch\");\n+\tfor (i = 0; i < num; i++)\n+\t\tval[i] = 0;\n+}\n+#endif\n+\n void\n rte_thash_complete_matrix(uint64_t *matrixes, const uint8_t *rss_key, int size)\n {\n@@ -240,8 +268,8 @@ rte_thash_init_ctx(const char *name, uint32_t key_len, uint32_t reta_sz,\n \t/* allocate tailq entry */\n \tte = rte_zmalloc(\"THASH_TAILQ_ENTRY\", sizeof(*te), 0);\n \tif (te == NULL) {\n-\t\tRTE_LOG(ERR, HASH,\n-\t\t\t\"Can not allocate tailq entry for thash context %s\\n\",\n+\t\tHASH_LOG(ERR,\n+\t\t\t\"Can not allocate tailq entry for thash context %s\",\n \t\t\tname);\n \t\trte_errno = ENOMEM;\n \t\tgoto exit;\n@@ -249,7 +277,8 @@ rte_thash_init_ctx(const char *name, uint32_t key_len, uint32_t reta_sz,\n \n \tctx = rte_zmalloc(NULL, sizeof(struct rte_thash_ctx) + key_len, 0);\n \tif (ctx == NULL) {\n-\t\tRTE_LOG(ERR, HASH, \"thash ctx %s memory allocation failed\\n\",\n+\t\tHASH_LOG(ERR,\n+\t\t\t \"thash ctx %s memory allocation failed\",\n \t\t\tname);\n \t\trte_errno = ENOMEM;\n \t\tgoto free_te;\n@@ -272,7 +301,7 @@ rte_thash_init_ctx(const char *name, uint32_t key_len, uint32_t reta_sz,\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\tHASH_LOG(ERR, \"Cannot allocate matrices\");\n \t\t\trte_errno = ENOMEM;\n \t\t\tgoto free_ctx;\n \t\t}\n@@ -387,8 +416,8 @@ generate_subkey(struct rte_thash_ctx *ctx, struct thash_lfsr *lfsr,\n \tif (((lfsr->bits_cnt + req_bits) > (1ULL << lfsr->deg) - 1) &&\n \t\t\t((ctx->flags & RTE_THASH_IGNORE_PERIOD_OVERFLOW) !=\n \t\t\tRTE_THASH_IGNORE_PERIOD_OVERFLOW)) {\n-\t\tRTE_LOG(ERR, HASH,\n-\t\t\t\"Can't generate m-sequence due to period overflow\\n\");\n+\t\tHASH_LOG(ERR,\n+\t\t\t\"Can't generate m-sequence due to period overflow\");\n \t\treturn -ENOSPC;\n \t}\n \n@@ -467,9 +496,9 @@ insert_before(struct rte_thash_ctx *ctx,\n \t\t\treturn ret;\n \t\t}\n \t} else if ((next_ent != NULL) && (end > next_ent->offset)) {\n-\t\tRTE_LOG(ERR, HASH,\n-\t\t\t\"Can't add helper %s due to conflict with existing\"\n-\t\t\t\" helper %s\\n\", ent->name, next_ent->name);\n+\t\tHASH_LOG(ERR,\n+\t\t\t\"Can't add helper %s due to conflict with existing helper %s\",\n+\t\t\t ent->name, next_ent->name);\n \t\trte_free(ent);\n \t\treturn -ENOSPC;\n \t}\n@@ -516,9 +545,9 @@ insert_after(struct rte_thash_ctx *ctx,\n \tint ret;\n \n \tif ((next_ent != NULL) && (end > next_ent->offset)) {\n-\t\tRTE_LOG(ERR, HASH,\n-\t\t\t\"Can't add helper %s due to conflict with existing\"\n-\t\t\t\" helper %s\\n\", ent->name, next_ent->name);\n+\t\tHASH_LOG(ERR,\n+\t\t\t \"Can't add helper %s due to conflict with existing helper %s\",\n+\t\t\t ent->name, next_ent->name);\n \t\trte_free(ent);\n \t\treturn -EEXIST;\n \t}\ndiff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h\nindex ef90faa302d1..c3a5cf7e7b2d 100644\n--- a/lib/hash/rte_thash_gfni.h\n+++ b/lib/hash/rte_thash_gfni.h\n@@ -38,13 +38,8 @@ extern \"C\" {\n  *  Calculated Toeplitz hash value.\n  */\n __rte_experimental\n-static inline uint32_t\n-rte_thash_gfni(const uint64_t *mtrx __rte_unused,\n-\tconst uint8_t *key __rte_unused, int len __rte_unused)\n-{\n-\tRTE_LOG(ERR, HASH, \"%s is undefined under given arch\\n\", __func__);\n-\treturn 0;\n-}\n+uint32_t\n+rte_thash_gfni(const uint64_t *mtrx, const uint8_t *key, int len);\n \n /**\n  * Bulk implementation for Toeplitz hash.\n@@ -67,17 +62,10 @@ rte_thash_gfni(const uint64_t *mtrx __rte_unused,\n  *  Number of tuples to hash.\n  */\n __rte_experimental\n-static inline void\n-rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused,\n-\tint len __rte_unused, uint8_t *tuple[] __rte_unused,\n-\tuint32_t val[], uint32_t num)\n-{\n-\tunsigned int i;\n-\n-\tRTE_LOG(ERR, HASH, \"%s is undefined under given arch\\n\", __func__);\n-\tfor (i = 0; i < num; i++)\n-\t\tval[i] = 0;\n-}\n+void\n+rte_thash_gfni_bulk(const uint64_t *mtrx,\n+\t\t    int len, uint8_t *tuple[],\n+\t\t    uint32_t val[], uint32_t num);\n \n #endif /* RTE_THASH_GFNI_DEFINED */\n \ndiff --git a/lib/hash/version.map b/lib/hash/version.map\nindex bdcebd19c29b..c30ac81307a7 100644\n--- a/lib/hash/version.map\n+++ b/lib/hash/version.map\n@@ -51,4 +51,8 @@ EXPERIMENTAL {\n \trte_thash_complete_matrix;\n \trte_thash_get_gfni_matrices;\n \trte_thash_gfni_supported;\n+\n+\t# added in 23.07\n+\trte_thash_gfni;\n+\trte_thash_gfni_bulk;\n };\n",
    "prefixes": [
        "v3",
        "11/16"
    ]
}