get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 123634,
    "url": "http://patches.dpdk.org/api/patches/123634/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230210010724.890413-10-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-10-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230210010724.890413-10-stephen@networkplumber.org",
    "date": "2023-02-10T01:07:17",
    "name": "[v3,09/16] lpm: replace RTE_LOGTYPE_LPM with dynamic types",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "bd9411af1a14a96c221f238736f9f86e111b8ba1",
    "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-10-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/123634/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/123634/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 A3E5A41C58;\n\tFri, 10 Feb 2023 02:08:54 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BDFC642D44;\n\tFri, 10 Feb 2023 02:08:17 +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 F145242D20\n for <dev@dpdk.org>; Fri, 10 Feb 2023 02:08:12 +0100 (CET)",
            "by mail-pj1-f51.google.com with SMTP id\n s89-20020a17090a2f6200b0023125ebb4b1so4034289pjd.3\n for <dev@dpdk.org>; Thu, 09 Feb 2023 17:08:12 -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.10\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 09 Feb 2023 17:08:11 -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=gSoCAtoXa3lVXPecot8lDND+Mic9r6lp8okfjNGezdU=;\n b=lJZxPkIdY+FA86b6DmElnpouD+C9vjIDbtgaRRFcaedNY+7E+wfUZNhOHmfCBvSieC\n Q67Oi/rGsHiqa6/p+jmb/GqbnQU6ZEwjvZY4zOGqgzhuvKcmzZoU3MXsbKewexSoncsm\n Re1kD54HGH/LsEmWCuPdMrUVkklokMwSghw4tKvKV4hf4T9QzZKnRvQCScMtLUo1R1kE\n Z5MzL5kS5vR5XrkDxophh5nBsq1nnUpTNhU5CoiKMYJkXNjJWa0f5AtgtzUi3TPwrxsF\n zqV1e0JBQsfKh9OWKwWIzSvUSBzMHslamujDVcAjYApdKTUsfup+3JqZo87O2IKfck2G\n ZEEw==",
        "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=gSoCAtoXa3lVXPecot8lDND+Mic9r6lp8okfjNGezdU=;\n b=dCuidmmtKpL7zE5tVpKKjwBww8FvWsnJylv+ObJENiGi+IaUW8zAUYv4fo4JuHSrSK\n pcbZFPq6n5l3rAdKCjE5dLnVlAa5Fv5wWZ9pN7RkiEyKFNG3P+jkqi/tpm5irSLb/0I6\n 1FjplNi2TUmiFrS/PCNrUfEtvAIpKdc5WUhfABJNr35CNQDT79oWXxTqSX6nHTOVeWSn\n dnWxF+TDbbYeEO/acPJVNr6cg1xsNUy82mByTPajBTLxxXB92ueDAk7Plb5+r06Q1rnc\n jwvkAtUGTw/GNUoCI4lbVoakYd7Nz5LRKiWKieUIfOLLXNntuUWFrW1eVGwrFrqmnv+d\n G0gg==",
        "X-Gm-Message-State": "AO0yUKWiC/DRWBuF4werIRuFiMqxLmQEV764/9Z0vyOkDbgcLuzf6z9R\n 8PAU0zazeP/ohZNB201iwbUB/YOVvlPxIfRSoBo=",
        "X-Google-Smtp-Source": "\n AK7set/luJ9O2ZB67d8sKyyU3ekaGqUQCPJAgpKBuIMX2rFxLDfMaSdehcA5Xpv25sWLrou1MDvRFw==",
        "X-Received": "by 2002:a17:903:1c1:b0:196:5ede:af8a with SMTP id\n e1-20020a17090301c100b001965edeaf8amr3716668plh.29.1675991291688;\n Thu, 09 Feb 2023 17:08:11 -0800 (PST)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Vladimir Medvedkin <vladimir.medvedkin@intel.com>,\n Bruce Richardson <bruce.richardson@intel.com>",
        "Subject": "[PATCH v3 09/16] lpm: replace RTE_LOGTYPE_LPM with dynamic types",
        "Date": "Thu,  9 Feb 2023 17:07:17 -0800",
        "Message-Id": "<20230210010724.890413-10-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": "Split lpm and lpm6 into separate log types since they\nare in different files and user may want to change log\nlevels for IPv4 vs IPv6.\n\nFor rib and fib libraries give them own types as well.\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/fib/fib_log.h               | 10 ++++++++++\n lib/fib/rte_fib.c               | 20 ++++++++++++--------\n lib/fib/rte_fib6.c              | 16 +++++++++-------\n lib/lpm/lpm_log.h               |  9 +++++++++\n lib/lpm/rte_lpm.c               | 15 +++++++++------\n lib/lpm/rte_lpm6.c              | 20 ++++++++++++--------\n lib/rib/rib_log.h               |  9 +++++++++\n lib/rib/rte_rib.c               | 12 +++++++-----\n lib/rib/rte_rib6.c              | 12 +++++++-----\n 11 files changed, 85 insertions(+), 41 deletions(-)\n create mode 100644 lib/fib/fib_log.h\n create mode 100644 lib/lpm/lpm_log.h\n create mode 100644 lib/rib/rib_log.h",
    "diff": "diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c\nindex 90d388192712..ff250b9a6d56 100644\n--- a/lib/eal/common/eal_common_log.c\n+++ b/lib/eal/common/eal_common_log.c\n@@ -351,7 +351,6 @@ 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_LPM,        \"lib.lpm\"},\n \t{RTE_LOGTYPE_KNI,        \"lib.kni\"},\n \t{RTE_LOGTYPE_METER,      \"lib.meter\"},\n \t{RTE_LOGTYPE_SCHED,      \"lib.sched\"},\ndiff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h\nindex f583352ec1ea..55067efb0a84 100644\n--- a/lib/eal/include/rte_log.h\n+++ b/lib/eal/include/rte_log.h\n@@ -33,7 +33,7 @@ extern \"C\" {\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-#define RTE_LOGTYPE_LPM        7 /**< Log related to LPM. */\n+\t\t\t\t /* was RTE_LOGTYPE_LPM */\n #define RTE_LOGTYPE_KNI        8 /**< Log related to KNI. */\n \t\t\t\t /* was RTE_LOGTYPE_ACL */\n \t\t\t\t /* was RTE_LOGTYPE_POWER */\ndiff --git a/lib/fib/fib_log.h b/lib/fib/fib_log.h\nnew file mode 100644\nindex 000000000000..bf2fa88c7451\n--- /dev/null\n+++ b/lib/fib/fib_log.h\n@@ -0,0 +1,10 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Vladimir Medvedkin <medvedkinv@gmail.com>\n+ * Copyright(c) 2019 Intel Corporation\n+ */\n+\n+extern int fib_logtype;\n+\n+#define FIB_LOG(level, fmt, args...)\t\t\t\\\n+\trte_log(RTE_LOG_ ## level, fib_logtype,\t\t\\\n+\t\t\"%s(): \" fmt \"\\n\", __func__, ##args)\ndiff --git a/lib/fib/rte_fib.c b/lib/fib/rte_fib.c\nindex 8af4c4091908..aa2ba735771a 100644\n--- a/lib/fib/rte_fib.c\n+++ b/lib/fib/rte_fib.c\n@@ -8,6 +8,7 @@\n \n #include <rte_eal_memconfig.h>\n #include <rte_errno.h>\n+#include <rte_log.h>\n #include <rte_malloc.h>\n #include <rte_string_fns.h>\n #include <rte_tailq.h>\n@@ -15,8 +16,11 @@\n #include <rte_rib.h>\n #include <rte_fib.h>\n \n+#include \"fib_log.h\"\n #include \"dir24_8.h\"\n \n+RTE_LOG_REGISTER_DEFAULT(fib_logtype, INFO);\n+\n TAILQ_HEAD(rte_fib_list, rte_tailq_entry);\n static struct rte_tailq_elem rte_fib_tailq = {\n \t.name = \"RTE_FIB\",\n@@ -167,8 +171,8 @@ rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf)\n \n \trib = rte_rib_create(name, socket_id, &rib_conf);\n \tif (rib == NULL) {\n-\t\tRTE_LOG(ERR, LPM,\n-\t\t\t\"Can not allocate RIB %s\\n\", name);\n+\t\tFIB_LOG(ERR,\n+\t\t\t\"Can not allocate RIB %s\", name);\n \t\treturn NULL;\n \t}\n \n@@ -192,8 +196,8 @@ rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf)\n \t/* allocate tailq entry */\n \tte = rte_zmalloc(\"FIB_TAILQ_ENTRY\", sizeof(*te), 0);\n \tif (te == NULL) {\n-\t\tRTE_LOG(ERR, LPM,\n-\t\t\t\"Can not allocate tailq entry for FIB %s\\n\", name);\n+\t\tFIB_LOG(ERR,\n+\t\t\t\"Can not allocate tailq entry for FIB %s\", name);\n \t\trte_errno = ENOMEM;\n \t\tgoto exit;\n \t}\n@@ -202,7 +206,7 @@ rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf)\n \tfib = rte_zmalloc_socket(mem_name,\n \t\tsizeof(struct rte_fib),\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (fib == NULL) {\n-\t\tRTE_LOG(ERR, LPM, \"FIB %s memory allocation failed\\n\", name);\n+\t\tFIB_LOG(ERR, \"FIB %s memory allocation failed\", name);\n \t\trte_errno = ENOMEM;\n \t\tgoto free_te;\n \t}\n@@ -213,9 +217,9 @@ rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf)\n \tfib->def_nh = conf->default_nh;\n \tret = init_dataplane(fib, socket_id, conf);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, LPM,\n-\t\t\t\"FIB dataplane struct %s memory allocation failed \"\n-\t\t\t\"with err %d\\n\", name, ret);\n+\t\tFIB_LOG(ERR,\n+\t\t\t\"FIB dataplane struct %s memory allocation failed with err %d\",\n+\t\t\tname, ret);\n \t\trte_errno = -ret;\n \t\tgoto free_fib;\n \t}\ndiff --git a/lib/fib/rte_fib6.c b/lib/fib/rte_fib6.c\nindex 4b8e22b142b9..4ce641f9dcd8 100644\n--- a/lib/fib/rte_fib6.c\n+++ b/lib/fib/rte_fib6.c\n@@ -9,12 +9,14 @@\n #include <rte_eal_memconfig.h>\n #include <rte_tailq.h>\n #include <rte_errno.h>\n+#include <rte_log.h>\n #include <rte_malloc.h>\n #include <rte_string_fns.h>\n \n #include <rte_rib6.h>\n #include <rte_fib6.h>\n \n+#include \"fib_log.h\"\n #include \"trie.h\"\n \n TAILQ_HEAD(rte_fib6_list, rte_tailq_entry);\n@@ -168,8 +170,8 @@ rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf)\n \n \trib = rte_rib6_create(name, socket_id, &rib_conf);\n \tif (rib == NULL) {\n-\t\tRTE_LOG(ERR, LPM,\n-\t\t\t\"Can not allocate RIB %s\\n\", name);\n+\t\tFIB_LOG(ERR,\n+\t\t\t\"Can not allocate RIB %s\", name);\n \t\treturn NULL;\n \t}\n \n@@ -193,8 +195,8 @@ rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf)\n \t/* allocate tailq entry */\n \tte = rte_zmalloc(\"FIB_TAILQ_ENTRY\", sizeof(*te), 0);\n \tif (te == NULL) {\n-\t\tRTE_LOG(ERR, LPM,\n-\t\t\t\"Can not allocate tailq entry for FIB %s\\n\", name);\n+\t\tFIB_LOG(ERR,\n+\t\t\t\"Can not allocate tailq entry for FIB %s\", name);\n \t\trte_errno = ENOMEM;\n \t\tgoto exit;\n \t}\n@@ -203,7 +205,7 @@ rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf)\n \tfib = rte_zmalloc_socket(mem_name,\n \t\tsizeof(struct rte_fib6), RTE_CACHE_LINE_SIZE, socket_id);\n \tif (fib == NULL) {\n-\t\tRTE_LOG(ERR, LPM, \"FIB %s memory allocation failed\\n\", name);\n+\t\tFIB_LOG(ERR, \"FIB %s memory allocation failed\", name);\n \t\trte_errno = ENOMEM;\n \t\tgoto free_te;\n \t}\n@@ -214,8 +216,8 @@ rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf)\n \tfib->def_nh = conf->default_nh;\n \tret = init_dataplane(fib, socket_id, conf);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, LPM,\n-\t\t\t\"FIB dataplane struct %s memory allocation failed\\n\",\n+\t\tFIB_LOG(ERR,\n+\t\t\t\"FIB dataplane struct %s memory allocation failed\",\n \t\t\tname);\n \t\trte_errno = -ret;\n \t\tgoto free_fib;\ndiff --git a/lib/lpm/lpm_log.h b/lib/lpm/lpm_log.h\nnew file mode 100644\nindex 000000000000..b4101cfbe238\n--- /dev/null\n+++ b/lib/lpm/lpm_log.h\n@@ -0,0 +1,9 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2010-2014 Intel Corporation\n+ * Copyright(c) 2020 Arm Limited\n+ */\n+\n+extern int lpm_logtype;\n+#define LPM_LOG(level, fmt, args...)\t\t\t\\\n+\trte_log(RTE_LOG_ ## level, lpm_logtype,\t\t\\\n+\t\t\"%s(): \" fmt \"\\n\", __func__, ## args)\ndiff --git a/lib/lpm/rte_lpm.c b/lib/lpm/rte_lpm.c\nindex cdcd1b7f9e47..363058e118c0 100644\n--- a/lib/lpm/rte_lpm.c\n+++ b/lib/lpm/rte_lpm.c\n@@ -18,6 +18,9 @@\n #include <rte_tailq.h>\n \n #include \"rte_lpm.h\"\n+#include \"lpm_log.h\"\n+\n+RTE_LOG_REGISTER_DEFAULT(lpm_logtype, INFO);\n \n TAILQ_HEAD(rte_lpm_list, rte_tailq_entry);\n \n@@ -189,7 +192,7 @@ rte_lpm_create(const char *name, int socket_id,\n \t/* allocate tailq entry */\n \tte = rte_zmalloc(\"LPM_TAILQ_ENTRY\", sizeof(*te), 0);\n \tif (te == NULL) {\n-\t\tRTE_LOG(ERR, LPM, \"Failed to allocate tailq entry\\n\");\n+\t\tLPM_LOG(ERR, \"Failed to allocate tailq entry\");\n \t\trte_errno = ENOMEM;\n \t\tgoto exit;\n \t}\n@@ -198,7 +201,7 @@ rte_lpm_create(const char *name, int socket_id,\n \ti_lpm = rte_zmalloc_socket(mem_name, mem_size,\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (i_lpm == NULL) {\n-\t\tRTE_LOG(ERR, LPM, \"LPM memory allocation failed\\n\");\n+\t\tLPM_LOG(ERR, \"LPM memory allocation failed\");\n \t\trte_free(te);\n \t\trte_errno = ENOMEM;\n \t\tgoto exit;\n@@ -208,7 +211,7 @@ rte_lpm_create(const char *name, int socket_id,\n \t\t\t(size_t)rules_size, RTE_CACHE_LINE_SIZE, socket_id);\n \n \tif (i_lpm->rules_tbl == NULL) {\n-\t\tRTE_LOG(ERR, LPM, \"LPM rules_tbl memory allocation failed\\n\");\n+\t\tLPM_LOG(ERR, \"LPM rules_tbl memory allocation failed\");\n \t\trte_free(i_lpm);\n \t\ti_lpm = NULL;\n \t\trte_free(te);\n@@ -220,7 +223,7 @@ rte_lpm_create(const char *name, int socket_id,\n \t\t\t(size_t)tbl8s_size, RTE_CACHE_LINE_SIZE, socket_id);\n \n \tif (i_lpm->lpm.tbl8 == NULL) {\n-\t\tRTE_LOG(ERR, LPM, \"LPM tbl8 memory allocation failed\\n\");\n+\t\tLPM_LOG(ERR, \"LPM tbl8 memory allocation failed\");\n \t\trte_free(i_lpm->rules_tbl);\n \t\trte_free(i_lpm);\n \t\ti_lpm = NULL;\n@@ -335,7 +338,7 @@ rte_lpm_rcu_qsbr_add(struct rte_lpm *lpm, struct rte_lpm_rcu_config *cfg)\n \t\tparams.v = cfg->v;\n \t\ti_lpm->dq = rte_rcu_qsbr_dq_create(&params);\n \t\tif (i_lpm->dq == NULL) {\n-\t\t\tRTE_LOG(ERR, LPM, \"LPM defer queue creation failed\\n\");\n+\t\t\tLPM_LOG(ERR, \"LPM defer queue creation failed\");\n \t\t\treturn 1;\n \t\t}\n \t} else {\n@@ -562,7 +565,7 @@ tbl8_free(struct __rte_lpm *i_lpm, uint32_t tbl8_group_start)\n \t\tstatus = rte_rcu_qsbr_dq_enqueue(i_lpm->dq,\n \t\t\t\t(void *)&tbl8_group_start);\n \t\tif (status == 1) {\n-\t\t\tRTE_LOG(ERR, LPM, \"Failed to push QSBR FIFO\\n\");\n+\t\t\tLPM_LOG(ERR, \"Failed to push QSBR FIFO\");\n \t\t\treturn -rte_errno;\n \t\t}\n \t}\ndiff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c\nindex 8d21aeddb83c..6c36a637322e 100644\n--- a/lib/lpm/rte_lpm6.c\n+++ b/lib/lpm/rte_lpm6.c\n@@ -20,6 +20,7 @@\n #include <rte_tailq.h>\n \n #include \"rte_lpm6.h\"\n+#include \"lpm_log.h\"\n \n #define RTE_LPM6_TBL24_NUM_ENTRIES        (1 << 24)\n #define RTE_LPM6_TBL8_GROUP_NUM_ENTRIES         256\n@@ -279,8 +280,9 @@ rte_lpm6_create(const char *name, int socket_id,\n \n \trules_tbl = rte_hash_create(&rule_hash_tbl_params);\n \tif (rules_tbl == NULL) {\n-\t\tRTE_LOG(ERR, LPM, \"LPM rules hash table allocation failed: %s (%d)\",\n-\t\t\t\t  rte_strerror(rte_errno), rte_errno);\n+\t\tLPM_LOG(ERR,\n+\t\t\t\"LPM rules hash table allocation failed: %s (%d)\",\n+\t\t\trte_strerror(rte_errno), rte_errno);\n \t\tgoto fail_wo_unlock;\n \t}\n \n@@ -289,8 +291,9 @@ rte_lpm6_create(const char *name, int socket_id,\n \t\t\tsizeof(uint32_t) * config->number_tbl8s,\n \t\t\tRTE_CACHE_LINE_SIZE);\n \tif (tbl8_pool == NULL) {\n-\t\tRTE_LOG(ERR, LPM, \"LPM tbl8 pool allocation failed: %s (%d)\",\n-\t\t\t\t  rte_strerror(rte_errno), rte_errno);\n+\t\tLPM_LOG(ERR,\n+\t\t\t\"LPM tbl8 pool allocation failed: %s (%d)\",\n+\t\t\trte_strerror(rte_errno), rte_errno);\n \t\trte_errno = ENOMEM;\n \t\tgoto fail_wo_unlock;\n \t}\n@@ -300,8 +303,9 @@ rte_lpm6_create(const char *name, int socket_id,\n \t\t\tsizeof(struct rte_lpm_tbl8_hdr) * config->number_tbl8s,\n \t\t\tRTE_CACHE_LINE_SIZE);\n \tif (tbl8_hdrs == NULL) {\n-\t\tRTE_LOG(ERR, LPM, \"LPM tbl8 headers allocation failed: %s (%d)\",\n-\t\t\t\t  rte_strerror(rte_errno), rte_errno);\n+\t\tLPM_LOG(ERR,\n+\t\t\t\"LPM tbl8 headers allocation failed: %s (%d)\",\n+\t\t\trte_strerror(rte_errno), rte_errno);\n \t\trte_errno = ENOMEM;\n \t\tgoto fail_wo_unlock;\n \t}\n@@ -329,7 +333,7 @@ rte_lpm6_create(const char *name, int socket_id,\n \t/* allocate tailq entry */\n \tte = rte_zmalloc(\"LPM6_TAILQ_ENTRY\", sizeof(*te), 0);\n \tif (te == NULL) {\n-\t\tRTE_LOG(ERR, LPM, \"Failed to allocate tailq entry!\\n\");\n+\t\tLPM_LOG(ERR, \"Failed to allocate tailq entry!\");\n \t\trte_errno = ENOMEM;\n \t\tgoto fail;\n \t}\n@@ -339,7 +343,7 @@ rte_lpm6_create(const char *name, int socket_id,\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \n \tif (lpm == NULL) {\n-\t\tRTE_LOG(ERR, LPM, \"LPM memory allocation failed\\n\");\n+\t\tLPM_LOG(ERR, \"LPM memory allocation failed\");\n \t\trte_free(te);\n \t\trte_errno = ENOMEM;\n \t\tgoto fail;\ndiff --git a/lib/rib/rib_log.h b/lib/rib/rib_log.h\nnew file mode 100644\nindex 000000000000..520f4083c0a8\n--- /dev/null\n+++ b/lib/rib/rib_log.h\n@@ -0,0 +1,9 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Vladimir Medvedkin <medvedkinv@gmail.com>\n+ * Copyright(c) 2019 Intel Corporation\n+ */\n+\n+extern int rib_logtype;\n+#define RIB_LOG(level, fmt, args...)\t\t\t\\\n+\trte_log(RTE_LOG_ ## level, rib_logtype,\t\t\\\n+\t\t\"%s(): \" fmt \"\\n\", __func__, ##args)\ndiff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c\nindex b0794edf66f5..c667e8cfe964 100644\n--- a/lib/rib/rte_rib.c\n+++ b/lib/rib/rte_rib.c\n@@ -15,6 +15,10 @@\n \n #include <rte_rib.h>\n \n+#include \"rib_log.h\"\n+\n+RTE_LOG_REGISTER_DEFAULT(rib_logtype, INFO);\n+\n TAILQ_HEAD(rte_rib_list, rte_tailq_entry);\n static struct rte_tailq_elem rte_rib_tailq = {\n \t.name = \"RTE_RIB\",\n@@ -412,8 +416,7 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf)\n \t\tNULL, NULL, NULL, NULL, socket_id, 0);\n \n \tif (node_pool == NULL) {\n-\t\tRTE_LOG(ERR, LPM,\n-\t\t\t\"Can not allocate mempool for RIB %s\\n\", name);\n+\t\tRIB_LOG(ERR, \"Can not allocate mempool for RIB %s\", name);\n \t\treturn NULL;\n \t}\n \n@@ -437,8 +440,7 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf)\n \t/* allocate tailq entry */\n \tte = rte_zmalloc(\"RIB_TAILQ_ENTRY\", sizeof(*te), 0);\n \tif (unlikely(te == NULL)) {\n-\t\tRTE_LOG(ERR, LPM,\n-\t\t\t\"Can not allocate tailq entry for RIB %s\\n\", name);\n+\t\tRIB_LOG(ERR, \"Can not allocate tailq entry for RIB %s\", name);\n \t\trte_errno = ENOMEM;\n \t\tgoto exit;\n \t}\n@@ -447,7 +449,7 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf)\n \trib = rte_zmalloc_socket(mem_name,\n \t\tsizeof(struct rte_rib),\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (unlikely(rib == NULL)) {\n-\t\tRTE_LOG(ERR, LPM, \"RIB %s memory allocation failed\\n\", name);\n+\t\tRIB_LOG(ERR, \"RIB %s memory allocation failed\", name);\n \t\trte_errno = ENOMEM;\n \t\tgoto free_te;\n \t}\ndiff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c\nindex 19e4ff97c479..4e171d4208d9 100644\n--- a/lib/rib/rte_rib6.c\n+++ b/lib/rib/rte_rib6.c\n@@ -8,6 +8,7 @@\n \n #include <rte_eal_memconfig.h>\n #include <rte_errno.h>\n+#include <rte_log.h>\n #include <rte_malloc.h>\n #include <rte_mempool.h>\n #include <rte_string_fns.h>\n@@ -15,6 +16,8 @@\n \n #include <rte_rib6.h>\n \n+#include \"rib_log.h\"\n+\n #define RTE_RIB_VALID_NODE\t1\n #define RIB6_MAXDEPTH\t\t128\n /* Maximum length of a RIB6 name. */\n@@ -481,8 +484,7 @@ rte_rib6_create(const char *name, int socket_id,\n \t\tNULL, NULL, NULL, NULL, socket_id, 0);\n \n \tif (node_pool == NULL) {\n-\t\tRTE_LOG(ERR, LPM,\n-\t\t\t\"Can not allocate mempool for RIB6 %s\\n\", name);\n+\t\tRIB_LOG(ERR, \"Can not allocate mempool for RIB6 %s\", name);\n \t\treturn NULL;\n \t}\n \n@@ -506,8 +508,8 @@ rte_rib6_create(const char *name, int socket_id,\n \t/* allocate tailq entry */\n \tte = rte_zmalloc(\"RIB6_TAILQ_ENTRY\", sizeof(*te), 0);\n \tif (unlikely(te == NULL)) {\n-\t\tRTE_LOG(ERR, LPM,\n-\t\t\t\"Can not allocate tailq entry for RIB6 %s\\n\", name);\n+\t\tRIB_LOG(ERR,\n+\t\t\t\"Can not allocate tailq entry for RIB6 %s\", name);\n \t\trte_errno = ENOMEM;\n \t\tgoto exit;\n \t}\n@@ -516,7 +518,7 @@ rte_rib6_create(const char *name, int socket_id,\n \trib = rte_zmalloc_socket(mem_name,\n \t\tsizeof(struct rte_rib6), RTE_CACHE_LINE_SIZE, socket_id);\n \tif (unlikely(rib == NULL)) {\n-\t\tRTE_LOG(ERR, LPM, \"RIB6 %s memory allocation failed\\n\", name);\n+\t\tRIB_LOG(ERR, \"RIB6 %s memory allocation failed\", name);\n \t\trte_errno = ENOMEM;\n \t\tgoto free_te;\n \t}\n",
    "prefixes": [
        "v3",
        "09/16"
    ]
}