From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 305E141E90; Tue, 14 Mar 2023 14:46:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2064140F18; Tue, 14 Mar 2023 14:46:08 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2041.outbound.protection.outlook.com [40.107.243.41]) by mails.dpdk.org (Postfix) with ESMTP id C3B5040A7E for ; Tue, 14 Mar 2023 14:46:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dwiN3M+sM1ojhD6FUJOzNV05xsNtcAEqt0fkxTHoanFqiXFgrpT5bej4mRGV3qWVkV6w6A+N6h02EDqJkvZvtZEcJ/zhDymSej2sQjwCZxD1UyF++MYPff+Y9PT1lBhcPYIelQxHTcbMZKJjbkhAxN2zk8pGmMDqSZccQRICx9gPkNKL+bIzV523hJ7+cUFXp7SjiI5GKlA3p0cJWe7v9WrK97TgqmziWN67ZisnwcrbdeCZpS24rhAOhArltZNGHIaPDpVTQTKagAHqiLuSmZ7EorPPyuvWr9CJ0ksbRASJiOOKje3vHNh//n8wIIY5zEKA9vKp2PCmrDEmy/dTyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SaEwlj1bUPEEfxsq1vRwNJMBpTOYCR8hRFH2J46oTcM=; b=aEQv01MDYZyX1pbhxx0DKCofiYsyWN80BtCYOAwjpLW0kzDCuF9PahFkKARC4YvGafKDhi4PM2C9F/XdRu9u7oe8aZxN7EoZQEW2bxoVsYbd5Sadu7w4mSgJtZ5Rwg0kGL1eptZHxvrueZvezOjV5TplVwzQ0IkJNCPdhNOkcUBx2d8w4QB02+87j35t+eM8i+SomJo7uScOxl3wDdna3cKDa8UXM9on7H9OsFmqUgCclNXwcBAgYqEGjjcpVuHjYVDQm5DI+FqYnJSPMCoQV0vqnCTQkvn9dz9i1vsj/mVhul0yl4EjdIUrnXTZVWdLVodWSY9QLsdkJLMsh7M4wA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SaEwlj1bUPEEfxsq1vRwNJMBpTOYCR8hRFH2J46oTcM=; b=CSmv5ICeNA70OkB2gYHgJQRBNsI5cOOOocWYbB3/klhS3TphJm/JAX8faq7PY5F56Uj5n1RMI1fXG0KO46BdkS9ridS+HGgHbhoXK2qK6SXmpzLPbDDOIn0XUlRH4gpbLNpbCx1C2HPm2GoSO6V+htERTlw37ipNCXa6rIMQtKI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by CY5PR12MB6203.namprd12.prod.outlook.com (2603:10b6:930:24::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Tue, 14 Mar 2023 13:46:04 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640%5]) with mapi id 15.20.6178.026; Tue, 14 Mar 2023 13:46:04 +0000 Message-ID: Date: Tue, 14 Mar 2023 13:45:58 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: Chengwen Feng , thomas@monjalon.net, Aman Singh , Yuying Zhang Cc: dev@dpdk.org References: <20230314115035.33356-1-fengchengwen@huawei.com> From: Ferruh Yigit Subject: Re: [PATCH] app/testpmd: support dump ethdev private cmd In-Reply-To: <20230314115035.33356-1-fengchengwen@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0077.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:190::10) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CY5PR12MB6203:EE_ X-MS-Office365-Filtering-Correlation-Id: f70618e0-4c30-4530-2706-08db2492741a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H9g6y9f2gqvyOeLIAtrppGITps1lb2jiqsCTZJCsSG4rfhcOx5eGvRuNibA0hwChYeEYfLmS1pmipZtxTkM/ZxD4B02Ab40LvtWovTeInRoPQtukWvIIy4jGvjA+MoTw+Fggqsos1P359AKB2G56ieKFtKRY/PY9hpx9l/gYomr4MsClSrYc26iqJXVJp/AhB+ooPYGQmcUh854IMoQ62AqGpIaFDOGPI8k2+tDMyGCqSbuCJsMvtsrSqGu2c/4OLddXxYh8mbagUbbRQclS4w5a2ufTnbBhux2Ny5V5mP4YA0yvhgDMDXE5fAfIT7m2B/p80815Sf4Z8ZA2G4MwmAAQnPBukyYSUgKKuv0DVKsbyMevU8uoprflAHJ6mwCPOPadeHGGxrQpBch2RjdrmZqmyiO+F5pIudA8FJIVT/v5OW8TDSq12OD/uJouiEyPICQyj84DDy/QHvmVqJesZ9dqrE+H02F489BTyAyBfjVykUuT3HFLsk8DczexGr9y4k5T8YOJmOgg0G3Bj44X8NyAbYALdG+79PiSY7jIIiFjNFa4Z5VEOyKOWDVR8KLZJ8RvjaYQE60aYQ1Ip6TrBEUzePg84wV3TxI27fJN5Hl+OKzZKuxp5h/1fGf4IIZBKGy6LKmjQk5PLDIp7hzuHcZR84tdrW5oC5LdmzzNOh28i0nDTzgmu3nuTWkZyIs42daucMog1EfmGWeTW1DLrE6wkMaRVYGDNIHyqtGs+oE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(396003)(39860400002)(376002)(136003)(366004)(346002)(451199018)(31686004)(38100700002)(2906002)(86362001)(53546011)(31696002)(2616005)(316002)(478600001)(6506007)(6512007)(6666004)(110136005)(36756003)(66556008)(4326008)(66476007)(66946007)(41300700001)(8676002)(186003)(6486002)(8936002)(26005)(44832011)(5660300002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aVNNRzhMQmI5SVpya0N6SktXem9aM3huVGh0NTQ2ZnVZWDMwSVhycjNQYlJB?= =?utf-8?B?d0xsQU5GUEtFRythMFJHazZ4aE9DYjdUMWpBMkV2alY0TzJZeFZJblJpNVc0?= =?utf-8?B?V3ZYTUt0MVFFUVVnaFVWazRaYjNXTmgyOWduRE12a1ppM3FnQldvMS93SXFr?= =?utf-8?B?c2xOcVVzNndJbnFJbzdHWTFBK21ZOVFVcnUvTzVubDdLczlrUHJJUlcrRUNz?= =?utf-8?B?bjN0cmNsVENSZ2ZCdXRWU09oWGFReVVINi8rZDdFWnJpNS93Yy9zbGNPNnlP?= =?utf-8?B?TUlvSkhkNFA3b3gzcFJsdldNVi9OVno1d2tNemlia0F6clVXTjVUajI2UTc3?= =?utf-8?B?dWNqRkNYWHhYbTVtTlB2b3ViRW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530-2706-08db2492741a X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2023 13:46:04.1470 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JG3ltrJsHNW++4PdFMaIoHepXdUQ5VPj7xIJjBZLvW+xlhiu4ZC891VHVi99n8d8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6203 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 On 3/14/2023 11:50 AM, Chengwen Feng wrote: > This patch adds 'dump_eth_priv [port_id]' which could used to dump > the specific ethdev port private info. > We have already "show port ..." commands to display various port related information, what do you think to follow same syntax for port private info. Something like "show port private_info " Or it is possible to append this to the output of the existing port info ("show port info "), as a new section of output if port has private info? This can be an addition parameter to existing command but not sure if we need it, like: "show port info private on" I think displaying private info as port of port info without additional parameter is OK, it is simpler. > Signed-off-by: Chengwen Feng > --- > app/test-pmd/cmdline.c | 43 +++++++++++++++++++++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 7 ++++ > 2 files changed, 50 insertions(+) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 6fa870dc32..3ac7e78aff 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -8439,6 +8439,48 @@ static cmdline_parse_inst_t cmd_dump_one = { > }, > }; > > +/* ******************************************************************************** */ > + > +struct cmd_dump_eth_priv_result { > + cmdline_fixed_string_t dump; > + portid_t port_id; > +}; > + > +static cmdline_parse_token_string_t cmd_dump_eth_priv_dump = > + TOKEN_STRING_INITIALIZER(struct cmd_dump_one_result, dump, > + "dump_eth_priv"); > +static cmdline_parse_token_num_t cmd_dump_eth_priv_port_id = > + TOKEN_NUM_INITIALIZER(struct cmd_dump_eth_priv_result, > + port_id, RTE_UINT16); > + > +static void cmd_dump_eth_priv_parsed(void *parsed_result, struct cmdline *cl, > + __rte_unused void *data) > +{ > + struct cmd_dump_eth_priv_result *res = parsed_result; > + int ret; > + > + if (!rte_eth_dev_is_valid_port(res->port_id)) { > + cmdline_printf(cl, "Invalid port id %u\n", res->port_id); > + return; > + } > + > + ret = rte_eth_dev_priv_dump(res->port_id, stdout); > + if (ret < 0) > + cmdline_printf(cl, "Failed to dump port id %u private info with error (%d): %s\n", > + res->port_id, ret, strerror(-ret)); > +} > + > +static cmdline_parse_inst_t cmd_dump_eth_priv = { > + .f = cmd_dump_eth_priv_parsed, /* function to call */ > + .data = NULL, /* 2nd arg of func */ > + .help_str = "dump_eth_priv : Dump one ethdev port private info", > + .tokens = { /* token list, NULL terminated */ > + (void *)&cmd_dump_eth_priv_dump, > + (void *)&cmd_dump_eth_priv_port_id, > + NULL, > + }, > +}; > + > /* *** Filters Control *** */ > > #define IPV4_ADDR_TO_UINT(ip_addr, ip) \ > @@ -12854,6 +12896,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = { > (cmdline_parse_inst_t *)&cmd_cleanup_txq_mbufs, > (cmdline_parse_inst_t *)&cmd_dump, > (cmdline_parse_inst_t *)&cmd_dump_one, > + (cmdline_parse_inst_t *)&cmd_dump_eth_priv, > (cmdline_parse_inst_t *)&cmd_flow, > (cmdline_parse_inst_t *)&cmd_show_port_meter_cap, > (cmdline_parse_inst_t *)&cmd_add_port_meter_profile_srtcm, > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 8f23847859..211f41f86d 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -605,6 +605,13 @@ Dumps the log level for all the dpdk modules:: > > testpmd> dump_log_types > > +dump ethdev private > +~~~~~~~~~~~~~~~~~~~ > + > +Dumps the specific ethdev port private info:: > + > + testpmd> dump_eth_priv [port_id] > + > show (raw_encap|raw_decap) > ~~~~~~~~~~~~~~~~~~~~~~~~~~ >