get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 123398,
    "url": "http://patches.dpdk.org/api/patches/123398/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230207230438.1617331-13-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": "<20230207230438.1617331-13-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230207230438.1617331-13-stephen@networkplumber.org",
    "date": "2023-02-07T23:04:33",
    "name": "[RFC,v2,12/17] mempool: replace RTE_LOGTYPE_MEMPOOL with dynamic type",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ea0fd014e98486373f08673f974fca7bccde1251",
    "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/20230207230438.1617331-13-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 26874,
            "url": "http://patches.dpdk.org/api/series/26874/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26874",
            "date": "2023-02-07T23:04:21",
            "name": "static logtype removal",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/26874/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/123398/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/123398/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 ABDBF41C34;\n\tWed,  8 Feb 2023 00:06:31 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B757542D6D;\n\tWed,  8 Feb 2023 00:05:22 +0100 (CET)",
            "from mail-pj1-f51.google.com (mail-pj1-f51.google.com\n [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id D144A42D46\n for <dev@dpdk.org>; Wed,  8 Feb 2023 00:05:18 +0100 (CET)",
            "by mail-pj1-f51.google.com with SMTP id\n o16-20020a17090ad25000b00230759a8c06so369682pjw.2\n for <dev@dpdk.org>; Tue, 07 Feb 2023 15:05:18 -0800 (PST)",
            "from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])\n by smtp.gmail.com with ESMTPSA id\n gq17-20020a17090b105100b0020dc318a43esm71189pjb.25.2023.02.07.15.05.16\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 07 Feb 2023 15:05:17 -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=C/T7O65KQL1uw1reJ66M8VpF4ow9LLidnK25FdG2Lis=;\n b=OvZuTXFTQ4UOxDx8jj0Orh/bImhGZn7A7tgZ1rZIxzDWSkAuNc5NheVp1+2PJlJXtJ\n FlXe0SWqDcX3t1ij961yE+CxKIpUfJ2QxYFY0XW7j4FV3OsiFTQHGfI3Mu2nDqg5mnjX\n /eh0UVJywu7hcUJrc8pqVmsaYf/uK7Oo3R/gPyN9Ste/NFTvoutdXJ7VA1ti/+3Ve52M\n 7jvzpfoNYJ+En49TJeieQvtnc707L4mt7eP35/PAQ91e04Jls1X1GJ5l5G8cxd+1+zTF\n P7FGEzoWvD1+glNtiPQ2Z+BwCFQ5lUDW8IFFhz3pQ2w/sn7jDUMjN0qGgxTkf9hGP3d7\n bHeA==",
        "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=C/T7O65KQL1uw1reJ66M8VpF4ow9LLidnK25FdG2Lis=;\n b=4F0j/BGp+/Jri0FwGPsyTzCQlnk4vMNKAfQ2whd0tmCQ/IHgD8qj469fAo6rHoeLod\n VuY354GKoAksMK9/3++Nul0eKpYxOybte1w63M8kwcXl4x3elEOZmo6jBrR5Vv8kHzUv\n 28qMzECjGUIgkXG46YMqSwmv9IAJRQ8aEtHANHdGEPTy11naAj5FyFD0vEGI2DrLa14Q\n Z/vkiGxdxkdfXbMBiPqFhK+burbUwRE0pFYHgayJxMT+WwRTaJ6+MWj4stRTJbNiehm8\n M6du2CGbF/U5dh4lOllSAcrH1kpjU33QX+dvmrwuJz+SIutUleUuTfwEB8Ybj7L4G7F/\n FiBg==",
        "X-Gm-Message-State": "AO0yUKXRbUHgKfl4XC8w6/aNeuoWAfhvqohQR0ZWW6PLQ7ry8/AQi2xM\n sfCewH0w6I984AXZXr1YeeIabUvdkdT7hNHpxQk=",
        "X-Google-Smtp-Source": "\n AK7set9tU1o6XZk1+0lE+ik8uGln6B/8tzA52RZMwzHQCRSfGDR6moJMfnYpTUhn81OaAr/DKflzMw==",
        "X-Received": "by 2002:a17:90a:1a52:b0:22c:1b3:b72b with SMTP id\n 18-20020a17090a1a5200b0022c01b3b72bmr6281046pjl.14.1675811117813;\n Tue, 07 Feb 2023 15:05:17 -0800 (PST)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Olivier Matz <olivier.matz@6wind.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>",
        "Subject": "[RFC v2 12/17] mempool: replace RTE_LOGTYPE_MEMPOOL with dynamic type",
        "Date": "Tue,  7 Feb 2023 15:04:33 -0800",
        "Message-Id": "<20230207230438.1617331-13-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.39.1",
        "In-Reply-To": "<20230207230438.1617331-1-stephen@networkplumber.org>",
        "References": "<20230207204151.1503491-1-stephen@networkplumber.org>\n <20230207230438.1617331-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": "Convert from RTE_LOGTYPE_MEMPOOL to logtype_mempool.\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/mempool/rte_mempool.c       | 33 ++++++++++++++++++---------------\n lib/mempool/rte_mempool_log.h   | 10 ++++++++++\n lib/mempool/rte_mempool_ops.c   | 12 ++++++------\n 5 files changed, 35 insertions(+), 23 deletions(-)\n create mode 100644 lib/mempool/rte_mempool_log.h",
    "diff": "diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c\nindex 04c9d43351da..90d388192712 100644\n--- a/lib/eal/common/eal_common_log.c\n+++ b/lib/eal/common/eal_common_log.c\n@@ -349,7 +349,6 @@ struct logtype {\n \n static const struct logtype logtype_strings[] = {\n \t{RTE_LOGTYPE_EAL,        \"lib.eal\"},\n-\t{RTE_LOGTYPE_MEMPOOL,    \"lib.mempool\"},\n \t{RTE_LOGTYPE_PMD,        \"pmd\"},\n \t{RTE_LOGTYPE_HASH,       \"lib.hash\"},\n \t{RTE_LOGTYPE_LPM,        \"lib.lpm\"},\ndiff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h\nindex a99fe383c89b..f583352ec1ea 100644\n--- a/lib/eal/include/rte_log.h\n+++ b/lib/eal/include/rte_log.h\n@@ -29,7 +29,7 @@ extern \"C\" {\n #define RTE_LOGTYPE_EAL        0 /**< Log related to eal. */\n \t\t\t\t /* was RTE_LOGTYPE_MALLOC */\n \t\t\t\t /* was RTE_LOGTYPE_RING */\n-#define RTE_LOGTYPE_MEMPOOL    3 /**< Log related to mempool. */\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. */\ndiff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c\nindex 45b5df6199b0..911a2b4dd850 100644\n--- a/lib/mempool/rte_mempool.c\n+++ b/lib/mempool/rte_mempool.c\n@@ -30,6 +30,7 @@\n \n #include \"rte_mempool.h\"\n #include \"rte_mempool_trace.h\"\n+#include \"rte_mempool_log.h\"\n \n TAILQ_HEAD(rte_mempool_list, rte_tailq_entry);\n \n@@ -774,7 +775,7 @@ rte_mempool_cache_create(uint32_t size, int socket_id)\n \tcache = rte_zmalloc_socket(\"MEMPOOL_CACHE\", sizeof(*cache),\n \t\t\t\t  RTE_CACHE_LINE_SIZE, socket_id);\n \tif (cache == NULL) {\n-\t\tRTE_LOG(ERR, MEMPOOL, \"Cannot allocate mempool cache.\\n\");\n+\t\tMEMPOOL_LOG(ERR, \"Cannot allocate mempool cache.\");\n \t\trte_errno = ENOMEM;\n \t\treturn NULL;\n \t}\n@@ -876,7 +877,7 @@ rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size,\n \t/* try to allocate tailq entry */\n \tte = rte_zmalloc(\"MEMPOOL_TAILQ_ENTRY\", sizeof(*te), 0);\n \tif (te == NULL) {\n-\t\tRTE_LOG(ERR, MEMPOOL, \"Cannot allocate tailq entry!\\n\");\n+\t\tMEMPOOL_LOG(ERR, \"Cannot allocate tailq entry!\");\n \t\tgoto exit_unlock;\n \t}\n \n@@ -1088,25 +1089,25 @@ void rte_mempool_check_cookies(const struct rte_mempool *mp,\n \n \t\tif (free == 0) {\n \t\t\tif (cookie != RTE_MEMPOOL_HEADER_COOKIE1) {\n-\t\t\t\tRTE_LOG(CRIT, MEMPOOL,\n-\t\t\t\t\t\"obj=%p, mempool=%p, cookie=%\" PRIx64 \"\\n\",\n-\t\t\t\t\tobj, (const void *) mp, cookie);\n+\t\t\t\tMEMPOOL_LOG(CRIT,\n+\t\t\t\t\t    \"obj=%p, mempool=%p, cookie=%\" PRIx64,\n+\t\t\t\t\t    obj, (const void *) mp, cookie);\n \t\t\t\trte_panic(\"MEMPOOL: bad header cookie (put)\\n\");\n \t\t\t}\n \t\t\thdr->cookie = RTE_MEMPOOL_HEADER_COOKIE2;\n \t\t} else if (free == 1) {\n \t\t\tif (cookie != RTE_MEMPOOL_HEADER_COOKIE2) {\n-\t\t\t\tRTE_LOG(CRIT, MEMPOOL,\n-\t\t\t\t\t\"obj=%p, mempool=%p, cookie=%\" PRIx64 \"\\n\",\n-\t\t\t\t\tobj, (const void *) mp, cookie);\n+\t\t\t\tMEMPOOL_LOG(CRIT,\n+\t\t\t\t\t    \"obj=%p, mempool=%p, cookie=%\" PRIx64,\n+\t\t\t\t\t    obj, (const void *) mp, cookie);\n \t\t\t\trte_panic(\"MEMPOOL: bad header cookie (get)\\n\");\n \t\t\t}\n \t\t\thdr->cookie = RTE_MEMPOOL_HEADER_COOKIE1;\n \t\t} else if (free == 2) {\n \t\t\tif (cookie != RTE_MEMPOOL_HEADER_COOKIE1 &&\n \t\t\t    cookie != RTE_MEMPOOL_HEADER_COOKIE2) {\n-\t\t\t\tRTE_LOG(CRIT, MEMPOOL,\n-\t\t\t\t\t\"obj=%p, mempool=%p, cookie=%\" PRIx64 \"\\n\",\n+\t\t\t\tMEMPOOL_LOG(CRIT,\n+\t\t\t\t\t\"obj=%p, mempool=%p, cookie=%\" PRIx64,\n \t\t\t\t\tobj, (const void *) mp, cookie);\n \t\t\t\trte_panic(\"MEMPOOL: bad header cookie (audit)\\n\");\n \t\t\t}\n@@ -1114,9 +1115,9 @@ void rte_mempool_check_cookies(const struct rte_mempool *mp,\n \t\ttlr = rte_mempool_get_trailer(obj);\n \t\tcookie = tlr->cookie;\n \t\tif (cookie != RTE_MEMPOOL_TRAILER_COOKIE) {\n-\t\t\tRTE_LOG(CRIT, MEMPOOL,\n-\t\t\t\t\"obj=%p, mempool=%p, cookie=%\" PRIx64 \"\\n\",\n-\t\t\t\tobj, (const void *) mp, cookie);\n+\t\t\tMEPOOL_LOG(CRIT,\n+\t\t\t\t   \"obj=%p, mempool=%p, cookie=%\" PRIx64,\n+\t\t\t\t   obj, (const void *) mp, cookie);\n \t\t\trte_panic(\"MEMPOOL: bad trailer cookie\\n\");\n \t\t}\n \t}\n@@ -1200,7 +1201,7 @@ mempool_audit_cache(const struct rte_mempool *mp)\n \t\tconst struct rte_mempool_cache *cache;\n \t\tcache = &mp->local_cache[lcore_id];\n \t\tif (cache->len > RTE_DIM(cache->objs)) {\n-\t\t\tRTE_LOG(CRIT, MEMPOOL, \"badness on cache[%u]\\n\",\n+\t\t\tMEMPOOL_LOG(CRIT, \"badness on cache[%u]\",\n \t\t\t\tlcore_id);\n \t\t\trte_panic(\"MEMPOOL: invalid cache len\\n\");\n \t\t}\n@@ -1429,7 +1430,7 @@ rte_mempool_event_callback_register(rte_mempool_event_callback *func,\n \n \tcb = calloc(1, sizeof(*cb));\n \tif (cb == NULL) {\n-\t\tRTE_LOG(ERR, MEMPOOL, \"Cannot allocate event callback!\\n\");\n+\t\tMEMPOOL_LOG(ERR, \"Cannot allocate event callback!\");\n \t\tret = -ENOMEM;\n \t\tgoto exit;\n \t}\n@@ -1563,3 +1564,5 @@ RTE_INIT(mempool_init_telemetry)\n \trte_telemetry_register_cmd(\"/mempool/info\", mempool_handle_info,\n \t\t\"Returns mempool info. Parameters: pool_name\");\n }\n+\n+RTE_LOG_REGISTER_DEFAULT(mempool_logtype, INFO);\ndiff --git a/lib/mempool/rte_mempool_log.h b/lib/mempool/rte_mempool_log.h\nnew file mode 100644\nindex 000000000000..3d252f761408\n--- /dev/null\n+++ b/lib/mempool/rte_mempool_log.h\n@@ -0,0 +1,10 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2010-2014 Intel Corporation.\n+ * Copyright 2014 6WIND S.A.\n+ */\n+\n+extern int mempool_logtype;\n+\n+#define MEMPOOL_LOG(level, fmt, args...)\t\t\\\n+\trte_log(RTE_LOG_ ## level, mempool_logtype,\t\\\n+\t\t\"%s(): \" fmt \"\\n\", __func__, ##args)\ndiff --git a/lib/mempool/rte_mempool_ops.c b/lib/mempool/rte_mempool_ops.c\nindex 3b43edc548a0..e04e75b91ba6 100644\n--- a/lib/mempool/rte_mempool_ops.c\n+++ b/lib/mempool/rte_mempool_ops.c\n@@ -12,6 +12,7 @@\n #include <dev_driver.h>\n \n #include \"rte_mempool_trace.h\"\n+#include \"rte_mempool_log.h\"\n \n /* indirect jump table to support external memory pools. */\n struct rte_mempool_ops_table rte_mempool_ops_table = {\n@@ -31,23 +32,22 @@ rte_mempool_register_ops(const struct rte_mempool_ops *h)\n \tif (rte_mempool_ops_table.num_ops >=\n \t\t\tRTE_MEMPOOL_MAX_OPS_IDX) {\n \t\trte_spinlock_unlock(&rte_mempool_ops_table.sl);\n-\t\tRTE_LOG(ERR, MEMPOOL,\n-\t\t\t\"Maximum number of mempool ops structs exceeded\\n\");\n+\t\tMEMPOOL_LOG(ERR,\n+\t\t\t\"Maximum number of mempool ops structs exceeded\");\n \t\treturn -ENOSPC;\n \t}\n \n \tif (h->alloc == NULL || h->enqueue == NULL ||\n \t\t\th->dequeue == NULL || h->get_count == NULL) {\n \t\trte_spinlock_unlock(&rte_mempool_ops_table.sl);\n-\t\tRTE_LOG(ERR, MEMPOOL,\n-\t\t\t\"Missing callback while registering mempool ops\\n\");\n+\t\tMEMPOOL_LOG(ERR,\n+\t\t\t    \"Missing callback while registering mempool ops\");\n \t\treturn -EINVAL;\n \t}\n \n \tif (strlen(h->name) >= sizeof(ops->name) - 1) {\n \t\trte_spinlock_unlock(&rte_mempool_ops_table.sl);\n-\t\tRTE_LOG(DEBUG, EAL, \"%s(): mempool_ops <%s>: name too long\\n\",\n-\t\t\t\t__func__, h->name);\n+\t\tMEMPOOL_LOG(DEBUG, \"mempool_ops <%s>: name too long\\n\", h->name);\n \t\trte_errno = EEXIST;\n \t\treturn -EEXIST;\n \t}\n",
    "prefixes": [
        "RFC",
        "v2",
        "12/17"
    ]
}