From patchwork Mon Apr 5 19:39:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 90579 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F1680A0A02; Mon, 5 Apr 2021 21:40:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13DB4140E7F; Mon, 5 Apr 2021 21:40:03 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 4355C140E6B for ; Mon, 5 Apr 2021 21:40:02 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id BE7115C00DA; Mon, 5 Apr 2021 15:40:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 05 Apr 2021 15:40:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=+wDtPAtYgz2/a JNatSGKJxMa5shOKq3U7iMFWCEcBfk=; b=YUuWdxwjJGo5xENwwkjxOY2nbdPpm ZMxlZfuBpZwE2JNrFqd7weiq8VWhNzgWrRP98W5VA/NLsR0GVmhbdOxBUcaJWaY1 lrpdn0FBkRaip+9rllqNcgoTX8bmVmn6OpOWbyc6a169Rccu/OXkEq2O3bXJSwSE L5aT45/pQwSjzrffL4fHqKI8U0MS+R9z1UDwwxNJ4LjolTrX5BojRmX0SVCKqK2s /PUQQdOa+9BTvZWkBK8W45oeZroZdjyvlkZI8mO827s1nnRRsCqN3s3SSDyevBRQ E8c7cYSEB81OcPD4aPBO2/z7QE3gW2AmfKWbsJcCy/FGArTlLaTaxuEVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=+wDtPAtYgz2/aJNatSGKJxMa5shOKq3U7iMFWCEcBfk=; b=Vx8yhyxa vLqaXaWg8ZJQvqeluPNZNTa0rx+xmAYoDn4V9TA5KzVK2Wxlx0u2p/1KLmK1tgKi 2LZ6l5Q6RHh4sVe91AtCyJ0ecbybubi1lCGyr+aORoH7jRCjxH7AF3yZojWgBwKA IfjklWmy7pip2hqu53QWCmNufuzsz6881DaiznKsmvheHOBAwig5Ga/B2F3cXGtE jgdghiT4uZtBuC8yvtMOTUjFLdnBvqmiwoby1TfJO4PPhUvdkFDuQSsTnnJi0/A0 wsBvKRjGOQE+j0Sf5S6wzybzI1HKXTcM93kdc1T8DUDywUaI/Rjtq3v95gsbNtQQ xzLCEgfH0m9vMA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejvddgudegvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedt gfeutdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 7E475240054; Mon, 5 Apr 2021 15:40:00 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com, Bruce Richardson , Andrew Rybchenko , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam Date: Mon, 5 Apr 2021 21:39:52 +0200 Message-Id: <20210405193954.1115838-3-thomas@monjalon.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210405193954.1115838-1-thomas@monjalon.net> References: <20210309233116.1934666-1-thomas@monjalon.net> <20210405193954.1115838-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 2/4] eal: improve options usage text X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The description of the EAL options was printed before the application description provided via the hook. It is better to let the application print the global syntax and describes the detail of the EAL options below. Also, some useless lines are removed, and the alignment of few options is fixed. Signed-off-by: Thomas Monjalon Acked-by: Bruce Richardson Acked-by: Andrew Rybchenko Acked-by: Stephen Hemminger --- lib/librte_eal/common/eal_common_options.c | 11 +++++------ lib/librte_eal/freebsd/eal.c | 8 ++++---- lib/librte_eal/linux/eal.c | 12 ++++++------ lib/librte_eal/windows/eal.c | 10 ++++------ 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 2951b1aca2..08a85614c9 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -2045,8 +2045,7 @@ rte_vect_set_max_simd_bitwidth(uint16_t bitwidth) void eal_common_usage(void) { - printf("[options]\n\n" - "EAL common options:\n" + printf("EAL common options:\n" " -c COREMASK Hexadecimal bitmask of cores to run on\n" " -l CORELIST List of cores to run on\n" " The argument format is [-c2][,c3[-c4],...]\n" @@ -2076,7 +2075,7 @@ eal_common_usage(void) " --"OPT_VDEV" Add a virtual device.\n" " The argument format is [,key=val,...]\n" " (ex: --vdev=net_pcap0,iface=eth2).\n" - " --"OPT_IOVA_MODE" Set IOVA mode. 'pa' for IOVA_PA\n" + " --"OPT_IOVA_MODE" Set IOVA mode. 'pa' for IOVA_PA\n" " 'va' for IOVA_VA\n" " -d LIB.so|DIR Add a driver or driver directory\n" " (can be used multiple times)\n" @@ -2116,11 +2115,11 @@ eal_common_usage(void) #endif /* !RTE_EXEC_ENV_WINDOWS */ " -v Display version information on startup\n" " -h, --help This help\n" - " --"OPT_IN_MEMORY" Operate entirely in memory. This will\n" + " --"OPT_IN_MEMORY" Operate entirely in memory. This will\n" " disable secondary process support\n" " --"OPT_BASE_VIRTADDR" Base virtual address\n" - " --"OPT_TELEMETRY" Enable telemetry support (on by default)\n" - " --"OPT_NO_TELEMETRY" Disable telemetry support\n" + " --"OPT_TELEMETRY" Enable telemetry support (on by default)\n" + " --"OPT_NO_TELEMETRY" Disable telemetry support\n" " --"OPT_FORCE_MAX_SIMD_BITWIDTH" Force the max SIMD bitwidth\n" "\nEAL options for DEBUG use only:\n" " --"OPT_HUGE_UNLINK" Unlink hugepage files after init\n" diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c index 32442e5ba6..4e10d37253 100644 --- a/lib/librte_eal/freebsd/eal.c +++ b/lib/librte_eal/freebsd/eal.c @@ -421,13 +421,13 @@ eal_usage(const char *prgname) { rte_usage_hook_t hook = eal_get_application_usage_hook(); - printf("\nUsage: %s ", prgname); - eal_common_usage(); - /* Allow the application to print its usage message too if hook is set */ if (hook) { - printf("===== Application Usage =====\n\n"); + /* Print application usage through EAL options parsing. */ (hook)(prgname); + printf("\n"); } + + eal_common_usage(); } static inline size_t diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c index ac27dd4274..4f36f9b1f5 100644 --- a/lib/librte_eal/linux/eal.c +++ b/lib/librte_eal/linux/eal.c @@ -535,7 +535,12 @@ eal_usage(const char *prgname) { rte_usage_hook_t hook = eal_get_application_usage_hook(); - printf("\nUsage: %s ", prgname); + if (hook) { + /* Print application usage through EAL options parsing. */ + (hook)(prgname); + printf("\n"); + } + eal_common_usage(); printf("EAL Linux options:\n" " --"OPT_SOCKET_MEM" Memory to allocate on sockets (comma separated values)\n" @@ -549,11 +554,6 @@ eal_usage(const char *prgname) " --"OPT_SINGLE_FILE_SEGMENTS" Put all hugepage memory in single files\n" " --"OPT_MATCH_ALLOCATIONS" Free hugepages exactly as allocated\n" "\n"); - /* Allow the application to print its usage message too if hook is set */ - if (hook) { - printf("===== Application Usage =====\n\n"); - (hook)(prgname); - } } static int diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c index 68a1fd1d21..25921eecb2 100644 --- a/lib/librte_eal/windows/eal.c +++ b/lib/librte_eal/windows/eal.c @@ -80,15 +80,13 @@ eal_usage(const char *prgname) { rte_usage_hook_t hook = eal_get_application_usage_hook(); - printf("\nUsage: %s ", prgname); - eal_common_usage(); - /* Allow the application to print its usage message too - * if hook is set - */ if (hook) { - printf("===== Application Usage =====\n\n"); + /* Print application usage through EAL options parsing. */ (hook)(prgname); + printf("\n"); } + + eal_common_usage(); } /* Parse the arguments for --log-level only */