get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 90886,
    "url": "http://patchwork.dpdk.org/api/patches/90886/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210408164713.3455145-2-thomas@monjalon.net/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20210408164713.3455145-2-thomas@monjalon.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210408164713.3455145-2-thomas@monjalon.net",
    "date": "2021-04-08T16:47:10",
    "name": "[v7,1/4] log: move private functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "71a603c626d86838609f22cc64e2d87fd9a679e2",
    "submitter": {
        "id": 685,
        "url": "http://patchwork.dpdk.org/api/people/685/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas@monjalon.net"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patchwork.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210408164713.3455145-2-thomas@monjalon.net/mbox/",
    "series": [
        {
            "id": 16213,
            "url": "http://patchwork.dpdk.org/api/series/16213/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=16213",
            "date": "2021-04-08T16:47:09",
            "name": "log level enhancements",
            "version": 7,
            "mbox": "http://patchwork.dpdk.org/series/16213/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/90886/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/90886/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 01F97A0579;\n\tThu,  8 Apr 2021 18:47:23 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8248F141171;\n\tThu,  8 Apr 2021 18:47:21 +0200 (CEST)",
            "from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com\n [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id DEDBF14116F\n for <dev@dpdk.org>; Thu,  8 Apr 2021 18:47:19 +0200 (CEST)",
            "from compute2.internal (compute2.nyi.internal [10.202.2.42])\n by mailout.nyi.internal (Postfix) with ESMTP id 8252B5C015B;\n Thu,  8 Apr 2021 12:47:19 -0400 (EDT)",
            "from mailfrontend2 ([10.202.2.163])\n by compute2.internal (MEProxy); Thu, 08 Apr 2021 12:47:19 -0400",
            "from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])\n by mail.messagingengine.com (Postfix) with ESMTPA id A79C11080054;\n Thu,  8 Apr 2021 12:47:17 -0400 (EDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding; s=fm3; bh=m6YfMseFRrGxM\n nF83ZOiAKiQO5VRubjDqS8WNIz8uLg=; b=CALKjMsuhWnCgzP+N32XJTPi0xRtX\n WLsfjSc6ZG2RFr0epmbMfSherlpBn+z1WQdYPKV8VzQJfpnxdQmqBH+/feQj/wpN\n pNQ4zVO1MFnLehEf8To5oQMXLLw+VCelF9f7bumzJCruMhrx7IVSg/+mHhANnK7E\n 2Sb/XfT5URojB9NQfNSzyoIyDWSzimuN4mrN2k1cai8jiXhwOIGiWdozIOoKnZLX\n MuW+KJXq33GfTfEeO9ZrZoT+tt0WMHZom5D89RMwpzsEIhhkh79dmQuIfGGkvMm1\n qFBkMneHPfFbO7UJH5f9cZS12olHL0bIh5jhox62tX9U4LkMYqTk3e1tg==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n messagingengine.com; h=cc:content-transfer-encoding:date:from\n :in-reply-to:message-id:mime-version:references:subject:to\n :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=\n fm2; bh=m6YfMseFRrGxMnF83ZOiAKiQO5VRubjDqS8WNIz8uLg=; b=mgefxxnx\n a/bSXdSnJ28xZ5pClijah3EDTbbYADuerqcGVLT3PtjGiTu3XthhcFbg1IEJ5MLU\n skmcwkMToVdTvOLXdavJ9+ELV51FUssm7rDxyFESoMXRdsq20arlgtnfhU2RpAb6\n hk7h+JluzA6n7ZukzL4HD/sq3t6OqVklrOeVW5m10gC4ZnqnUhgFAbJgsQEcXQKj\n DBDNfomtGtV+MQEMzCeLLRPCvujBWIVqgLXsG9lFc7y/fifga7nNob2adHhS1qJj\n WEUnRdzLtoxDmf4RQ1w2Kklk8Tk9M8GLu3yosOa66Vzc1O/kBOSsaS87xbXiuoUE\n j5HEHjz1ArHmtQ=="
        ],
        "X-ME-Sender": "<xms:ljNvYATHly8guOy0pn_2nJWvBRXto5NemMVq0dyPr7CFBh6ysU1z-g>\n <xme:ljNvYNxwE9gJEkhWD-Dox3RsgP_3w3cmOdHJR961l-uFKUdJ4WCwsLOvwhxTX1uJ4\n dOhcGMzF410KjiKvw>",
        "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgeduledrudejledguddtjecutefuodetggdotefrod\n ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh\n necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd\n enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm\n rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc\n ggtffrrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedt\n gfeutdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh\n fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr\n lhhonhdrnhgvth",
        "X-ME-Proxy": "<xmx:ljNvYN0N3UFOUjUzTIiBRaePmEd8xoM8QcSFjWD0LZcD39F_aLEiSg>\n <xmx:ljNvYEDhMljQVtq-jvm0WcqQ4apt1n5qo8lPhjWleGpFRaBy2T8F5Q>\n <xmx:ljNvYJgsTadRWfffFYxlbqNUfeho_D3Ea_7IGcthOU40bzgnSQWdlg>\n <xmx:lzNvYHaOWHhb3aMz1h-2foz7ONUKw4jAFi8xyKwn46PJTGzjv-SNpQ>",
        "From": "Thomas Monjalon <thomas@monjalon.net>",
        "To": "dev@dpdk.org",
        "Cc": "david.marchand@redhat.com, Bruce Richardson <bruce.richardson@intel.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,\n Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,\n Dmitry Malloy <dmitrym@microsoft.com>,\n Pallavi Kadam <pallavi.kadam@intel.com>",
        "Date": "Thu,  8 Apr 2021 18:47:10 +0200",
        "Message-Id": "<20210408164713.3455145-2-thomas@monjalon.net>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210408164713.3455145-1-thomas@monjalon.net>",
        "References": "<20210405193000.1113542-1-thomas@monjalon.net>\n <20210408164713.3455145-1-thomas@monjalon.net>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v7 1/4] log: move private functions",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Some private log functions had a wrong \"rte_\" prefix.\n\nAll private log functions are moved from eal_private.h\nto the new file eal_log.h:\n\trte_eal_log_init -> eal_log_init\n\trte_log_save_regexp -> eal_log_save_regexp\n\trte_log_save_pattern -> eal_log_save_pattern\n\teal_log_set_default\n\nThe static functions in the file eal_common_log.c are renamed:\n\trte_log_save_level -> log_save_level\n\trte_log_lookup -> log_lookup\n\trte_log_init -> log_init\n\t__rte_log_register -> log_register\n\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\nAcked-by: Bruce Richardson <bruce.richardson@intel.com>\nAcked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>\nReviewed-by: David Marchand <david.marchand@redhat.com>\n---\n lib/librte_eal/common/eal_common_log.c     | 28 +++++++++++----------\n lib/librte_eal/common/eal_common_options.c |  5 ++--\n lib/librte_eal/common/eal_log.h            | 27 ++++++++++++++++++++\n lib/librte_eal/common/eal_private.h        | 29 ----------------------\n lib/librte_eal/linux/eal.c                 |  3 ++-\n lib/librte_eal/linux/eal_log.c             |  4 +--\n lib/librte_eal/windows/eal.c               |  3 ++-\n lib/librte_eal/windows/eal_log.c           |  6 +++--\n 8 files changed, 55 insertions(+), 50 deletions(-)\n create mode 100644 lib/librte_eal/common/eal_log.h",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c\nindex c5554badb2..058fa10ffc 100644\n--- a/lib/librte_eal/common/eal_common_log.c\n+++ b/lib/librte_eal/common/eal_common_log.c\n@@ -15,7 +15,7 @@\n #include <rte_log.h>\n #include <rte_per_lcore.h>\n \n-#include \"eal_private.h\"\n+#include \"eal_log.h\"\n \n struct rte_log_dynamic_type {\n \tconst char *name;\n@@ -178,8 +178,8 @@ rte_log_set_level_regexp(const char *regex, uint32_t level)\n  * Save the type string and the loglevel for later dynamic\n  * logtypes which may register later.\n  */\n-static int rte_log_save_level(int priority,\n-\t\t\t      const char *regex, const char *pattern)\n+static int\n+log_save_level(uint32_t priority, const char *regex, const char *pattern)\n {\n \tstruct rte_eal_opt_loglevel *opt_ll = NULL;\n \n@@ -207,9 +207,10 @@ static int rte_log_save_level(int priority,\n \treturn -1;\n }\n \n-int rte_log_save_regexp(const char *regex, int tmp)\n+int\n+eal_log_save_regexp(const char *regex, uint32_t level)\n {\n-\treturn rte_log_save_level(tmp, regex, NULL);\n+\treturn log_save_level(level, regex, NULL);\n }\n \n /* set log level based on globbing pattern */\n@@ -232,9 +233,10 @@ rte_log_set_level_pattern(const char *pattern, uint32_t level)\n \treturn 0;\n }\n \n-int rte_log_save_pattern(const char *pattern, int priority)\n+int\n+eal_log_save_pattern(const char *pattern, uint32_t level)\n {\n-\treturn rte_log_save_level(priority, NULL, pattern);\n+\treturn log_save_level(level, NULL, pattern);\n }\n \n /* get the current loglevel for the message being processed */\n@@ -250,7 +252,7 @@ int rte_log_cur_msg_logtype(void)\n }\n \n static int\n-rte_log_lookup(const char *name)\n+log_lookup(const char *name)\n {\n \tsize_t i;\n \n@@ -268,7 +270,7 @@ rte_log_lookup(const char *name)\n  * is not yet registered.\n  */\n static int\n-__rte_log_register(const char *name, int id)\n+log_register(const char *name, int id)\n {\n \tchar *dup_name = strdup(name);\n \n@@ -288,7 +290,7 @@ rte_log_register(const char *name)\n \tstruct rte_log_dynamic_type *new_dynamic_types;\n \tint id, ret;\n \n-\tid = rte_log_lookup(name);\n+\tid = log_lookup(name);\n \tif (id >= 0)\n \t\treturn id;\n \n@@ -299,7 +301,7 @@ rte_log_register(const char *name)\n \t\treturn -ENOMEM;\n \trte_logs.dynamic_types = new_dynamic_types;\n \n-\tret = __rte_log_register(name, rte_logs.dynamic_types_len);\n+\tret = log_register(name, rte_logs.dynamic_types_len);\n \tif (ret < 0)\n \t\treturn ret;\n \n@@ -376,7 +378,7 @@ static const struct logtype logtype_strings[] = {\n };\n \n /* Logging should be first initializer (before drivers and bus) */\n-RTE_INIT_PRIO(rte_log_init, LOG)\n+RTE_INIT_PRIO(log_init, LOG)\n {\n \tuint32_t i;\n \n@@ -389,7 +391,7 @@ RTE_INIT_PRIO(rte_log_init, LOG)\n \n \t/* register legacy log types */\n \tfor (i = 0; i < RTE_DIM(logtype_strings); i++)\n-\t\t__rte_log_register(logtype_strings[i].logtype,\n+\t\tlog_register(logtype_strings[i].logtype,\n \t\t\t\tlogtype_strings[i].log_id);\n \n \trte_logs.dynamic_types_len = RTE_LOGTYPE_FIRST_EXT_ID;\ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex 622c7bc429..cd1a2856c9 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -41,6 +41,7 @@\n #include \"eal_options.h\"\n #include \"eal_filesystem.h\"\n #include \"eal_private.h\"\n+#include \"eal_log.h\"\n #ifndef RTE_EXEC_ENV_WINDOWS\n #include \"eal_trace.h\"\n #endif\n@@ -1299,7 +1300,7 @@ eal_parse_log_level(const char *arg)\n \t\t\t\tregex, priority);\n \t\t\tgoto fail;\n \t\t}\n-\t\tif (rte_log_save_regexp(regex, priority) < 0)\n+\t\tif (eal_log_save_regexp(regex, priority) < 0)\n \t\t\tgoto fail;\n \t} else if (pattern) {\n \t\tif (rte_log_set_level_pattern(pattern, priority) < 0) {\n@@ -1307,7 +1308,7 @@ eal_parse_log_level(const char *arg)\n \t\t\t\tpattern, priority);\n \t\t\tgoto fail;\n \t\t}\n-\t\tif (rte_log_save_pattern(pattern, priority) < 0)\n+\t\tif (eal_log_save_pattern(pattern, priority) < 0)\n \t\t\tgoto fail;\n \t} else {\n \t\trte_log_set_global_level(priority);\ndiff --git a/lib/librte_eal/common/eal_log.h b/lib/librte_eal/common/eal_log.h\nnew file mode 100644\nindex 0000000000..684650a17b\n--- /dev/null\n+++ b/lib/librte_eal/common/eal_log.h\n@@ -0,0 +1,27 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2021 Mellanox Technologies, Ltd\n+ */\n+\n+#ifndef EAL_LOG_H\n+#define EAL_LOG_H\n+\n+#include <stdio.h>\n+#include <stdint.h>\n+\n+/*\n+ * Initialize the default log stream.\n+ */\n+int eal_log_init(const char *id, int facility);\n+\n+/*\n+ * Determine where log data is written when no call to rte_openlog_stream.\n+ */\n+void eal_log_set_default(FILE *default_log);\n+\n+/*\n+ * Save a log option for later.\n+ */\n+int eal_log_save_regexp(const char *regexp, uint32_t level);\n+int eal_log_save_pattern(const char *pattern, uint32_t level);\n+\n+#endif /* EAL_LOG_H */\ndiff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h\nindex b8a0d20021..e3512111d9 100644\n--- a/lib/librte_eal/common/eal_private.h\n+++ b/lib/librte_eal/common/eal_private.h\n@@ -79,19 +79,6 @@ struct rte_config *rte_eal_get_configuration(void);\n  */\n int rte_eal_memzone_init(void);\n \n-/**\n- * Common log initialization function (private to eal).  Determines\n- * where log data is written when no call to rte_openlog_stream is\n- * in effect.\n- *\n- * @param default_log\n- *   The default log stream to be used.\n- * @return\n- *   - 0 on success\n- *   - Negative on error\n- */\n-void eal_log_set_default(FILE *default_log);\n-\n /**\n  * Fill configuration with number of physical and logical processors\n  *\n@@ -143,22 +130,6 @@ int rte_eal_memory_init(void);\n  */\n int rte_eal_timer_init(void);\n \n-/**\n- * Init the default log stream\n- *\n- * This function is private to EAL.\n- *\n- * @return\n- *   0 on success, negative on error\n- */\n-int rte_eal_log_init(const char *id, int facility);\n-\n-/**\n- * Save the log regexp for later\n- */\n-int rte_log_save_regexp(const char *type, int priority);\n-int rte_log_save_pattern(const char *pattern, int priority);\n-\n /**\n  * Init tail queues for non-EAL library structures. This is to allow\n  * the rings, mempools, etc. lists to be shared among multiple processes\ndiff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c\nindex abbb537746..ac27dd4274 100644\n--- a/lib/librte_eal/linux/eal.c\n+++ b/lib/librte_eal/linux/eal.c\n@@ -58,6 +58,7 @@\n #include \"eal_hugepages.h\"\n #include \"eal_memcfg.h\"\n #include \"eal_trace.h\"\n+#include \"eal_log.h\"\n #include \"eal_options.h\"\n #include \"eal_vfio.h\"\n #include \"hotplug_mp.h\"\n@@ -1160,7 +1161,7 @@ rte_eal_init(int argc, char **argv)\n #endif\n \t}\n \n-\tif (rte_eal_log_init(logid, internal_conf->syslog_facility) < 0) {\n+\tif (eal_log_init(logid, internal_conf->syslog_facility) < 0) {\n \t\trte_eal_init_alert(\"Cannot init logging.\");\n \t\trte_errno = ENOMEM;\n \t\t__atomic_store_n(&run_once, 0, __ATOMIC_RELAXED);\ndiff --git a/lib/librte_eal/linux/eal_log.c b/lib/librte_eal/linux/eal_log.c\nindex 2095df74c5..c0aa1007c4 100644\n--- a/lib/librte_eal/linux/eal_log.c\n+++ b/lib/librte_eal/linux/eal_log.c\n@@ -17,7 +17,7 @@\n #include <rte_spinlock.h>\n #include <rte_log.h>\n \n-#include \"eal_private.h\"\n+#include \"eal_log.h\"\n \n /*\n  * default log function\n@@ -46,7 +46,7 @@ static cookie_io_functions_t console_log_func = {\n  * once memzones are available.\n  */\n int\n-rte_eal_log_init(const char *id, int facility)\n+eal_log_init(const char *id, int facility)\n {\n \tFILE *log_stream;\n \ndiff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c\nindex 2fc3d6141c..68a1fd1d21 100644\n--- a/lib/librte_eal/windows/eal.c\n+++ b/lib/librte_eal/windows/eal.c\n@@ -22,6 +22,7 @@\n \n #include \"eal_hugepages.h\"\n #include \"eal_trace.h\"\n+#include \"eal_log.h\"\n #include \"eal_windows.h\"\n \n #define MEMSIZE_IF_NO_HUGE_PAGE (64ULL * 1024ULL * 1024ULL)\n@@ -267,7 +268,7 @@ rte_eal_init(int argc, char **argv)\n \t\teal_get_internal_configuration();\n \tint ret;\n \n-\trte_eal_log_init(NULL, 0);\n+\teal_log_init(NULL, 0);\n \n \teal_log_level_parse(argc, argv);\n \ndiff --git a/lib/librte_eal/windows/eal_log.c b/lib/librte_eal/windows/eal_log.c\nindex 875981f139..d4ea47f1c8 100644\n--- a/lib/librte_eal/windows/eal_log.c\n+++ b/lib/librte_eal/windows/eal_log.c\n@@ -2,11 +2,13 @@\n  * Copyright(c) 2017-2018 Intel Corporation\n  */\n \n-#include \"eal_private.h\"\n+#include <rte_common.h>\n+#include <rte_log.h>\n+#include \"eal_log.h\"\n \n /* set the log to default function, called during eal init process. */\n int\n-rte_eal_log_init(__rte_unused const char *id, __rte_unused int facility)\n+eal_log_init(__rte_unused const char *id, __rte_unused int facility)\n {\n \trte_openlog_stream(stderr);\n \n",
    "prefixes": [
        "v7",
        "1/4"
    ]
}