From patchwork Wed Nov 23 10:19:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Jarry X-Patchwork-Id: 120109 X-Patchwork-Delegate: thomas@monjalon.net 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 59331A09E5; Wed, 23 Nov 2022 11:19:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE4E642D9A; Wed, 23 Nov 2022 11:19:47 +0100 (CET) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by mails.dpdk.org (Postfix) with ESMTP id DF32242D97 for ; Wed, 23 Nov 2022 11:19:46 +0100 (CET) Received: (Authenticated sender: robin@jarry.cc) by mail.gandi.net (Postfix) with ESMTPSA id 0993D1BF20A; Wed, 23 Nov 2022 10:19:44 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org Cc: Bruce Richardson , Jerin Jacob , Kevin Laatz , Konstantin Ananyev , =?utf-8?q?Mattias_R?= =?utf-8?q?=C3=B6nnblom?= , =?utf-8?q?Morten_Br=C3=B8?= =?utf-8?q?rup?= , Robin Jarry Subject: [RFC PATCH 3/4] testpmd: add show lcores command Date: Wed, 23 Nov 2022 11:19:30 +0100 Message-Id: <20221123101931.1688238-4-rjarry@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123101931.1688238-1-rjarry@redhat.com> References: <20221123101931.1688238-1-rjarry@redhat.com> MIME-Version: 1.0 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 Add a simple command that calls rte_lcore_dump(). Signed-off-by: Robin Jarry --- app/test-pmd/cmdline.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index b32dc8bfd445..d290938ffb4e 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -7151,6 +7151,36 @@ static cmdline_parse_inst_t cmd_showfwdall = { }, }; +/* show lcores */ +struct lcores_result { + cmdline_fixed_string_t show; + cmdline_fixed_string_t lcores; +}; + +static cmdline_parse_token_string_t cmd_lcores_action = + TOKEN_STRING_INITIALIZER(struct lcores_result, show, "show"); +static cmdline_parse_token_string_t cmd_lcores_lcores = + TOKEN_STRING_INITIALIZER(struct lcores_result, lcores, "lcores"); + +static void +cmd_showlcores_parsed(__rte_unused void *parsed_result, + __rte_unused struct cmdline *cl, + __rte_unused void *data) +{ + rte_lcore_dump(stdout); +} + +static cmdline_parse_inst_t cmd_showlcores = { + .f = cmd_showlcores_parsed, + .data = NULL, + .help_str = "show lcores", + .tokens = { + (void *)&cmd_lcores_action, + (void *)&cmd_lcores_lcores, + NULL, + }, +}; + /* *** READ A RING DESCRIPTOR OF A PORT RX/TX QUEUE *** */ struct cmd_read_rxd_txd_result { cmdline_fixed_string_t read; @@ -12637,6 +12667,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = { (cmdline_parse_inst_t *)&cmd_showdevice, (cmdline_parse_inst_t *)&cmd_showcfg, (cmdline_parse_inst_t *)&cmd_showfwdall, + (cmdline_parse_inst_t *)&cmd_showlcores, (cmdline_parse_inst_t *)&cmd_start, (cmdline_parse_inst_t *)&cmd_start_tx_first, (cmdline_parse_inst_t *)&cmd_start_tx_first_n,