Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/56530/?format=api
https://patches.dpdk.org/api/patches/56530/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190716172741.21399-3-stephen@networkplumber.org/", "project": { "id": 1, "url": "https://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": "<20190716172741.21399-3-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20190716172741.21399-3-stephen@networkplumber.org", "date": "2019-07-16T17:27:40", "name": "[2/3] cfgfile: use RTE_LOG for errors", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "7b1a662f8cade80c52c84c42f1ff4d9945c91df5", "submitter": { "id": 27, "url": "https://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190716172741.21399-3-stephen@networkplumber.org/mbox/", "series": [ { "id": 5538, "url": "https://patches.dpdk.org/api/series/5538/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5538", "date": "2019-07-16T17:27:38", "name": "cfgfile: cleanup patches", "version": 1, "mbox": "https://patches.dpdk.org/series/5538/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/56530/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/56530/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 446C91B974;\n\tTue, 16 Jul 2019 19:27:58 +0200 (CEST)", "from mail-pl1-f196.google.com (mail-pl1-f196.google.com\n\t[209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 9132A4C94\n\tfor <dev@dpdk.org>; Tue, 16 Jul 2019 19:27:53 +0200 (CEST)", "by mail-pl1-f196.google.com with SMTP id y8so10446615plr.12\n\tfor <dev@dpdk.org>; Tue, 16 Jul 2019 10:27:53 -0700 (PDT)", "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\tm6sm21173049pfb.151.2019.07.16.10.27.51\n\t(version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);\n\tTue, 16 Jul 2019 10:27:51 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=2c5t78v8D8ioyCie5DWBG4mA3csgd1We6ZXYiFQAgqY=;\n\tb=BJTk3WE+kAwAuV8/mXdaOQi7/n/CjbPmq+ynFxeBSxF7RbD2hM2FaGTlrVO2cVwjUz\n\tZD5yxdMequrNSH+x0KYsJWa+pg2e6GmLQSe34q6bhgK0nkkNaGtVsOBD+atf1EOaqpL7\n\tuuuu3Fnpmq4mlFwmYrLErKHB6hTjDiv4D2cRmzKdFRHXQJsYraheNv/j4rLEWWQEaOxI\n\tvnFZbZdNWl+Ob+nDzQBNtWcmebWxBDkVWk5r1lqVlw+kUoT5hWyrxR+e/1E5Vq05rbQg\n\tt9hKvO6i5IeZ6O812gBrar5+hv6idebgbI0WA7ogSTWeh5qMJeX7zOwhHrNxCk7h8mLf\n\t4SBA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=2c5t78v8D8ioyCie5DWBG4mA3csgd1We6ZXYiFQAgqY=;\n\tb=dRiE73NN3Zy5vFjLic6XQhxaXbfsqSogl/RJmRedntYFcuDkP01g3OANtjqCD6JX0z\n\to13ZZGMQWhA5+wvyWzQz4NcT9SVfpVm/zZvFnDbLHN9cjtog5w5Fg0Mr8OhbF217a+EN\n\tZBI/5HaWTl0mam3HW2TFZsKbIywMrmEW/yjzAmfi3dcf3HJAJO7CORyy5jPQKCtlFYJW\n\tf7IM8TuyIgBM5gFyVfQlGnBXByqmnWUdYCo3xLhn1X9t8t8khPXYVV4V/gUN2fJg6Lox\n\tk+s/gtgNI6SNnhQ2wj784BRpvLn7McRvqfyGjzdGUcBuJrLUXu2P0itPnkKKJaimlpH/\n\tcwQA==", "X-Gm-Message-State": "APjAAAUf226KsyvaXrb1OmiRBhEdq4V+GaSvsB5nf0qBEOKkjMH3qd4C\n\tNF6THyoXd8HB9exos+UAPaK4iPm4", "X-Google-Smtp-Source": "APXvYqykRQajITfrHl7fJ7Zu+oM4995jrMySe8GJFI33C3+KUBj3PTGtBZhROQqYeNxCOA4XTci/Sw==", "X-Received": "by 2002:a17:902:76c7:: with SMTP id\n\tj7mr35876209plt.247.1563298072620; \n\tTue, 16 Jul 2019 10:27:52 -0700 (PDT)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "cristian.dumitrescu@intel.com", "Cc": "dev@dpdk.org,\n\tStephen Hemminger <stephen@networkplumber.org>", "Date": "Tue, 16 Jul 2019 10:27:40 -0700", "Message-Id": "<20190716172741.21399-3-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190716172741.21399-1-stephen@networkplumber.org>", "References": "<20190716172741.21399-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH 2/3] cfgfile: use RTE_LOG for errors", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "In general, DPDK libraries to not print error messages to\nstdout because that is often redirected to /dev/null for daemons.\nThis patch changes cfgfile library to use RTE_LOG with its\nown type.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n lib/librte_cfgfile/rte_cfgfile.c | 25 +++++++++++++++----------\n lib/librte_eal/common/include/rte_log.h | 1 +\n 2 files changed, 16 insertions(+), 10 deletions(-)", "diff": "diff --git a/lib/librte_cfgfile/rte_cfgfile.c b/lib/librte_cfgfile/rte_cfgfile.c\nindex 1ef298592fa5..c4b768b6833f 100644\n--- a/lib/librte_cfgfile/rte_cfgfile.c\n+++ b/lib/librte_cfgfile/rte_cfgfile.c\n@@ -9,6 +9,7 @@\n #include <errno.h>\n #include <rte_string_fns.h>\n #include <rte_common.h>\n+#include <rte_log.h>\n \n #include \"rte_cfgfile.h\"\n \n@@ -128,7 +129,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params)\n \tunsigned int i;\n \n \tif (!params) {\n-\t\tprintf(\"Error - missing cfgfile parameters\\n\");\n+\t\tRTE_LOG(ERR, CFGFILE, \"missing cfgfile parameters\\n\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -141,7 +142,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params)\n \t}\n \n \tif (valid_comment == 0)\t{\n-\t\tprintf(\"Error - invalid comment characters %c\\n\",\n+\t\tRTE_LOG(ERR, CFGFILE, \"invalid comment characters %c\\n\",\n \t\t params->comment_character);\n \t\treturn -ENOTSUP;\n \t}\n@@ -178,7 +179,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags,\n \t\tsize_t len = strnlen(buffer, sizeof(buffer));\n \t\tlineno++;\n \t\tif ((len >= sizeof(buffer) - 1) && (buffer[len-1] != '\\n')) {\n-\t\t\tprintf(\"Error line %d - no \\\\n found on string. \"\n+\t\t\tRTE_LOG(ERR, CFGFILE, \" line %d - no \\\\n found on string. \"\n \t\t\t\t\t\"Check if line too long\\n\", lineno);\n \t\t\tgoto error1;\n \t\t}\n@@ -198,8 +199,9 @@ rte_cfgfile_load_with_params(const char *filename, int flags,\n \t\t\t/* section heading line */\n \t\t\tchar *end = memchr(buffer, ']', len);\n \t\t\tif (end == NULL) {\n-\t\t\t\tprintf(\"Error line %d - no terminating ']'\"\n-\t\t\t\t\t\"character found\\n\", lineno);\n+\t\t\t\tRTE_LOG(ERR, CFGFILE,\n+\t\t\t\t\t\"line %d - no terminating ']' character found\\n\",\n+\t\t\t\t\tlineno);\n \t\t\t\tgoto error1;\n \t\t\t}\n \t\t\t*end = '\\0';\n@@ -213,8 +215,9 @@ rte_cfgfile_load_with_params(const char *filename, int flags,\n \t\t\tsplit[0] = buffer;\n \t\t\tsplit[1] = memchr(buffer, '=', len);\n \t\t\tif (split[1] == NULL) {\n-\t\t\t\tprintf(\"Error line %d - no '='\"\n-\t\t\t\t\t\"character found\\n\", lineno);\n+\t\t\t\tRTE_LOG(ERR, CFGFILE,\n+\t\t\t\t\t\"line %d - no '=' character found\\n\",\n+\t\t\t\t\tlineno);\n \t\t\t\tgoto error1;\n \t\t\t}\n \t\t\t*split[1] = '\\0';\n@@ -236,8 +239,9 @@ rte_cfgfile_load_with_params(const char *filename, int flags,\n \n \t\t\tif (!(flags & CFG_FLAG_EMPTY_VALUES) &&\n \t\t\t\t\t(*split[1] == '\\0')) {\n-\t\t\t\tprintf(\"Error at line %d - cannot use empty \"\n-\t\t\t\t\t\t\t\"values\\n\", lineno);\n+\t\t\t\tRTE_LOG(ERR, CFGFILE,\n+\t\t\t\t\t\"line %d - cannot use empty values\\n\",\n+\t\t\t\t\tlineno);\n \t\t\t\tgoto error1;\n \t\t\t}\n \n@@ -397,7 +401,8 @@ int rte_cfgfile_set_entry(struct rte_cfgfile *cfg, const char *sectionname,\n \t\t\t\tsizeof(curr_section->entries[i].value));\n \t\t\treturn 0;\n \t\t}\n-\tprintf(\"Error - entry name doesn't exist\\n\");\n+\n+\tRTE_LOG(ERR, CFGFILE, \"entry name doesn't exist\\n\");\n \treturn -EINVAL;\n }\n \ndiff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h\nindex cbb41846aaa3..fa747d5b90ef 100644\n--- a/lib/librte_eal/common/include/rte_log.h\n+++ b/lib/librte_eal/common/include/rte_log.h\n@@ -62,6 +62,7 @@ extern struct rte_logs rte_logs;\n #define RTE_LOGTYPE_EFD 18 /**< Log related to EFD. */\n #define RTE_LOGTYPE_EVENTDEV 19 /**< Log related to eventdev. */\n #define RTE_LOGTYPE_GSO 20 /**< Log related to GSO. */\n+#define RTE_LOGTYPE_CFGFILE 21 /**< Log related to cfgfile. */\n \n /* these log types can be used in an application */\n #define RTE_LOGTYPE_USER1 24 /**< User-defined log type 1. */\n", "prefixes": [ "2/3" ] }{ "id": 56530, "url": "