Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/61690/?format=api
https://patches.dpdk.org/api/patches/61690/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20191022200227.1920-10-pallavi.kadam@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": "<20191022200227.1920-10-pallavi.kadam@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20191022200227.1920-10-pallavi.kadam@intel.com", "date": "2019-10-22T20:02:27", "name": "[v3,9/9] eal: add minimum viable code to support parsing", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "8defe275f97d25326555d479513a86efb1ebac6c", "submitter": { "id": 1177, "url": "https://patches.dpdk.org/api/people/1177/?format=api", "name": "Kadam, Pallavi", "email": "pallavi.kadam@intel.com" }, "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/20191022200227.1920-10-pallavi.kadam@intel.com/mbox/", "series": [ { "id": 6994, "url": "https://patches.dpdk.org/api/series/6994/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6994", "date": "2019-10-22T20:02:18", "name": "Windows patchset with additional EAL functionalities", "version": 3, "mbox": "https://patches.dpdk.org/series/6994/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/61690/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/61690/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 51B631BF8C;\n\tTue, 22 Oct 2019 22:28:38 +0200 (CEST)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 61BCD1BEDC\n\tfor <dev@dpdk.org>; Tue, 22 Oct 2019 22:28:13 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t22 Oct 2019 13:28:13 -0700", "from win-dpdk-pallavi.jf.intel.com (HELO localhost.localdomain)\n\t([10.166.188.58])\n\tby fmsmga005.fm.intel.com with ESMTP; 22 Oct 2019 13:28:12 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.68,217,1569308400\"; d=\"scan'208\";a=\"397813858\"", "From": "Pallavi Kadam <pallavi.kadam@intel.com>", "To": "dev@dpdk.org,\n\tthomas@monjalon.net,\n\tHarini.Ramakrishnan@microsoft.com", "Cc": "keith.wiles@intel.com, bruce.richardson@intel.com,\n\tdavid.marchand@redhat.com, jerinjacobk@gmail.com,\n\tranjit.menon@intel.com, \n\tantara.ganesh.kolar@intel.com, pallavi.kadam@intel.com", "Date": "Tue, 22 Oct 2019 13:02:27 -0700", "Message-Id": "<20191022200227.1920-10-pallavi.kadam@intel.com>", "X-Mailer": "git-send-email 2.18.0.windows.1", "In-Reply-To": "<20191022200227.1920-1-pallavi.kadam@intel.com>", "References": "<20190926202924.6876-1-pallavi.kadam@intel.com>\n\t<20191022200227.1920-1-pallavi.kadam@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 9/9] eal: add minimum viable code to support\n\tparsing", "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": "Adding specific logic for eal.c to support parsing on\nWindows.\n\nSigned-off-by: Pallavi Kadam <pallavi.kadam@intel.com>\nSigned-off-by: Antara Ganesh Kolar <antara.ganesh.kolar@intel.com>\nReviewed-by: Ranjit Menon <ranjit.menon@intel.com>\nReviewed-by: Keith Wiles <keith.wiles@intel.com>\n---\n lib/librte_eal/windows/eal/eal.c | 119 +++++++++++++++++++++++++++++--\n 1 file changed, 112 insertions(+), 7 deletions(-)", "diff": "diff --git a/lib/librte_eal/windows/eal/eal.c b/lib/librte_eal/windows/eal/eal.c\nindex ffe5b8552..8deb6c83a 100644\n--- a/lib/librte_eal/windows/eal/eal.c\n+++ b/lib/librte_eal/windows/eal/eal.c\n@@ -13,8 +13,12 @@\n #include <eal_thread.h>\n #include <eal_internal_cfg.h>\n #include <eal_filesystem.h>\n+#include <eal_options.h>\n #include <eal_private.h>\n \n+ /* Allow the application to print its usage message too if set */\n+static rte_usage_hook_t\trte_application_usage_hook;\n+\n /* define fd variable here, because file needs to be kept open for the\n * duration of the program, as we hold a write lock on it in the primary proc\n */\n@@ -73,21 +77,122 @@ enum rte_proc_type_t\n \treturn ptype;\n }\n \n+/* display usage */\n+static void\n+eal_usage(const char *prgname)\n+{\n+\tprintf(\"\\nUsage: %s \", prgname);\n+\teal_common_usage();\n+\t/* Allow the application to print its usage message too\n+\t *if hook is set\n+\t */\n+\tif (rte_application_usage_hook) {\n+\t\tprintf(\"===== Application Usage =====\\n\\n\");\n+\t\trte_application_usage_hook(prgname);\n+\t}\n+}\n+\n /* Parse the arguments for --log-level only */\n static void\n-eal_log_level_parse(__rte_unused int argc, __rte_unused char **argv)\n+eal_log_level_parse(int argc, char **argv)\n {\n-\t/* TODO */\n-\t/* This is a stub, not the expected result */\n+\tint opt;\n+\tchar **argvopt;\n+\tint option_index;\n+\n+\targvopt = argv;\n+\n+\teal_reset_internal_config(&internal_config);\n+\n+\twhile ((opt = getopt_long(argc, argvopt, eal_short_options,\n+\t\teal_long_options, &option_index)) != EOF) {\n+\n+\t\tint ret;\n+\n+\t\t/* getopt is not happy, stop right now */\n+\t\tif (opt == '?')\n+\t\t\tbreak;\n+\n+\t\tret = (opt == OPT_LOG_LEVEL_NUM) ?\n+\t\t\teal_parse_common_option(opt, optarg,\n+\t\t\t\t&internal_config) : 0;\n+\n+\t\t/* common parser is not happy */\n+\t\tif (ret < 0)\n+\t\t\tbreak;\n+\t}\n+\n+\toptind = 0; /* reset getopt lib */\n }\n \n /* Parse the argument given in the command line of the application */\n static int\n-eal_parse_args(__rte_unused int argc, __rte_unused char **argv)\n+eal_parse_args(int argc, char **argv)\n {\n-\t/* TODO */\n-\t/* This is a stub, not the expected result */\n-\treturn 0;\n+\tint opt, ret;\n+\tchar **argvopt;\n+\tint option_index;\n+\tchar *prgname = argv[0];\n+\n+\targvopt = argv;\n+\n+\twhile ((opt = getopt_long(argc, argvopt, eal_short_options,\n+\t\teal_long_options, &option_index)) != EOF) {\n+\n+\t\tint ret;\n+\n+\t\t/* getopt is not happy, stop right now */\n+\t\tif (opt == '?') {\n+\t\t\teal_usage(prgname);\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\tret = eal_parse_common_option(opt, optarg, &internal_config);\n+\t\t/* common parser is not happy */\n+\t\tif (ret < 0) {\n+\t\t\teal_usage(prgname);\n+\t\t\treturn -1;\n+\t\t}\n+\t\t/* common parser handled this option */\n+\t\tif (ret == 0)\n+\t\t\tcontinue;\n+\n+\t\tswitch (opt) {\n+\t\tcase 'h':\n+\t\t\teal_usage(prgname);\n+\t\t\texit(EXIT_SUCCESS);\n+\t\tdefault:\n+\t\t\tif (opt < OPT_LONG_MIN_NUM && isprint(opt)) {\n+\t\t\t\tRTE_LOG(ERR, EAL, \"Option %c is not supported \"\n+\t\t\t\t\t\"on Windows\\n\", opt);\n+\t\t\t} else if (opt >= OPT_LONG_MIN_NUM &&\n+\t\t\t\topt < OPT_LONG_MAX_NUM) {\n+\t\t\t\tRTE_LOG(ERR, EAL, \"Option %s is not supported \"\n+\t\t\t\t\t\"on Windows\\n\",\n+\t\t\t\t\teal_long_options[option_index].name);\n+\t\t\t} else {\n+\t\t\t\tRTE_LOG(ERR, EAL, \"Option %d is not supported \"\n+\t\t\t\t\t\"on Windows\\n\", opt);\n+\t\t\t}\n+\t\t\teal_usage(prgname);\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n+\tif (eal_adjust_config(&internal_config) != 0)\n+\t\treturn -1;\n+\n+\t/* sanity checks */\n+\tif (eal_check_common_options(&internal_config) != 0) {\n+\t\teal_usage(prgname);\n+\t\treturn -1;\n+\t}\n+\n+\tif (optind >= 0)\n+\t\targv[optind - 1] = prgname;\n+\tret = optind - 1;\n+\toptind = 0; /* reset getopt lib */\n+\treturn ret;\n }\n \n static int\n", "prefixes": [ "v3", "9/9" ] }{ "id": 61690, "url": "