From patchwork Wed Nov 23 10:26:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Jarry X-Patchwork-Id: 120114 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 497BFA09E5; Wed, 23 Nov 2022 11:26:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2A6342DA8; Wed, 23 Nov 2022 11:26:38 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 72CBC42D97 for ; Wed, 23 Nov 2022 11:26:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669199196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ReNXzfRR998dPs9VbBxrE1hLWo2TpdZ1UuCmWjDsjSM=; b=WF4xiXZyKB52kSwgekRtmEDvF7cSfrfRUpc5M4dNf27utbE12WXMfu0gMXkuyjQc4vSmpZ UAlymH5wOSX71tZANxaZqyJ2bPw47ApVmxj5NPVrNZEdE7FQlmZXCGl2sLzCwlB1naY5zB OsRUohrHk9ZaUhKR8y7BlSE7IBW5x8I= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-524-GV4ZVpH8PDSElRq28mSUAw-1; Wed, 23 Nov 2022 05:26:34 -0500 X-MC-Unique: GV4ZVpH8PDSElRq28mSUAw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 71F3A101A52A; Wed, 23 Nov 2022 10:26:33 +0000 (UTC) Received: from paul.home (unknown [10.39.208.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF91140C83BB; Wed, 23 Nov 2022 10:26:31 +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:26:11 +0100 Message-Id: <20221123102612.1688865-4-rjarry@redhat.com> In-Reply-To: <20221123102612.1688865-1-rjarry@redhat.com> References: <20221123102612.1688865-1-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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,