get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 123403,
    "url": "http://patches.dpdk.org/api/patches/123403/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230207230438.1617331-18-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-18-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230207230438.1617331-18-stephen@networkplumber.org",
    "date": "2023-02-07T23:04:38",
    "name": "[RFC,v2,17/17] port: replace RTE_LOGTYPE_PORT with dynamic type",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9743b79b03f858a4dab72e3df4641e511493754e",
    "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-18-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/123403/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/123403/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 5C1AB41C34;\n\tWed,  8 Feb 2023 00:07:16 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4D80442DBF;\n\tWed,  8 Feb 2023 00:05:30 +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 A7482410D1\n for <dev@dpdk.org>; Wed,  8 Feb 2023 00:05:24 +0100 (CET)",
            "by mail-pj1-f51.google.com with SMTP id d2so12909719pjd.5\n for <dev@dpdk.org>; Tue, 07 Feb 2023 15:05:24 -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.22\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 07 Feb 2023 15:05:22 -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=/ig+6NW0tgcHV4HF37zqYNbmsNWy3JWoDvNbexM9/w8=;\n b=4FsH03HU7DsVatnlFn7vdzW6SAbQtPR3GntKjue1KI/pCAM0ZZzi29jEKI4nmJEsxk\n 1kiZpdGuwqyIP6cCL56yOmucaoP58w3JoTteH2F5tw4+3kQXWWxILLAkXAjZMo4JIo1y\n ZYwQIbvz6rabmngZU+7bmbUcTqSblc7p+hq6UPI0DfHKgYhjtM+Tq6PhQiz/q+nxzWos\n xzsjy42K0ufCxXC5qEbjUpuO4lenv8hObAK+P0vDpOvwOo+jCmnJpCaP9lV7ES1lDPUG\n UaN1VU0J2xtFeKj4RzcDIVbNLC3KzKT/PlBiK4JZMcG5zOeW4Bcgj95hxD7q7T6+tD5w\n dtoA==",
        "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=/ig+6NW0tgcHV4HF37zqYNbmsNWy3JWoDvNbexM9/w8=;\n b=Heg+fkkLinf5Gy5fsTMWxwwcveW01fWPr9p826sA1MzI3Oxsr9grxA5U/9ulaFiKSs\n 4mFgCAaTRDnzm7Xztr47RSTuojy1YuwMb0CnIQvqmpRWi2rfGUJU3IQ35xJZNRhwLmgQ\n qVqBYmj2oVKKt95kifQrIghDzfnMX0B0F8mGP6i0lEHVGHtLDmZLK0qc6q6Os5wOg4bm\n WpOWGyye3GinmpeT+FDEmDMal6ZxSCgPQjzXX005+SYswvvE19Oezg+F0fPxqcyAMS8D\n rKiTDiZ0qQTFQEO76O+RYraUQ7lKbmnXaVKLZFYb0DEtYvB191kMxzNucf67Ml09VPfg\n uRwA==",
        "X-Gm-Message-State": "AO0yUKV1gxe/F8GZm2ZLyT2vOqLgy1tdC9airBcyZg5RFsbGCrvFa89p\n o7+Ym84M3E4FHUUr6l/DH3KMP46K2Zldxak94j4=",
        "X-Google-Smtp-Source": "\n AK7set8v+QFRja/ZmOeNs/+/vN3wrtEUJJLGVERbAvQqUywc74fkmlSaSM4J7p/6IB9JSQYGM3xZEg==",
        "X-Received": "by 2002:a17:90b:1646:b0:230:c073:4d9e with SMTP id\n il6-20020a17090b164600b00230c0734d9emr5800638pjb.41.1675811122692;\n Tue, 07 Feb 2023 15:05:22 -0800 (PST)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "Subject": "[RFC v2 17/17] port: replace RTE_LOGTYPE_PORT with dynamic type",
        "Date": "Tue,  7 Feb 2023 15:04:38 -0800",
        "Message-Id": "<20230207230438.1617331-18-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": "Split up the single static RTE_LOGTYPE_PORT into seperate\nsub types for each component: port.ethdev, port.evendev, ...\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/port/rte_port_ethdev.c      | 23 +++++----\n lib/port/rte_port_eventdev.c    | 23 +++++----\n lib/port/rte_port_fd.c          | 28 ++++++-----\n lib/port/rte_port_frag.c        | 21 +++++----\n lib/port/rte_port_kni.c         | 22 +++++----\n lib/port/rte_port_ras.c         | 17 ++++---\n lib/port/rte_port_ring.c        | 22 +++++----\n lib/port/rte_port_sched.c       | 16 ++++---\n lib/port/rte_port_source_sink.c | 82 +++++++++++++++++++--------------\n lib/port/rte_port_sym_crypto.c  | 22 +++++----\n 12 files changed, 164 insertions(+), 115 deletions(-)",
    "diff": "diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c\nindex 212ccda0a6e8..7002e267be37 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_PORT,       \"lib.port\"},\n \t{RTE_LOGTYPE_TABLE,      \"lib.table\"},\n \t{RTE_LOGTYPE_PIPELINE,   \"lib.pipeline\"},\n \t{RTE_LOGTYPE_CRYPTODEV,  \"lib.cryptodev\"},\ndiff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h\nindex a1549b372767..ff714a703be7 100644\n--- a/lib/eal/include/rte_log.h\n+++ b/lib/eal/include/rte_log.h\n@@ -39,7 +39,7 @@ extern \"C\" {\n \t\t\t\t /* was RTE_LOGTYPE_POWER */\n \t\t\t\t /* was RTE_LOGTYPE_METER */\n \t\t\t\t /* was RTE_LOGTYPE_SCHED */\n-#define RTE_LOGTYPE_PORT      13 /**< Log related to port. */\n+\t\t\t\t /* was RTE_LOGTYPE_PORT */\n #define RTE_LOGTYPE_TABLE     14 /**< Log related to table. */\n #define RTE_LOGTYPE_PIPELINE  15 /**< Log related to pipeline. */\n \t\t\t\t /* was RTE_LOGTYPE_MBUF */\ndiff --git a/lib/port/rte_port_ethdev.c b/lib/port/rte_port_ethdev.c\nindex 0da7890261e9..614bdacb3cec 100644\n--- a/lib/port/rte_port_ethdev.c\n+++ b/lib/port/rte_port_ethdev.c\n@@ -5,11 +5,16 @@\n #include <stdint.h>\n \n #include <rte_mbuf.h>\n+#include <rte_log.h>\n #include <rte_ethdev.h>\n #include <rte_malloc.h>\n \n #include \"rte_port_ethdev.h\"\n \n+RTE_LOG_REGISTER_SUFFIX(port_ethdev_logtype, \"port.ethdev\", INFO);\n+#define RTE_PORT_ETHDEV_LOG(level, fmt, args...)\t\t\\\n+\trte_log(RTE_LOG_ ## level, port_ethdev_logtype,\t\\\n+\t\t\"%s: \" fmt \"\\n\", __func__, ## args)\n /*\n  * Port ETHDEV Reader\n  */\n@@ -43,7 +48,7 @@ rte_port_ethdev_reader_create(void *params, int socket_id)\n \n \t/* Check input parameters */\n \tif (conf == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: params is NULL\\n\", __func__);\n+\t\tRTE_PORT_ETHDEV_LOG(ERR, \"params is NULL\");\n \t\treturn NULL;\n \t}\n \n@@ -51,7 +56,7 @@ rte_port_ethdev_reader_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_ETHDEV_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -78,7 +83,7 @@ static int\n rte_port_ethdev_reader_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: port is NULL\\n\", __func__);\n+\t\tRTE_PORT_ETHDEV_LOG(ERR, \"port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -142,7 +147,7 @@ rte_port_ethdev_writer_create(void *params, int socket_id)\n \t\t(conf->tx_burst_sz == 0) ||\n \t\t(conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX) ||\n \t\t(!rte_is_power_of_2(conf->tx_burst_sz))) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid input parameters\\n\", __func__);\n+\t\tRTE_PORT_ETHDEV_LOG(ERR, \"Invalid input parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -150,7 +155,7 @@ rte_port_ethdev_writer_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_ETHDEV_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -257,7 +262,7 @@ static int\n rte_port_ethdev_writer_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Port is NULL\\n\", __func__);\n+\t\tRTE_PORT_ETHDEV_LOG(ERR, \"Port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -323,7 +328,7 @@ rte_port_ethdev_writer_nodrop_create(void *params, int socket_id)\n \t\t(conf->tx_burst_sz == 0) ||\n \t\t(conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX) ||\n \t\t(!rte_is_power_of_2(conf->tx_burst_sz))) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid input parameters\\n\", __func__);\n+\t\tRTE_PORT_ETHDEV_LOG(ERR, \"Invalid input parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -331,7 +336,7 @@ rte_port_ethdev_writer_nodrop_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_ETHDEV_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -470,7 +475,7 @@ static int\n rte_port_ethdev_writer_nodrop_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Port is NULL\\n\", __func__);\n+\t\tRTE_PORT_ETHDEV_LOG(ERR, \"Port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \ndiff --git a/lib/port/rte_port_eventdev.c b/lib/port/rte_port_eventdev.c\nindex fd7dac9a5661..4d0838a004c9 100644\n--- a/lib/port/rte_port_eventdev.c\n+++ b/lib/port/rte_port_eventdev.c\n@@ -5,11 +5,16 @@\n #include <string.h>\n #include <stdint.h>\n \n+#include <rte_log.h>\n #include <rte_mbuf.h>\n #include <rte_malloc.h>\n \n #include \"rte_port_eventdev.h\"\n \n+RTE_LOG_REGISTER_SUFFIX(port_eventdev_logtype, \"port.eventdev\", INFO);\n+#define RTE_PORT_EVENTDEV_LOG(level, fmt, args...)\t\t\\\n+\trte_log(RTE_LOG_ ## level, port_eventdev_logtype,\t\\\n+\t\t\"%s: \" fmt \"\\n\", __func__, ## args)\n /*\n  * Port EVENTDEV Reader\n  */\n@@ -45,7 +50,7 @@ rte_port_eventdev_reader_create(void *params, int socket_id)\n \n \t/* Check input parameters */\n \tif (conf == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: params is NULL\\n\", __func__);\n+\t\tRTE_PORT_EVENTDEV_LOG(ERR, \"params is NULL\");\n \t\treturn NULL;\n \t}\n \n@@ -53,7 +58,7 @@ rte_port_eventdev_reader_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_EVENTDEV_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -85,7 +90,7 @@ static int\n rte_port_eventdev_reader_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: port is NULL\\n\", __func__);\n+\t\tRTE_PORT_EVENTDEV_LOG(ERR, \"port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -155,7 +160,7 @@ rte_port_eventdev_writer_create(void *params, int socket_id)\n \t\t(conf->enq_burst_sz == 0) ||\n \t\t(conf->enq_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX) ||\n \t\t(!rte_is_power_of_2(conf->enq_burst_sz))) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid input parameters\\n\", __func__);\n+\t\tRTE_PORT_EVENTDEV_LOG(ERR, \"Invalid input parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -163,7 +168,7 @@ rte_port_eventdev_writer_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_EVENTDEV_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -290,7 +295,7 @@ static int\n rte_port_eventdev_writer_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Port is NULL\\n\", __func__);\n+\t\tRTE_PORT_EVENTDEV_LOG(ERR, \"Port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -362,7 +367,7 @@ rte_port_eventdev_writer_nodrop_create(void *params, int socket_id)\n \t\t(conf->enq_burst_sz == 0) ||\n \t\t(conf->enq_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX) ||\n \t\t(!rte_is_power_of_2(conf->enq_burst_sz))) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid input parameters\\n\", __func__);\n+\t\tRTE_PORT_EVENTDEV_LOG(ERR, \"Invalid input parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -370,7 +375,7 @@ rte_port_eventdev_writer_nodrop_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_EVENTDEV_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -530,7 +535,7 @@ static int\n rte_port_eventdev_writer_nodrop_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Port is NULL\\n\", __func__);\n+\t\tRTE_PORT_EVENTDEV_LOG(ERR, \"Port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \ndiff --git a/lib/port/rte_port_fd.c b/lib/port/rte_port_fd.c\nindex 932ecd324e05..0c059a465b3a 100644\n--- a/lib/port/rte_port_fd.c\n+++ b/lib/port/rte_port_fd.c\n@@ -10,6 +10,10 @@\n \n #include \"rte_port_fd.h\"\n \n+RTE_LOG_REGISTER_SUFFIX(port_fd_logtype, \"port.fd\", INFO);\n+#define RTE_PORT_FD_LOG(level, fmt, args...)\t\t\\\n+\trte_log(RTE_LOG_ ## level, port_fd_logtype,\t\\\n+\t\t\"%s: \" fmt \"\\n\", __func__, ## args)\n /*\n  * Port FD Reader\n  */\n@@ -43,19 +47,19 @@ rte_port_fd_reader_create(void *params, int socket_id)\n \n \t/* Check input parameters */\n \tif (conf == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: params is NULL\\n\", __func__);\n+\t\tRTE_PORT_FD_LOG(ERR, \"params is NULL\");\n \t\treturn NULL;\n \t}\n \tif (conf->fd < 0) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid file descriptor\\n\", __func__);\n+\t\tRTE_PORT_FD_LOG(ERR, \"Invalid file descriptor\");\n \t\treturn NULL;\n \t}\n \tif (conf->mtu == 0) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid MTU\\n\", __func__);\n+\t\tRTE_PORT_FD_LOG(ERR, \"Invalid MTU\");\n \t\treturn NULL;\n \t}\n \tif (conf->mempool == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid mempool\\n\", __func__);\n+\t\tRTE_PORT_FD_LOG(ERR, \"Invalid mempool\");\n \t\treturn NULL;\n \t}\n \n@@ -63,7 +67,7 @@ rte_port_fd_reader_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_FD_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -109,7 +113,7 @@ static int\n rte_port_fd_reader_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: port is NULL\\n\", __func__);\n+\t\tRTE_PORT_FD_LOG(ERR, \"port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -171,7 +175,7 @@ rte_port_fd_writer_create(void *params, int socket_id)\n \t\t(conf->tx_burst_sz == 0) ||\n \t\t(conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX) ||\n \t\t(!rte_is_power_of_2(conf->tx_burst_sz))) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid input parameters\\n\", __func__);\n+\t\tRTE_PORT_FD_LOG(ERR, \"Invalid input parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -179,7 +183,7 @@ rte_port_fd_writer_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_FD_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -279,7 +283,7 @@ static int\n rte_port_fd_writer_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Port is NULL\\n\", __func__);\n+\t\tRTE_PORT_FD_LOG(ERR, \"Port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -344,7 +348,7 @@ rte_port_fd_writer_nodrop_create(void *params, int socket_id)\n \t\t(conf->tx_burst_sz == 0) ||\n \t\t(conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX) ||\n \t\t(!rte_is_power_of_2(conf->tx_burst_sz))) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid input parameters\\n\", __func__);\n+\t\tRTE_PORT_FD_LOG(ERR, \"Invalid input parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -352,7 +356,7 @@ rte_port_fd_writer_nodrop_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_FD_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -464,7 +468,7 @@ static int\n rte_port_fd_writer_nodrop_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Port is NULL\\n\", __func__);\n+\t\tRTE_PORT_FD_LOG(ERR, \"Port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \ndiff --git a/lib/port/rte_port_frag.c b/lib/port/rte_port_frag.c\nindex e1f1892176c4..243ebf225770 100644\n--- a/lib/port/rte_port_frag.c\n+++ b/lib/port/rte_port_frag.c\n@@ -7,6 +7,11 @@\n \n #include \"rte_port_frag.h\"\n \n+RTE_LOG_REGISTER_SUFFIX(port_frag_logtype, \"port.frag\", INFO);\n+#define RTE_PORT_FRAG_LOG(level, fmt, args...)\t\t\\\n+\trte_log(RTE_LOG_ ## level, port_frag_logtype,\t\\\n+\t\t\"%s: \" fmt \"\\n\", __func__, ## args)\n+\n /* Max number of fragments per packet allowed */\n #define\tRTE_PORT_FRAG_MAX_FRAGS_PER_PACKET 0x80\n \n@@ -62,25 +67,23 @@ rte_port_ring_reader_frag_create(void *params, int socket_id, int is_ipv4)\n \n \t/* Check input parameters */\n \tif (conf == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Parameter conf is NULL\\n\", __func__);\n+\t\tRTE_PORT_FRAG_LOG(ERR, \"Parameter conf is NULL\");\n \t\treturn NULL;\n \t}\n \tif (conf->ring == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Parameter ring is NULL\\n\", __func__);\n+\t\tRTE_PORT_FRAG_LOG(ERR, \"Parameter ring is NULL\");\n \t\treturn NULL;\n \t}\n \tif (conf->mtu == 0) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Parameter mtu is invalid\\n\", __func__);\n+\t\tRTE_PORT_FRAG_LOG(ERR, \"Parameter mtu is invalid\");\n \t\treturn NULL;\n \t}\n \tif (conf->pool_direct == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Parameter pool_direct is NULL\\n\",\n-\t\t\t__func__);\n+\t\tRTE_PORT_FRAG_LOG(ERR, \"Parameter pool_direct is NULL\");\n \t\treturn NULL;\n \t}\n \tif (conf->pool_indirect == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Parameter pool_indirect is NULL\\n\",\n-\t\t\t__func__);\n+\t\tRTE_PORT_FRAG_LOG(ERR, \"Parameter pool_indirect is NULL\");\n \t\treturn NULL;\n \t}\n \n@@ -88,7 +91,7 @@ rte_port_ring_reader_frag_create(void *params, int socket_id, int is_ipv4)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port), RTE_CACHE_LINE_SIZE,\n \t\tsocket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: port is NULL\\n\", __func__);\n+\t\tRTE_PORT_FRAG_LOG(ERR, \"port is NULL\");\n \t\treturn NULL;\n \t}\n \n@@ -232,7 +235,7 @@ static int\n rte_port_ring_reader_frag_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Parameter port is NULL\\n\", __func__);\n+\t\tRTE_PORT_FRAG_LOG(ERR, \"Parameter port is NULL\");\n \t\treturn -1;\n \t}\n \ndiff --git a/lib/port/rte_port_kni.c b/lib/port/rte_port_kni.c\nindex 1c7a6cb200ea..ed2b5c3e4a31 100644\n--- a/lib/port/rte_port_kni.c\n+++ b/lib/port/rte_port_kni.c\n@@ -9,6 +9,10 @@\n \n #include \"rte_port_kni.h\"\n \n+RTE_LOG_REGISTER_SUFFIX(port_kni_logtype, \"port.kni\", INFO);\n+#define RTE_PORT_KNI_LOG(level, fmt, args...)\t\t\\\n+\trte_log(RTE_LOG_ ## level, port_kni_logtype,\t\\\n+\t\t\"%s: \" fmt \"\\n\", __func__, ## args)\n /*\n  * Port KNI Reader\n  */\n@@ -41,7 +45,7 @@ rte_port_kni_reader_create(void *params, int socket_id)\n \n \t/* Check input parameters */\n \tif (conf == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: params is NULL\\n\", __func__);\n+\t\tRTE_PORT_KNI_LOG(ERR, \"params is NULL\");\n \t\treturn NULL;\n \t}\n \n@@ -49,7 +53,7 @@ rte_port_kni_reader_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_KNI_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -75,7 +79,7 @@ static int\n rte_port_kni_reader_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: port is NULL\\n\", __func__);\n+\t\tRTE_PORT_KNI_LOG(ERR, \"port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -138,7 +142,7 @@ rte_port_kni_writer_create(void *params, int socket_id)\n \t\t(conf->tx_burst_sz == 0) ||\n \t\t(conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX) ||\n \t\t(!rte_is_power_of_2(conf->tx_burst_sz))) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid input parameters\\n\", __func__);\n+\t\tRTE_PORT_KNI_LOG(ERR, \"Invalid input parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -146,7 +150,7 @@ rte_port_kni_writer_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_KNI_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -250,7 +254,7 @@ static int\n rte_port_kni_writer_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Port is NULL\\n\", __func__);\n+\t\tRTE_PORT_KNI_LOG(ERR, \"Port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -315,7 +319,7 @@ rte_port_kni_writer_nodrop_create(void *params, int socket_id)\n \t\t(conf->tx_burst_sz == 0) ||\n \t\t(conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX) ||\n \t\t(!rte_is_power_of_2(conf->tx_burst_sz))) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid input parameters\\n\", __func__);\n+\t\tRTE_PORT_KNI_LOG(ERR, \"Invalid input parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -323,7 +327,7 @@ rte_port_kni_writer_nodrop_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_KNI_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -460,7 +464,7 @@ static int\n rte_port_kni_writer_nodrop_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Port is NULL\\n\", __func__);\n+\t\tRTE_PORT_KNI_LOG(ERR, \"Port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \ndiff --git a/lib/port/rte_port_ras.c b/lib/port/rte_port_ras.c\nindex e5de57da42ea..3205b1abc360 100644\n--- a/lib/port/rte_port_ras.c\n+++ b/lib/port/rte_port_ras.c\n@@ -21,6 +21,11 @@\n #define RTE_PORT_RAS_N_ENTRIES (RTE_PORT_RAS_N_BUCKETS * RTE_PORT_RAS_N_ENTRIES_PER_BUCKET)\n #endif\n \n+RTE_LOG_REGISTER_SUFFIX(port_ras_logtype, \"port.ras\", INFO);\n+#define RTE_PORT_RAS_LOG(level, fmt, args...)\t\t\\\n+\trte_log(RTE_LOG_ ## level, port_ras_logtype,\t\\\n+\t\t\"%s: \" fmt \"\\n\", __func__, ## args)\n+\n #ifdef RTE_PORT_STATS_COLLECT\n \n #define RTE_PORT_RING_WRITER_RAS_STATS_PKTS_IN_ADD(port, val) \\\n@@ -69,16 +74,16 @@ rte_port_ring_writer_ras_create(void *params, int socket_id, int is_ipv4)\n \n \t/* Check input parameters */\n \tif (conf == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Parameter conf is NULL\\n\", __func__);\n+\t\tRTE_PORT_RAS_LOG(ERR, \"Parameter conf is NULL\");\n \t\treturn NULL;\n \t}\n \tif (conf->ring == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Parameter ring is NULL\\n\", __func__);\n+\t\tRTE_PORT_RAS_LOG(ERR, \"Parameter ring is NULL\");\n \t\treturn NULL;\n \t}\n \tif ((conf->tx_burst_sz == 0) ||\n \t    (conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX)) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Parameter tx_burst_sz is invalid\\n\",\n+\t\tRTE_PORT_RAS_LOG(ERR, \"Parameter tx_burst_sz is invalid\\n\",\n \t\t\t__func__);\n \t\treturn NULL;\n \t}\n@@ -87,7 +92,7 @@ rte_port_ring_writer_ras_create(void *params, int socket_id, int is_ipv4)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate socket\\n\", __func__);\n+\t\tRTE_PORT_RAS_LOG(ERR, \"Failed to allocate socket\");\n \t\treturn NULL;\n \t}\n \n@@ -103,7 +108,7 @@ rte_port_ring_writer_ras_create(void *params, int socket_id, int is_ipv4)\n \t\tsocket_id);\n \n \tif (port->frag_tbl == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: rte_ip_frag_table_create failed\\n\",\n+\t\tRTE_PORT_RAS_LOG(ERR, \"rte_ip_frag_table_create failed\\n\",\n \t\t\t__func__);\n \t\trte_free(port);\n \t\treturn NULL;\n@@ -282,7 +287,7 @@ rte_port_ring_writer_ras_free(void *port)\n \t\t\tport;\n \n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Parameter port is NULL\\n\", __func__);\n+\t\tRTE_PORT_RAS_LOG(ERR, \"Parameter port is NULL\");\n \t\treturn -1;\n \t}\n \ndiff --git a/lib/port/rte_port_ring.c b/lib/port/rte_port_ring.c\nindex 52b2d8e557f0..e493f63ab25e 100644\n--- a/lib/port/rte_port_ring.c\n+++ b/lib/port/rte_port_ring.c\n@@ -10,6 +10,10 @@\n \n #include \"rte_port_ring.h\"\n \n+RTE_LOG_REGISTER_SUFFIX(port_ring_logtype, \"port.ring\", INFO);\n+#define RTE_PORT_RING_LOG(level, fmt, args...)\t\t\\\n+\trte_log(RTE_LOG_ ## level, port_ring_logtype,\t\\\n+\t\t\"%s: \" fmt \"\\n\", __func__, ## args)\n /*\n  * Port RING Reader\n  */\n@@ -46,7 +50,7 @@ rte_port_ring_reader_create_internal(void *params, int socket_id,\n \t\t(conf->ring == NULL) ||\n \t\t(rte_ring_is_cons_single(conf->ring) && is_multi) ||\n \t\t(!rte_ring_is_cons_single(conf->ring) && !is_multi)) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid Parameters\\n\", __func__);\n+\t\tRTE_PORT_RING_LOG(ERR, \"Invalid Parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -54,7 +58,7 @@ rte_port_ring_reader_create_internal(void *params, int socket_id,\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_RING_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -107,7 +111,7 @@ static int\n rte_port_ring_reader_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: port is NULL\\n\", __func__);\n+\t\tRTE_PORT_RING_LOG(ERR, \"port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -174,7 +178,7 @@ rte_port_ring_writer_create_internal(void *params, int socket_id,\n \t\t(rte_ring_is_prod_single(conf->ring) && is_multi) ||\n \t\t(!rte_ring_is_prod_single(conf->ring) && !is_multi) ||\n \t\t(conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX)) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid Parameters\\n\", __func__);\n+\t\tRTE_PORT_RING_LOG(ERR, \"Invalid Parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -182,7 +186,7 @@ rte_port_ring_writer_create_internal(void *params, int socket_id,\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_RING_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -370,7 +374,7 @@ rte_port_ring_writer_free(void *port)\n \tstruct rte_port_ring_writer *p = port;\n \n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Port is NULL\\n\", __func__);\n+\t\tRTE_PORT_RING_LOG(ERR, \"Port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -443,7 +447,7 @@ rte_port_ring_writer_nodrop_create_internal(void *params, int socket_id,\n \t\t(rte_ring_is_prod_single(conf->ring) && is_multi) ||\n \t\t(!rte_ring_is_prod_single(conf->ring) && !is_multi) ||\n \t\t(conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX)) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid Parameters\\n\", __func__);\n+\t\tRTE_PORT_RING_LOG(ERR, \"Invalid Parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -451,7 +455,7 @@ rte_port_ring_writer_nodrop_create_internal(void *params, int socket_id,\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_RING_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -703,7 +707,7 @@ rte_port_ring_writer_nodrop_free(void *port)\n \t\t\tport;\n \n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Port is NULL\\n\", __func__);\n+\t\tRTE_PORT_RING_LOG(ERR, \"Port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \ndiff --git a/lib/port/rte_port_sched.c b/lib/port/rte_port_sched.c\nindex 8a7d815ef323..dc590fd9c647 100644\n--- a/lib/port/rte_port_sched.c\n+++ b/lib/port/rte_port_sched.c\n@@ -7,6 +7,10 @@\n \n #include \"rte_port_sched.h\"\n \n+RTE_LOG_REGISTER_SUFFIX(port_sched_logtype, \"port.sched\", INFO);\n+#define RTE_PORT_SCHED_LOG(level, fmt, args...)\t\t\\\n+\trte_log(RTE_LOG_ ## level, port_sched_logtype,\t\\\n+\t\t\"%s: \" fmt \"\\n\", __func__, ##args)\n /*\n  * Reader\n  */\n@@ -40,7 +44,7 @@ rte_port_sched_reader_create(void *params, int socket_id)\n \t/* Check input parameters */\n \tif ((conf == NULL) ||\n \t    (conf->sched == NULL)) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid params\\n\", __func__);\n+\t\tRTE_PORT_SCHED_LOG(ERR, \"Invalid params\");\n \t\treturn NULL;\n \t}\n \n@@ -48,7 +52,7 @@ rte_port_sched_reader_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_SCHED_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -74,7 +78,7 @@ static int\n rte_port_sched_reader_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: port is NULL\\n\", __func__);\n+\t\tRTE_PORT_SCHED_LOG(ERR, \"port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -139,7 +143,7 @@ rte_port_sched_writer_create(void *params, int socket_id)\n \t    (conf->tx_burst_sz == 0) ||\n \t    (conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX) ||\n \t\t(!rte_is_power_of_2(conf->tx_burst_sz))) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid params\\n\", __func__);\n+\t\tRTE_PORT_SCHED_LOG(ERR, \"Invalid params\");\n \t\treturn NULL;\n \t}\n \n@@ -147,7 +151,7 @@ rte_port_sched_writer_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_SCHED_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -247,7 +251,7 @@ static int\n rte_port_sched_writer_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: port is NULL\\n\", __func__);\n+\t\tRTE_PORT_SCHED_LOG(ERR, \"port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \ndiff --git a/lib/port/rte_port_source_sink.c b/lib/port/rte_port_source_sink.c\nindex 7d73adc1e79e..fbb453f22fae 100644\n--- a/lib/port/rte_port_source_sink.c\n+++ b/lib/port/rte_port_source_sink.c\n@@ -15,6 +15,12 @@\n \n #include \"rte_port_source_sink.h\"\n \n+RTE_LOG_REGISTER_SUFFIX(port_source_logtype, \"port.source\", INFO);\n+\n+#define RTE_PORT_SOURCE_LOG(level, fmt, args...)\t\\\n+\trte_log(RTE_LOG_ ## level, port_source_logtype,\t\\\n+\t\t\"%s: \" fmt \"\\n\", __func__, ##args)\n+\n /*\n  * Port SOURCE\n  */\n@@ -49,9 +55,9 @@ struct rte_port_source {\n \n static int\n pcap_source_load(struct rte_port_source *port,\n-\t\tconst char *file_name,\n-\t\tuint32_t n_bytes_per_pkt,\n-\t\tint socket_id)\n+\t\t const char *file_name,\n+\t\t uint32_t n_bytes_per_pkt,\n+\t\t int socket_id)\n {\n \tuint32_t n_pkts = 0;\n \tuint32_t i;\n@@ -64,8 +70,8 @@ pcap_source_load(struct rte_port_source *port,\n \tconst uint8_t *pkt;\n \tuint8_t *buff = NULL;\n \tuint32_t pktmbuf_maxlen = (uint32_t)\n-\t\t\t(rte_pktmbuf_data_room_size(port->mempool) -\n-\t\t\tRTE_PKTMBUF_HEADROOM);\n+\t\t(rte_pktmbuf_data_room_size(port->mempool) -\n+\t\t RTE_PKTMBUF_HEADROOM);\n \n \tif (n_bytes_per_pkt == 0)\n \t\tmax_len = pktmbuf_maxlen;\n@@ -75,8 +81,9 @@ pcap_source_load(struct rte_port_source *port,\n \t/* first time open, get packet number */\n \tpcap_handle = pcap_open_offline(file_name, pcap_errbuf);\n \tif (pcap_handle == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"Failed to open pcap file \"\n-\t\t\t\"'%s' for reading\\n\", file_name);\n+\t\tRTE_PORT_SOURCE_LOG(ERR,\n+\t\t\t\t    \"Failed to open pcap file '%s' for reading\",\n+\t\t\t\t    file_name);\n \t\tgoto error_exit;\n \t}\n \n@@ -86,31 +93,32 @@ pcap_source_load(struct rte_port_source *port,\n \tpcap_close(pcap_handle);\n \n \tport->pkt_len = rte_zmalloc_socket(\"PCAP\",\n-\t\t(sizeof(*port->pkt_len) * n_pkts), 0, socket_id);\n+\t\t\t\t\t   (sizeof(*port->pkt_len) * n_pkts), 0, socket_id);\n \tif (port->pkt_len == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"No enough memory\\n\");\n+\t\tRTE_PORT_SOURCE_LOG(ERR, \"Not enough memory\");\n \t\tgoto error_exit;\n \t}\n \n \tpkt_len_aligns = rte_malloc(\"PCAP\",\n-\t\t(sizeof(*pkt_len_aligns) * n_pkts), 0);\n+\t\t\t\t    (sizeof(*pkt_len_aligns) * n_pkts), 0);\n \tif (pkt_len_aligns == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"No enough memory\\n\");\n+\t\tRTE_PORT_SOURCE_LOG(ERR, \"Not enough memory\");\n \t\tgoto error_exit;\n \t}\n \n \tport->pkts = rte_zmalloc_socket(\"PCAP\",\n-\t\t(sizeof(*port->pkts) * n_pkts), 0, socket_id);\n+\t\t\t\t\t(sizeof(*port->pkts) * n_pkts), 0, socket_id);\n \tif (port->pkts == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"No enough memory\\n\");\n+\t\tRTE_PORT_SOURCE_LOG(ERR, \"Not enough memory\");\n \t\tgoto error_exit;\n \t}\n \n \t/* open 2nd time, get pkt_len */\n \tpcap_handle = pcap_open_offline(file_name, pcap_errbuf);\n \tif (pcap_handle == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"Failed to open pcap file \"\n-\t\t\t\"'%s' for reading\\n\", file_name);\n+\t\tRTE_PORT_SOURCE_LOG(ERR,\n+\t\t\t\t    \"Failed to open pcap file '%s' for reading\",\n+\t\t\t\t    file_name);\n \t\tgoto error_exit;\n \t}\n \n@@ -126,9 +134,9 @@ pcap_source_load(struct rte_port_source *port,\n \n \t/* allocate a big trunk of data for pcap file load */\n \tbuff = rte_zmalloc_socket(\"PCAP\",\n-\t\ttotal_buff_len, 0, socket_id);\n+\t\t\t\t  total_buff_len, 0, socket_id);\n \tif (buff == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"No enough memory\\n\");\n+\t\tRTE_PORT_SOURCE_LOG(ERR, \"Not enough memory\");\n \t\tgoto error_exit;\n \t}\n \n@@ -137,8 +145,9 @@ pcap_source_load(struct rte_port_source *port,\n \t/* open file one last time to copy the pkt content */\n \tpcap_handle = pcap_open_offline(file_name, pcap_errbuf);\n \tif (pcap_handle == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"Failed to open pcap file \"\n-\t\t\t\"'%s' for reading\\n\", file_name);\n+\t\tRTE_PORT_SOURCE_LOG(ERR,\n+\t\t\t\t    \"Failed to open pcap file '%s' for reading\",\n+\t\t\t\t    file_name);\n \t\tgoto error_exit;\n \t}\n \n@@ -155,9 +164,9 @@ pcap_source_load(struct rte_port_source *port,\n \n \trte_free(pkt_len_aligns);\n \n-\tRTE_LOG(INFO, PORT, \"Successfully load pcap file \"\n-\t\t\"'%s' with %u pkts\\n\",\n-\t\tfile_name, port->n_pkts);\n+\tRTE_PORT_SOURCE_LOG(INFO,\n+\t\t\t    \"Successfully load pcap file '%s' with %u pkts\",\n+\t\t\t    file_name, port->n_pkts);\n \n \treturn 0;\n \n@@ -180,8 +189,8 @@ pcap_source_load(struct rte_port_source *port,\n \tint _ret = 0;\t\t\t\t\t\t\\\n \t\t\t\t\t\t\t\t\\\n \tif (file_name) {\t\t\t\t\t\\\n-\t\tRTE_LOG(ERR, PORT, \"Source port field \"\t\t\\\n-\t\t\t\"\\\"file_name\\\" is not NULL.\\n\");\t\\\n+\t\tRTE_PORT_SOURCE_LOG(ERR, \"Source port field \"\t\\\n+\t\t\t\"\\\"file_name\\\" is not NULL.\");\t\t\\\n \t\t_ret = -1;\t\t\t\t\t\\\n \t}\t\t\t\t\t\t\t\\\n \t\t\t\t\t\t\t\t\\\n@@ -199,7 +208,7 @@ rte_port_source_create(void *params, int socket_id)\n \n \t/* Check input arguments*/\n \tif ((p == NULL) || (p->mempool == NULL)) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid params\\n\", __func__);\n+\t\tRTE_PORT_SOURCE_LOG(ERR, \"Invalid params\");\n \t\treturn NULL;\n \t}\n \n@@ -207,7 +216,7 @@ rte_port_source_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_SOURCE_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -332,15 +341,16 @@ pcap_sink_open(struct rte_port_sink *port,\n \t/** Open a dead pcap handler for opening dumper file */\n \ttx_pcap = pcap_open_dead(DLT_EN10MB, 65535);\n \tif (tx_pcap == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"Cannot open pcap dead handler\\n\");\n+\t\tRTE_PORT_SOURCE_LOG(ERR, \"Cannot open pcap dead handler\");\n \t\treturn -1;\n \t}\n \n \t/* The dumper is created using the previous pcap_t reference */\n \tpcap_dumper = pcap_dump_open(tx_pcap, file_name);\n \tif (pcap_dumper == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"Failed to open pcap file \"\n-\t\t\t\"\\\"%s\\\" for writing\\n\", file_name);\n+\t\tRTE_PORT_SOURCE_LOG(ERR,\n+\t\t\t\t    \"Failed to open pcap file \\\"%s\\\" for writing\",\n+\t\t\t\t    file_name);\n \t\treturn -1;\n \t}\n \n@@ -349,8 +359,9 @@ pcap_sink_open(struct rte_port_sink *port,\n \tport->pkt_index = 0;\n \tport->dump_finish = 0;\n \n-\tRTE_LOG(INFO, PORT, \"Ready to dump packets to file \\\"%s\\\"\\n\",\n-\t\tfile_name);\n+\tRTE_PORT_SOURCE_LOG(INFO,\n+\t\t\t    \"Ready to dump packets to file \\\"%s\\\"\",\n+\t\t\t    file_name);\n \n \treturn 0;\n }\n@@ -402,8 +413,9 @@ pcap_sink_write_pkt(struct rte_port_sink *port, struct rte_mbuf *mbuf)\n \n \tif ((port->max_pkts != 0) && (port->pkt_index >= port->max_pkts)) {\n \t\tport->dump_finish = 1;\n-\t\tRTE_LOG(INFO, PORT, \"Dumped %u packets to file\\n\",\n-\t\t\t\tport->pkt_index);\n+\t\tRTE_PORT_SOURCE_LOG(INFO,\n+\t\t\t\t    \"Dumped %u packets to file\",\n+\t\t\t\t    port->pkt_index);\n \t}\n \n }\n@@ -433,7 +445,7 @@ do {\t\t\t\t\t\t\t\t\\\n \tint _ret = 0;\t\t\t\t\t\t\\\n \t\t\t\t\t\t\t\t\\\n \tif (file_name) {\t\t\t\t\t\\\n-\t\tRTE_LOG(ERR, PORT, \"Sink port field \"\t\t\\\n+\t\tRTE_PORT_SOURCE_LOG(ERR, \"Sink port field \"\t\\\n \t\t\t\"\\\"file_name\\\" is not NULL.\\n\");\t\\\n \t\t_ret = -1;\t\t\t\t\t\\\n \t}\t\t\t\t\t\t\t\\\n@@ -459,7 +471,7 @@ rte_port_sink_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_SOURCE_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \ndiff --git a/lib/port/rte_port_sym_crypto.c b/lib/port/rte_port_sym_crypto.c\nindex 295984d025cb..ee8573a3e1c4 100644\n--- a/lib/port/rte_port_sym_crypto.c\n+++ b/lib/port/rte_port_sym_crypto.c\n@@ -8,6 +8,10 @@\n \n #include \"rte_port_sym_crypto.h\"\n \n+RTE_LOG_REGISTER_SUFFIX(port_crypto_logtype, \"port.crypto\", INFO);\n+#define RTE_PORT_CRYPTO_LOG(level, fmt, args...)\t\t\\\n+\trte_log(RTE_LOG_ ## level, port_crypto_logtype,\t\\\n+\t\t\"%s: \" fmt \"\\n\", __func__, ##args)\n /*\n  * Port Crypto Reader\n  */\n@@ -44,7 +48,7 @@ rte_port_sym_crypto_reader_create(void *params, int socket_id)\n \n \t/* Check input parameters */\n \tif (conf == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: params is NULL\\n\", __func__);\n+\t\tRTE_PORT_CRYPTO_LOG(ERR, \"params is NULL\");\n \t\treturn NULL;\n \t}\n \n@@ -52,7 +56,7 @@ rte_port_sym_crypto_reader_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_CRYPTO_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -100,7 +104,7 @@ static int\n rte_port_sym_crypto_reader_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: port is NULL\\n\", __func__);\n+\t\tRTE_PORT_CRYPTO_LOG(ERR, \"port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -167,7 +171,7 @@ rte_port_sym_crypto_writer_create(void *params, int socket_id)\n \t\t(conf->tx_burst_sz == 0) ||\n \t\t(conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX) ||\n \t\t(!rte_is_power_of_2(conf->tx_burst_sz))) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid input parameters\\n\", __func__);\n+\t\tRTE_PORT_CRYPTO_LOG(ERR, \"Invalid input parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -175,7 +179,7 @@ rte_port_sym_crypto_writer_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_CRYPTO_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -285,7 +289,7 @@ static int\n rte_port_sym_crypto_writer_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Port is NULL\\n\", __func__);\n+\t\tRTE_PORT_CRYPTO_LOG(ERR, \"Port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -353,7 +357,7 @@ rte_port_sym_crypto_writer_nodrop_create(void *params, int socket_id)\n \t\t(conf->tx_burst_sz == 0) ||\n \t\t(conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX) ||\n \t\t(!rte_is_power_of_2(conf->tx_burst_sz))) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Invalid input parameters\\n\", __func__);\n+\t\tRTE_PORT_CRYPTO_LOG(ERR, \"Invalid input parameters\");\n \t\treturn NULL;\n \t}\n \n@@ -361,7 +365,7 @@ rte_port_sym_crypto_writer_nodrop_create(void *params, int socket_id)\n \tport = rte_zmalloc_socket(\"PORT\", sizeof(*port),\n \t\tRTE_CACHE_LINE_SIZE, socket_id);\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Failed to allocate port\\n\", __func__);\n+\t\tRTE_PORT_CRYPTO_LOG(ERR, \"Failed to allocate port\");\n \t\treturn NULL;\n \t}\n \n@@ -497,7 +501,7 @@ static int\n rte_port_sym_crypto_writer_nodrop_free(void *port)\n {\n \tif (port == NULL) {\n-\t\tRTE_LOG(ERR, PORT, \"%s: Port is NULL\\n\", __func__);\n+\t\tRTE_PORT_CRYPTO_LOG(ERR, \"Port is NULL\");\n \t\treturn -EINVAL;\n \t}\n \n",
    "prefixes": [
        "RFC",
        "v2",
        "17/17"
    ]
}