Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2433/?format=api
https://patches.dpdk.org/api/patches/2433/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1421873870-21754-9-git-send-email-nhorman@tuxdriver.com/", "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": "<1421873870-21754-9-git-send-email-nhorman@tuxdriver.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1421873870-21754-9-git-send-email-nhorman@tuxdriver.com", "date": "2015-01-21T20:57:33", "name": "[dpdk-dev,v7,09/26] app/testpmd: remove duplicated function for list parsing", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": true, "hash": "4a6c917af3d7437003e2050c5f4117a361edd044", "submitter": { "id": 32, "url": "https://patches.dpdk.org/api/people/32/?format=api", "name": "Neil Horman", "email": "nhorman@tuxdriver.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1421873870-21754-9-git-send-email-nhorman@tuxdriver.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/2433/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/2433/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 25AB35ABC;\n\tWed, 21 Jan 2015 21:58:28 +0100 (CET)", "from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58])\n\tby dpdk.org (Postfix) with ESMTP id 6A2A25A9A\n\tfor <dev@dpdk.org>; Wed, 21 Jan 2015 21:58:24 +0100 (CET)", "from hmsreliant.think-freely.org\n\t([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost)\n\tby smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63)\n\t(envelope-from <nhorman@tuxdriver.com>)\n\tid 1YE2Ly-0007AD-Rq; Wed, 21 Jan 2015 15:58:22 -0500" ], "From": "Neil Horman <nhorman@tuxdriver.com>", "To": "dev@dpdk.org", "Date": "Wed, 21 Jan 2015 15:57:33 -0500", "Message-Id": "<1421873870-21754-9-git-send-email-nhorman@tuxdriver.com>", "X-Mailer": "git-send-email 2.1.0", "In-Reply-To": "<1421873870-21754-1-git-send-email-nhorman@tuxdriver.com>", "References": "<1419109299-9603-1-git-send-email-nhorman@tuxdriver.com>\n\t<1421873870-21754-1-git-send-email-nhorman@tuxdriver.com>", "X-Spam-Score": "-2.9 (--)", "X-Spam-Status": "No", "Subject": "[dpdk-dev] [PATCH v7 09/26] app/testpmd: remove duplicated function\n\tfor list parsing", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: Bruce Richardson <bruce.richardson@intel.com>\n\nThere were two static functions called \"parse_item_list\" in testpmd app.\nSince one was a superset of the functionality of the other, we can\ncollapse the two calls down into a single one, shared between the two\nC files.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nAcked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\n---\n app/test-pmd/cmdline.c | 2 +-\n app/test-pmd/parameters.c | 49 ++---------------------------------------------\n app/test-pmd/testpmd.h | 3 +++\n 3 files changed, 6 insertions(+), 48 deletions(-)", "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 882a5a2..4618b92 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -2224,7 +2224,7 @@ cmdline_parse_inst_t cmd_stop = {\n \n /* *** SET CORELIST and PORTLIST CONFIGURATION *** */\n \n-static unsigned int\n+unsigned int\n parse_item_list(char* str, const char* item_name, unsigned int max_items,\n \t\tunsigned int *parsed_items, int check_unique_values)\n {\ndiff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c\nindex fcb2c99..adf3203 100644\n--- a/app/test-pmd/parameters.c\n+++ b/app/test-pmd/parameters.c\n@@ -491,52 +491,6 @@ parse_ringnuma_config(const char *q_arg)\n \treturn 0;\n }\n \n-static unsigned int\n-parse_item_list(char* str, unsigned int max_items, unsigned int *parsed_items)\n-{\n-\tunsigned int nb_item;\n-\tunsigned int value;\n-\tunsigned int i;\n-\tint value_ok;\n-\tchar c;\n-\n-\t/*\n-\t * First parse all items in the list and store their value.\n-\t */\n-\tvalue = 0;\n-\tnb_item = 0;\n-\tvalue_ok = 0;\n-\tfor (i = 0; i < strlen(str); i++) {\n-\t\tc = str[i];\n-\t\tif ((c >= '0') && (c <= '9')) {\n-\t\t\tvalue = (unsigned int) (value * 10 + (c - '0'));\n-\t\t\tvalue_ok = 1;\n-\t\t\tcontinue;\n-\t\t}\n-\t\tif (c != ',') {\n-\t\t\tprintf(\"character %c is not a decimal digit\\n\", c);\n-\t\t\treturn (0);\n-\t\t}\n-\t\tif (! value_ok) {\n-\t\t\tprintf(\"No valid value before comma\\n\");\n-\t\t\treturn (0);\n-\t\t}\n-\t\tif (nb_item < max_items) {\n-\t\t\tparsed_items[nb_item] = value;\n-\t\t\tvalue_ok = 0;\n-\t\t\tvalue = 0;\n-\t\t}\n-\t\tnb_item++;\n-\t}\n-\n-\tif (nb_item >= max_items)\n-\t\trte_exit(EXIT_FAILURE, \"too many txpkt segments!\\n\");\n-\n-\tparsed_items[nb_item++] = value;\n-\n-\treturn (nb_item);\n-}\n-\n void\n launch_args_parse(int argc, char** argv)\n {\n@@ -1050,7 +1004,8 @@ launch_args_parse(int argc, char** argv)\n \t\t\t\tunsigned seg_lengths[RTE_MAX_SEGS_PER_PKT];\n \t\t\t\tunsigned int nb_segs;\n \n-\t\t\t\tnb_segs = parse_item_list(optarg, RTE_MAX_SEGS_PER_PKT, seg_lengths);\n+\t\t\t\tnb_segs = parse_item_list(optarg, \"txpkt segments\",\n+\t\t\t\t\t\tRTE_MAX_SEGS_PER_PKT, seg_lengths, 0);\n \t\t\t\tif (nb_segs > 0)\n \t\t\t\t\tset_tx_pkt_segments(seg_lengths, nb_segs);\n \t\t\t\telse\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex f8b0740..8f5e6c7 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -446,6 +446,9 @@ port_pci_reg_write(struct rte_port *port, uint32_t reg_off, uint32_t reg_v)\n \tport_pci_reg_write(&ports[(pt_id)], (reg_off), (reg_value))\n \n /* Prototypes */\n+unsigned int parse_item_list(char* str, const char* item_name,\n+\t\t\tunsigned int max_items,\n+\t\t\tunsigned int *parsed_items, int check_unique_values);\n void launch_args_parse(int argc, char** argv);\n void prompt(void);\n void nic_stats_display(portid_t port_id);\n", "prefixes": [ "dpdk-dev", "v7", "09/26" ] }{ "id": 2433, "url": "