Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/7199/?format=api
https://patches.dpdk.org/api/patches/7199/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1443220392-13434-7-git-send-email-roy.fan.zhang@intel.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": "<1443220392-13434-7-git-send-email-roy.fan.zhang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1443220392-13434-7-git-send-email-roy.fan.zhang@intel.com", "date": "2015-09-25T22:33:10", "name": "[dpdk-dev,6/8] example/ip_pipeline: add parse_hex_string for internal use", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "b83e760497d06d228049726d4ff3588fadd4fa4f", "submitter": { "id": 304, "url": "https://patches.dpdk.org/api/people/304/?format=api", "name": "Fan Zhang", "email": "roy.fan.zhang@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1443220392-13434-7-git-send-email-roy.fan.zhang@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/7199/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/7199/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 0722E8D96;\n\tSat, 26 Sep 2015 00:34:10 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 8D38A8D93\n\tfor <dev@dpdk.org>; Sat, 26 Sep 2015 00:34:08 +0200 (CEST)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga102.jf.intel.com with ESMTP; 25 Sep 2015 15:34:09 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga001.fm.intel.com with ESMTP; 25 Sep 2015 15:33:17 -0700", "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\n\t[10.237.217.46])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tt8PMXFqt015218; Fri, 25 Sep 2015 23:33:16 +0100", "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev02.ir.intel.com with ESMTP id t8PMXFJs013697;\n\tFri, 25 Sep 2015 23:33:15 +0100", "(from fanzhan2@localhost)\n\tby sivswdev02.ir.intel.com with id t8PMXFIa013693;\n\tFri, 25 Sep 2015 23:33:15 +0100" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.17,589,1437462000\"; d=\"scan'208\";a=\"797527823\"", "From": "roy.fan.zhang@intel.com", "To": "dev@dpdk.org", "Date": "Fri, 25 Sep 2015 23:33:10 +0100", "Message-Id": "<1443220392-13434-7-git-send-email-roy.fan.zhang@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1443220392-13434-1-git-send-email-roy.fan.zhang@intel.com>", "References": "<1443220392-13434-1-git-send-email-roy.fan.zhang@intel.com>", "Subject": "[dpdk-dev] [PATCH 6/8] example/ip_pipeline: add parse_hex_string\n\tfor internal use", "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: Fan Zhang <roy.fan.zhang@intel.com>\n\nThis patch adds parse_hex_string function to parse hex string to uint8_t\narray.\n\nSigned-off-by: Fan Zhang <roy.fan.zhang@intel.com>\n---\n examples/ip_pipeline/config_parse.c | 70 +++++++++++++++++++++++++++++++++++++\n examples/ip_pipeline/pipeline.h | 4 +++\n 2 files changed, 74 insertions(+)", "diff": "diff --git a/examples/ip_pipeline/config_parse.c b/examples/ip_pipeline/config_parse.c\nindex c9b78f9..d7ee707 100644\n--- a/examples/ip_pipeline/config_parse.c\n+++ b/examples/ip_pipeline/config_parse.c\n@@ -455,6 +455,76 @@ parse_pipeline_core(uint32_t *socket,\n \treturn 0;\n }\n \n+static uint32_t\n+get_hex_val(char c)\n+{\n+\tswitch (c) {\n+\tcase '0':\n+\tcase '1':\n+\tcase '2':\n+\tcase '3':\n+\tcase '4':\n+\tcase '5':\n+\tcase '6':\n+\tcase '7':\n+\tcase '8':\n+\tcase '9':\n+\t\treturn c - '0';\n+\tcase 'A':\n+\tcase 'B':\n+\tcase 'C':\n+\tcase 'D':\n+\tcase 'E':\n+\tcase 'F':\n+\t\treturn c - 'A' + 10;\n+\tcase 'a':\n+\tcase 'b':\n+\tcase 'c':\n+\tcase 'd':\n+\tcase 'e':\n+\tcase 'f':\n+\t\treturn c - 'a' + 10;\n+\tdefault:\n+\t\treturn 0;\n+\t}\n+}\n+\n+int\n+parse_hex_string(char *src, uint8_t *dst, uint32_t *size)\n+{\n+\tchar *c;\n+\tuint32_t len, i;\n+\n+\t/* Check input parameters */\n+\tif ((src == NULL) ||\n+\t\t(dst == NULL) ||\n+\t\t(size == NULL) ||\n+\t\t(*size == 0))\n+\t\treturn -1;\n+\n+\tlen = strlen(src);\n+\tif (((len & 3) != 0) ||\n+\t\t(len > (*size) * 2))\n+\t\treturn -1;\n+\t*size = len / 2;\n+\n+\tfor (c = src; *c != 0; c++) {\n+\t\tif ((((*c) >= '0') && ((*c) <= '9')) ||\n+\t\t\t(((*c) >= 'A') && ((*c) <= 'F')) ||\n+\t\t\t(((*c) >= 'a') && ((*c) <= 'f')))\n+\t\t\tcontinue;\n+\n+\t\treturn -1;\n+\t}\n+\n+\t/* Convert chars to bytes */\n+\tfor (i = 0; i < *size; i++)\n+\t\tdst[i] = get_hex_val(src[2 * i]) * 16 +\n+\t\t\tget_hex_val(src[2 * i + 1]);\n+\n+\treturn 0;\n+}\n+\n static size_t\n skip_digits(const char *src)\n {\ndiff --git a/examples/ip_pipeline/pipeline.h b/examples/ip_pipeline/pipeline.h\nindex b9a56ea..4063594 100644\n--- a/examples/ip_pipeline/pipeline.h\n+++ b/examples/ip_pipeline/pipeline.h\n@@ -84,4 +84,8 @@ pipeline_type_cmds_count(struct pipeline_type *ptype)\n \treturn n_cmds;\n }\n \n+/* Parse hex string to uint8_t array */\n+int\n+parse_hex_string(char *src, uint8_t *dst, uint32_t *size);\n+\n #endif\n", "prefixes": [ "dpdk-dev", "6/8" ] }{ "id": 7199, "url": "