Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1125/?format=api
http://patches.dpdk.org/api/patches/1125/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1415137233-6364-1-git-send-email-thomas.monjalon@6wind.com/", "project": { "id": 1, "url": "http://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": "<1415137233-6364-1-git-send-email-thomas.monjalon@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1415137233-6364-1-git-send-email-thomas.monjalon@6wind.com", "date": "2014-11-04T21:40:33", "name": "[dpdk-dev,v2] eal: add option --master-lcore", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "5d0e711767fbb394032e30346fc2af4ec2cfef52", "submitter": { "id": 1, "url": "http://patches.dpdk.org/api/people/1/?format=api", "name": "Thomas Monjalon", "email": "thomas.monjalon@6wind.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1415137233-6364-1-git-send-email-thomas.monjalon@6wind.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/1125/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/1125/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 E66327E97;\n\tTue, 4 Nov 2014 22:31:53 +0100 (CET)", "from mail-wg0-f50.google.com (mail-wg0-f50.google.com\n\t[74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 1246F7E92\n\tfor <dev@dpdk.org>; Tue, 4 Nov 2014 22:31:52 +0100 (CET)", "by mail-wg0-f50.google.com with SMTP id z12so14530005wgg.37\n\tfor <dev@dpdk.org>; Tue, 04 Nov 2014 13:41:12 -0800 (PST)", "from XPS13.localdomain (guy78-1-82-235-116-147.fbx.proxad.net.\n\t[82.235.116.147]) by mx.google.com with ESMTPSA id\n\tq10sm1864037wjq.35.2014.11.04.13.41.10 for <multiple recipients>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tTue, 04 Nov 2014 13:41:11 -0800 (PST)" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=Z4AVnFKi1eVN5as38LoAq9dQH9ZjtTFzZG8kHONYQRo=;\n\tb=TNEw+uiWq7j9FUrdNRAs9YW2Npgeb25EoXIih3GRSxbLZzwHQQbG8B+Hwru34u+Qs9\n\tiJYm2AzP7VOh/6zarFNTXZeyzzXB/oROIu13MytkQaCkgDgoG8f8A3soycqi1FdI0EWM\n\tAj39koOYdltSImqyxLN0mw/92/gwASjgpqjUQ4H8R8jx9A6wWWyO0IZjjs9MlJgByMw6\n\tKOOB3bh0ixB38mLiZNRRLfEjMzy7e5Cu3nTHJRO8vtpbB1Bl5NJfkEalcumqClK/GBp8\n\tx8TGYiIwZBklAOw8gE6k8BQNGasuTKqT3y0DpmU/3nqAyaYx3pNGdAWhomx+zJPaSuQZ\n\tX5bQ==", "X-Gm-Message-State": "ALoCoQn7KgXW45KxBChQruIvu4eWUcxXF9uDaU0Lq9sIFNuHd7enwoW6FKR7fS0N+2k7pCIChaW7", "X-Received": "by 10.194.60.198 with SMTP id j6mr59948987wjr.30.1415137272033; \n\tTue, 04 Nov 2014 13:41:12 -0800 (PST)", "From": "Thomas Monjalon <thomas.monjalon@6wind.com>", "To": "dev@dpdk.org", "Date": "Tue, 4 Nov 2014 22:40:33 +0100", "Message-Id": "<1415137233-6364-1-git-send-email-thomas.monjalon@6wind.com>", "X-Mailer": "git-send-email 2.1.3", "In-Reply-To": "<1404808110-16314-1-git-send-email-simon.kuenzer@neclab.eu>", "References": "<1404808110-16314-1-git-send-email-simon.kuenzer@neclab.eu>", "Subject": "[dpdk-dev] [PATCH v2] eal: add option --master-lcore", "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: Simon Kuenzer <simon.kuenzer@neclab.eu>\n\nEnable users to specify the lcore id that is used as master lcore.\n\nSigned-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu>\nSigned-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>\n---\n\nchanges in v2:\n- rebase on HEAD including common options for BSD and Linux\n- use strtol() instead of atoi() to check syntax errors\n- unit tests\n\n app/test/test.c | 1 +\n app/test/test_eal_flags.c | 49 +++++++++++++++++++++++++++++\n lib/librte_eal/bsdapp/eal/eal.c | 7 +++++\n lib/librte_eal/common/eal_common_options.c | 31 ++++++++++++++++++\n lib/librte_eal/common/include/eal_options.h | 2 ++\n lib/librte_eal/linuxapp/eal/eal.c | 7 +++++\n 6 files changed, 97 insertions(+)", "diff": "diff --git a/app/test/test.c b/app/test/test.c\nindex 9bee6bb..2fecff5 100644\n--- a/app/test/test.c\n+++ b/app/test/test.c\n@@ -82,6 +82,7 @@ do_recursive_call(void)\n \t} actions[] = {\n \t\t\t{ \"run_secondary_instances\", test_mp_secondary },\n \t\t\t{ \"test_missing_c_flag\", no_action },\n+\t\t\t{ \"test_master_lcore_flag\", no_action },\n \t\t\t{ \"test_missing_n_flag\", no_action },\n \t\t\t{ \"test_no_hpet_flag\", no_action },\n \t\t\t{ \"test_whitelist_flag\", no_action },\ndiff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c\nindex 21e6cca..45020b8 100644\n--- a/app/test/test_eal_flags.c\n+++ b/app/test/test_eal_flags.c\n@@ -520,6 +520,49 @@ test_missing_c_flag(void)\n }\n \n /*\n+ * Test --master-lcore option with matching coremask\n+ */\n+static int\n+test_master_lcore_flag(void)\n+{\n+#ifdef RTE_EXEC_ENV_BSDAPP\n+\t/* BSD target doesn't support prefixes at this point */\n+\tconst char * prefix = \"\";\n+#else\n+\tchar prefix[PATH_MAX], tmp[PATH_MAX];\n+\tif (get_current_prefix(tmp, sizeof(tmp)) == NULL) {\n+\t\tprintf(\"Error - unable to get current prefix!\\n\");\n+\t\treturn -1;\n+\t}\n+\tsnprintf(prefix, sizeof(prefix), \"--file-prefix=%s\", tmp);\n+#endif\n+\n+\t/* --master-lcore flag but no value */\n+\tconst char *argv1[] = { prgname, prefix, mp_flag, \"-n\", \"1\", \"-c\", \"3\", \"--master-lcore\"};\n+\t/* --master-lcore flag with invalid value */\n+\tconst char *argv2[] = { prgname, prefix, mp_flag, \"-n\", \"1\", \"-c\", \"3\", \"--master-lcore\", \"-1\"};\n+\t/* --master-lcore flag with invalid value */\n+\tconst char *argv3[] = { prgname, prefix, mp_flag, \"-n\", \"1\", \"-c\", \"3\", \"--master-lcore\", \"X\"};\n+\t/* master lcore not in coremask */\n+\tconst char *argv4[] = { prgname, prefix, mp_flag, \"-n\", \"1\", \"-c\", \"3\", \"--master-lcore\", \"2\"};\n+\t/* valid value */\n+\tconst char *argv5[] = { prgname, prefix, mp_flag, \"-n\", \"1\", \"-c\", \"3\", \"--master-lcore\", \"1\"};\n+\n+\tif (launch_proc(argv1) == 0\n+\t\t\t|| launch_proc(argv2) == 0\n+\t\t\t|| launch_proc(argv3) == 0\n+\t\t\t|| launch_proc(argv4) == 0) {\n+\t\tprintf(\"Error - process ran without error with wrong --master-lcore\\n\");\n+\t\treturn -1;\n+\t}\n+\tif (launch_proc(argv5) != 0) {\n+\t\tprintf(\"Error - process did not run ok with valid --master-lcore\\n\");\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n+/*\n * Test that the app doesn't run without the -n flag. In all cases\n * should give an error and fail to run.\n * Since -n is not compulsory for MP, we instead use --no-huge and --no-shconf\n@@ -1214,6 +1257,12 @@ test_eal_flags(void)\n \t\treturn ret;\n \t}\n \n+\tret = test_master_lcore_flag();\n+\tif (ret < 0) {\n+\t\tprintf(\"Error in test_master_lcore_flag()\\n\");\n+\t\treturn ret;\n+\t}\n+\n \tret = test_missing_n_flag();\n \tif (ret < 0) {\n \t\tprintf(\"Error in test_missing_n_flag()\\n\");\ndiff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c\nindex ca99cb9..c764fec 100644\n--- a/lib/librte_eal/bsdapp/eal/eal.c\n+++ b/lib/librte_eal/bsdapp/eal/eal.c\n@@ -354,6 +354,13 @@ eal_parse_args(int argc, char **argv)\n \t\tif (opt == '?')\n \t\t\treturn -1;\n \n+\t\tif (opt == OPT_MASTER_LCORE_NUM && !coremask_ok) {\n+\t\t\tRTE_LOG(ERR, EAL, \"please specify the master lcore id\"\n+\t\t\t\t\"after specifying the coremask\\n\");\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) {\ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex 7a5d55e..9166ea1 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -64,6 +64,7 @@ eal_short_options[] =\n const struct option\n eal_long_options[] = {\n \t{OPT_HUGE_DIR, 1, 0, OPT_HUGE_DIR_NUM},\n+\t{OPT_MASTER_LCORE, 1, 0, OPT_MASTER_LCORE_NUM},\n \t{OPT_PROC_TYPE, 1, 0, OPT_PROC_TYPE_NUM},\n \t{OPT_NO_SHCONF, 0, 0, OPT_NO_SHCONF_NUM},\n \t{OPT_NO_HPET, 0, 0, OPT_NO_HPET_NUM},\n@@ -163,6 +164,27 @@ eal_parse_coremask(const char *coremask)\n \treturn 0;\n }\n \n+/* Changes the lcore id of the master thread */\n+static int\n+eal_parse_master_lcore(const char *arg)\n+{\n+\tlong master_lcore;\n+\tchar *parsing_end;\n+\tstruct rte_config *cfg = rte_eal_get_configuration();\n+\n+\terrno = 0;\n+\tmaster_lcore = strtol(arg, &parsing_end, 0);\n+\tif (errno || parsing_end == arg)\n+\t\treturn -1;\n+\n+\tif (!(master_lcore >= 0 && master_lcore < RTE_MAX_LCORE))\n+\t\treturn -1;\n+\tif (cfg->lcore_role[master_lcore] != ROLE_RTE)\n+\t\treturn -1;\n+\tcfg->master_lcore = master_lcore;\n+\treturn 0;\n+}\n+\n static int\n eal_parse_syslog(const char *facility, struct internal_config *conf)\n {\n@@ -320,6 +342,14 @@ eal_parse_common_option(int opt, const char *optarg,\n \t\tconf->process_type = eal_parse_proc_type(optarg);\n \t\tbreak;\n \n+\tcase OPT_MASTER_LCORE_NUM:\n+\t\tif (eal_parse_master_lcore(optarg) < 0) {\n+\t\t\tRTE_LOG(ERR, EAL, \"invalid parameter for --\"\n+\t\t\t\t\tOPT_MASTER_LCORE \"\\n\");\n+\t\t\treturn -1;\n+\t\t}\n+\t\tbreak;\n+\n \tcase OPT_VDEV_NUM:\n \t\tif (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL,\n \t\t\t\toptarg) < 0) {\n@@ -364,6 +394,7 @@ eal_common_usage(void)\n \t \"[--proc-type primary|secondary|auto]\\n\\n\"\n \t \"EAL common options:\\n\"\n \t \" -c COREMASK : A hexadecimal bitmask of cores to run on\\n\"\n+\t \" --\"OPT_MASTER_LCORE\" ID: Core ID that is used as master\\n\"\n \t \" -n NUM : Number of memory channels\\n\"\n \t \" -v : Display version information on startup\\n\"\n \t \" -m MB : memory to allocate (see also --\"OPT_SOCKET_MEM\")\\n\"\ndiff --git a/lib/librte_eal/common/include/eal_options.h b/lib/librte_eal/common/include/eal_options.h\nindex 22819ec..deb872d 100644\n--- a/lib/librte_eal/common/include/eal_options.h\n+++ b/lib/librte_eal/common/include/eal_options.h\n@@ -43,6 +43,8 @@ enum {\n \tOPT_LONG_MIN_NUM = 256,\n #define OPT_HUGE_DIR \"huge-dir\"\n \tOPT_HUGE_DIR_NUM = OPT_LONG_MIN_NUM,\n+#define OPT_MASTER_LCORE \"master-lcore\"\n+\tOPT_MASTER_LCORE_NUM,\n #define OPT_PROC_TYPE \"proc-type\"\n \tOPT_PROC_TYPE_NUM,\n #define OPT_NO_SHCONF \"no-shconf\"\ndiff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c\nindex 7a1d087..7fcb349 100644\n--- a/lib/librte_eal/linuxapp/eal/eal.c\n+++ b/lib/librte_eal/linuxapp/eal/eal.c\n@@ -550,6 +550,13 @@ eal_parse_args(int argc, char **argv)\n \t\tif (opt == '?')\n \t\t\treturn -1;\n \n+\t\tif (opt == OPT_MASTER_LCORE_NUM && !coremask_ok) {\n+\t\t\tRTE_LOG(ERR, EAL, \"please specify the master lcore id\"\n+\t\t\t\t\"after specifying the coremask\\n\");\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", "prefixes": [ "dpdk-dev", "v2" ] }{ "id": 1125, "url": "