From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 470F41B359 for ; Wed, 14 Feb 2018 07:40:45 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2018 22:40:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,510,1511856000"; d="scan'208";a="18290900" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga006.jf.intel.com with ESMTP; 13 Feb 2018 22:40:43 -0800 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 13 Feb 2018 22:40:43 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 13 Feb 2018 22:40:42 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.116]) with mapi id 14.03.0319.002; Wed, 14 Feb 2018 14:40:41 +0800 From: "Wu, Jingjing" To: "Tan, Jianfeng" , "dev@dpdk.org" CC: "Lu, Wenzhuo" Thread-Topic: [PATCH 3/4] app/testpmd: add option to avoid lock all memory Thread-Index: AQHTpUhZzV71XPvnqk+kl4yqGUfOg6OjcasQ Date: Wed, 14 Feb 2018 06:40:41 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810F7AF65@SHSMSX103.ccr.corp.intel.com> References: <1518580892-32656-1-git-send-email-jianfeng.tan@intel.com> <1518580892-32656-4-git-send-email-jianfeng.tan@intel.com> In-Reply-To: <1518580892-32656-4-git-send-email-jianfeng.tan@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDY0YjY4ZjItY2Q5Ny00ZmU3LWJiOTMtYWUyNmI5MjNmYmI2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkhVUHlHY083R0ZEaFcrancwcWIyK3dodGVnREN2WWp4R2U3UjhlWERvQnc9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 3/4] app/testpmd: add option to avoid lock all memory X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 06:40:45 -0000 New options is added, the doc also need to update. > -----Original Message----- > From: Tan, Jianfeng > Sent: Wednesday, February 14, 2018 12:02 PM > To: dev@dpdk.org > Cc: Tan, Jianfeng ; Lu, Wenzhuo ; Wu, > Jingjing > Subject: [PATCH 3/4] app/testpmd: add option to avoid lock all memory >=20 > In some cases, we don't want to lock all memory. >=20 > Add an option --no-mlockall to avoid lock all memory. >=20 > Cc: wenzhuo.lu@intel.com > Cc: jingjing.wu@intel.com >=20 > Signed-off-by: Jianfeng Tan > --- > app/test-pmd/parameters.c | 5 ++++- > app/test-pmd/testpmd.c | 32 ++++++++++++++++++-------------- > app/test-pmd/testpmd.h | 1 + > 3 files changed, 23 insertions(+), 15 deletions(-) >=20 > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c > index 97d22b8..5060a6c 100644 > --- a/app/test-pmd/parameters.c > +++ b/app/test-pmd/parameters.c > @@ -186,6 +186,7 @@ usage(char* progname) > printf(" --flow-isolate-all: " > "requests flow API isolated mode on all ports at initialization = time.\n"); > printf(" --tx-offloads=3D0xXXXXXXXX: hexadecimal bitmask of TX queue o= ffloads\n"); > + printf(" --no-mlockall: do not lock all memory\n"); > } >=20 > #ifdef RTE_LIBRTE_CMDLINE > @@ -621,6 +622,7 @@ launch_args_parse(int argc, char** argv) > { "print-event", 1, 0, 0 }, > { "mask-event", 1, 0, 0 }, > { "tx-offloads", 1, 0, 0 }, > + { "no-mlockall", 0, 0, 0 }, > { 0, 0, 0, 0 }, > }; >=20 > @@ -1102,7 +1104,8 @@ launch_args_parse(int argc, char** argv) > rte_exit(EXIT_FAILURE, > "invalid mask-event argument\n"); > } > - > + if (!strcmp(lgopts[opt_idx].name, "no-mlockall")) > + no_mlockall =3D 1; > break; > case 'h': > usage(argv[0]); > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index 4c0e258..59bdc85 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -294,6 +294,10 @@ uint32_t event_print_mask =3D (UINT32_C(1) << > RTE_ETH_EVENT_UNKNOWN) | > (UINT32_C(1) << RTE_ETH_EVENT_INTR_RESET) | > (UINT32_C(1) << RTE_ETH_EVENT_MACSEC) | > (UINT32_C(1) << RTE_ETH_EVENT_INTR_RMV); > +/* > + * Decide if all memory are locked for performance. > + */ > +int no_mlockall =3D 0; >=20 > /* > * NIC bypass mode configuration options. > @@ -2489,7 +2493,20 @@ main(int argc, char** argv) > rte_panic("Cannot register log type"); > rte_log_set_level(testpmd_logtype, RTE_LOG_DEBUG); >=20 > - if (mlockall(MCL_CURRENT | MCL_FUTURE)) { > + /* Bitrate/latency stats disabled by default */ > +#ifdef RTE_LIBRTE_BITRATE > + bitrate_enabled =3D 0; > +#endif > +#ifdef RTE_LIBRTE_LATENCY_STATS > + latencystats_enabled =3D 0; > +#endif > + > + argc -=3D diag; > + argv +=3D diag; > + if (argc > 1) > + launch_args_parse(argc, argv); > + > + if (!no_mlockall && mlockall(MCL_CURRENT | MCL_FUTURE)) { > TESTPMD_LOG(NOTICE, "mlockall() failed with error \"%s\"\n", > strerror(errno)); > } > @@ -2511,19 +2528,6 @@ main(int argc, char** argv) > rte_panic("Empty set of forwarding logical cores - check the " > "core mask supplied in the command parameters\n"); >=20 > - /* Bitrate/latency stats disabled by default */ > -#ifdef RTE_LIBRTE_BITRATE > - bitrate_enabled =3D 0; > -#endif > -#ifdef RTE_LIBRTE_LATENCY_STATS > - latencystats_enabled =3D 0; > -#endif > - > - argc -=3D diag; > - argv +=3D diag; > - if (argc > 1) > - launch_args_parse(argc, argv); > - > if (tx_first && interactive) > rte_exit(EXIT_FAILURE, "--tx-first cannot be used on " > "interactive mode.\n"); > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h > index 153abea..028b873 100644 > --- a/app/test-pmd/testpmd.h > +++ b/app/test-pmd/testpmd.h > @@ -319,6 +319,7 @@ extern volatile int test_done; /* stop packet forward= ing when set > to 1. */ > extern uint8_t lsc_interrupt; /**< disabled by "--no-lsc-interrupt" para= meter */ > extern uint8_t rmv_interrupt; /**< disabled by "--no-rmv-interrupt" para= meter */ > extern uint32_t event_print_mask; > +extern int no_mlockall; /**< set by "--no-mlockall" parameter */ > /**< set by "--print-event xxxx" and "--mask-event xxxx parameters */ >=20 > #ifdef RTE_LIBRTE_IXGBE_BYPASS > -- > 2.7.4