Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/35162/?format=api
http://patches.dpdk.org/api/patches/35162/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1518580892-32656-4-git-send-email-jianfeng.tan@intel.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": "<1518580892-32656-4-git-send-email-jianfeng.tan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1518580892-32656-4-git-send-email-jianfeng.tan@intel.com", "date": "2018-02-14T04:01:31", "name": "[dpdk-dev,3/4] app/testpmd: add option to avoid lock all memory", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "45e75dec88fcedc9d112d504e732e1a550ecb78b", "submitter": { "id": 313, "url": "http://patches.dpdk.org/api/people/313/?format=api", "name": "Jianfeng Tan", "email": "jianfeng.tan@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1518580892-32656-4-git-send-email-jianfeng.tan@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/35162/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/35162/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 987891B312;\n\tWed, 14 Feb 2018 04:59:53 +0100 (CET)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id 5420C1B2F7\n\tfor <dev@dpdk.org>; Wed, 14 Feb 2018 04:59:49 +0100 (CET)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Feb 2018 19:59:49 -0800", "from dpdk06.sh.intel.com ([10.67.110.196])\n\tby orsmga002.jf.intel.com with ESMTP; 13 Feb 2018 19:59:48 -0800" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.46,510,1511856000\"; d=\"scan'208\";a=\"34520065\"", "From": "Jianfeng Tan <jianfeng.tan@intel.com>", "To": "dev@dpdk.org", "Cc": "Jianfeng Tan <jianfeng.tan@intel.com>, wenzhuo.lu@intel.com,\n\tjingjing.wu@intel.com", "Date": "Wed, 14 Feb 2018 04:01:31 +0000", "Message-Id": "<1518580892-32656-4-git-send-email-jianfeng.tan@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1518580892-32656-1-git-send-email-jianfeng.tan@intel.com>", "References": "<1518580892-32656-1-git-send-email-jianfeng.tan@intel.com>", "Subject": "[dpdk-dev] [PATCH 3/4] app/testpmd: add option to avoid lock all\n\tmemory", "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://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": "<https://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": "In some cases, we don't want to lock all memory.\n\nAdd an option --no-mlockall to avoid lock all memory.\n\nCc: wenzhuo.lu@intel.com\nCc: jingjing.wu@intel.com\n\nSigned-off-by: Jianfeng Tan <jianfeng.tan@intel.com>\n---\n app/test-pmd/parameters.c | 5 ++++-\n app/test-pmd/testpmd.c | 32 ++++++++++++++++++--------------\n app/test-pmd/testpmd.h | 1 +\n 3 files changed, 23 insertions(+), 15 deletions(-)", "diff": "diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c\nindex 97d22b8..5060a6c 100644\n--- a/app/test-pmd/parameters.c\n+++ b/app/test-pmd/parameters.c\n@@ -186,6 +186,7 @@ usage(char* progname)\n \tprintf(\" --flow-isolate-all: \"\n \t \"requests flow API isolated mode on all ports at initialization time.\\n\");\n \tprintf(\" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\\n\");\n+\tprintf(\" --no-mlockall: do not lock all memory\\n\");\n }\n \n #ifdef RTE_LIBRTE_CMDLINE\n@@ -621,6 +622,7 @@ launch_args_parse(int argc, char** argv)\n \t\t{ \"print-event\",\t\t1, 0, 0 },\n \t\t{ \"mask-event\",\t\t\t1, 0, 0 },\n \t\t{ \"tx-offloads\",\t\t1, 0, 0 },\n+\t\t{ \"no-mlockall\",\t\t0, 0, 0 },\n \t\t{ 0, 0, 0, 0 },\n \t};\n \n@@ -1102,7 +1104,8 @@ launch_args_parse(int argc, char** argv)\n \t\t\t\t\trte_exit(EXIT_FAILURE,\n \t\t\t\t\t\t \"invalid mask-event argument\\n\");\n \t\t\t\t}\n-\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"no-mlockall\"))\n+\t\t\t\tno_mlockall = 1;\n \t\t\tbreak;\n \t\tcase 'h':\n \t\t\tusage(argv[0]);\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex 4c0e258..59bdc85 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -294,6 +294,10 @@ uint32_t event_print_mask = (UINT32_C(1) << RTE_ETH_EVENT_UNKNOWN) |\n \t\t\t (UINT32_C(1) << RTE_ETH_EVENT_INTR_RESET) |\n \t\t\t (UINT32_C(1) << RTE_ETH_EVENT_MACSEC) |\n \t\t\t (UINT32_C(1) << RTE_ETH_EVENT_INTR_RMV);\n+/*\n+ * Decide if all memory are locked for performance.\n+ */\n+int no_mlockall = 0;\n \n /*\n * NIC bypass mode configuration options.\n@@ -2489,7 +2493,20 @@ main(int argc, char** argv)\n \t\trte_panic(\"Cannot register log type\");\n \trte_log_set_level(testpmd_logtype, RTE_LOG_DEBUG);\n \n-\tif (mlockall(MCL_CURRENT | MCL_FUTURE)) {\n+\t/* Bitrate/latency stats disabled by default */\n+#ifdef RTE_LIBRTE_BITRATE\n+\tbitrate_enabled = 0;\n+#endif\n+#ifdef RTE_LIBRTE_LATENCY_STATS\n+\tlatencystats_enabled = 0;\n+#endif\n+\n+\targc -= diag;\n+\targv += diag;\n+\tif (argc > 1)\n+\t\tlaunch_args_parse(argc, argv);\n+\n+\tif (!no_mlockall && mlockall(MCL_CURRENT | MCL_FUTURE)) {\n \t\tTESTPMD_LOG(NOTICE, \"mlockall() failed with error \\\"%s\\\"\\n\",\n \t\t\tstrerror(errno));\n \t}\n@@ -2511,19 +2528,6 @@ main(int argc, char** argv)\n \t\trte_panic(\"Empty set of forwarding logical cores - check the \"\n \t\t\t \"core mask supplied in the command parameters\\n\");\n \n-\t/* Bitrate/latency stats disabled by default */\n-#ifdef RTE_LIBRTE_BITRATE\n-\tbitrate_enabled = 0;\n-#endif\n-#ifdef RTE_LIBRTE_LATENCY_STATS\n-\tlatencystats_enabled = 0;\n-#endif\n-\n-\targc -= diag;\n-\targv += diag;\n-\tif (argc > 1)\n-\t\tlaunch_args_parse(argc, argv);\n-\n \tif (tx_first && interactive)\n \t\trte_exit(EXIT_FAILURE, \"--tx-first cannot be used on \"\n \t\t\t\t\"interactive mode.\\n\");\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex 153abea..028b873 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -319,6 +319,7 @@ extern volatile int test_done; /* stop packet forwarding when set to 1. */\n extern uint8_t lsc_interrupt; /**< disabled by \"--no-lsc-interrupt\" parameter */\n extern uint8_t rmv_interrupt; /**< disabled by \"--no-rmv-interrupt\" parameter */\n extern uint32_t event_print_mask;\n+extern int no_mlockall; /**< set by \"--no-mlockall\" parameter */\n /**< set by \"--print-event xxxx\" and \"--mask-event xxxx parameters */\n \n #ifdef RTE_LIBRTE_IXGBE_BYPASS\n", "prefixes": [ "dpdk-dev", "3/4" ] }{ "id": 35162, "url": "