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 47FCDA034F; Mon, 11 Oct 2021 16:41:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3244B40150; Mon, 11 Oct 2021 16:41:10 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 62CF94003C for ; Mon, 11 Oct 2021 16:41:08 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10133"; a="226848581" X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="226848581" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 07:41:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="479879587" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga007.jf.intel.com with ESMTP; 11 Oct 2021 07:41:07 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 11 Oct 2021 07:41:07 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 11 Oct 2021 07:41:07 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 11 Oct 2021 07:41:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VSXCkv6RbB3wCGp4+zJJMS1Lp9e9TuaxWmmWAVKkNQv6aZE2IeHVe76ppy5kdaKPFHW6zLh7Kz6/snp14NEx5JGNxUIHX0NPnsmJomqOpm/BnzMt4n4i4L14X2Zh/XWqW3rOGck0O+xWYdT8fgUzT7ayDm9bQE+bIFqfJucbs5DKliCviw9JnyI9aSe9LHaH4nHG3/k9Giti+WpM9zjp9Ub6KbtFCGNVf/nqu9oYzRJVcEjEMeMIgu9Z8G+MSAWpNBQJSNgtsrbrngmykTDvr/yGXyE1NSk7dZEjrNIpZIT7jZM4ulhuupfibqje5lNyNUF7hltP+5pnyI67nKfRNg== 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=UjN2S4Hz089cPkkvdescL00jitrRgSwPWcceLAsEn0s=; b=aRhod7y+7K1MitpmIAzw7RPmsR7n2ECUigI1vgjib3b+xp+yd2FM4hYgRWEf8AKOVz4Mn1s/pnp+D7nmiEU1LPayFofgDYYLdw7CPof4UxsYULvrrWeAN3PRmHvKIo37rbSH4MdOny44kKwq8tC+nJTUJB1Rygdi0LWgigCDwHafWibzdbjK7mXxXJdik7wItQnEX01wgdkmbG3ovSTpmdC1ze3AUYPyL8i0lYQTejolcB++yIkECgHHAJ1TIs6fW8HDnjig6Fd7c5MrdBT21r3JEIPsf+tHN1Sa/isZvUHKnSx09iUw6gjQaufHPBLE+26mP9t7b8HF4Ainiia99w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UjN2S4Hz089cPkkvdescL00jitrRgSwPWcceLAsEn0s=; b=zEEVu5Lz/YbPR1Fg2tG2DTBbszaM+8R6cj5gDWMCndTX+cOWrCRubNkdLA5LinfJfWUxTyFKCNGxgPnG4+WQDbnRTlJLn48NhFLfAXDKfQ0U70Y+Q6Z/1rWAdNgIB6w4vN3ZnUwqJp61iKecGy3vnW0LxfFseFbjLxU2/mA+glI= Authentication-Results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4775.namprd11.prod.outlook.com (2603:10b6:510:34::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Mon, 11 Oct 2021 14:41:05 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%5]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 14:41:05 +0000 Message-ID: <53e36586-89a5-68c3-5dc1-b61524bbe4cf@intel.com> Date: Mon, 11 Oct 2021 15:40:58 +0100 Content-Language: en-US To: Gowrishankar Muthukrishnan , CC: Thomas Monjalon , Andrew Rybchenko , , Ciara Power , Bruce Richardson References: <2eaeef2ece0ff3a5a3fc9323f15a47be617a73a4.1632219073.git.gmuthukrishn@marvell.com> <64d6649a4374f0b5c48d0f27d0d540064afdbe38.1632888548.git.gmuthukrishn@marvell.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <64d6649a4374f0b5c48d0f27d0d540064afdbe38.1632888548.git.gmuthukrishn@marvell.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB8PR06CA0034.eurprd06.prod.outlook.com (2603:10a6:10:100::47) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by DB8PR06CA0034.eurprd06.prod.outlook.com (2603:10a6:10:100::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 14:41:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 74faea4b-d078-44ff-7abc-08d98cc52790 X-MS-TrafficTypeDiagnostic: PH0PR11MB4775: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: svSUr23+kYojvH72HB/2MBpRitWLgVC8yN9tF4KtD5bIhKWyMdDJ0klJ8r86QWIOLeN6GyhllDUzAMMgO3bWf4lZgs5wWuHshqlYERT1EbX/8pXUw8hwgXnkyUrikKcdwKv8eWoSXDFfooA+ocCBJjN0q9u9//asjv1RnjSgJFdIao/nmOYVOrWhqppHF/s5yQpYhR7uISPBlED4+8onbRpDT3SqHTCc/J10yEkBPKc9T55b0tNXEFQ7/NqqFdr/zgXhHLl+JkA2ADJzdHiJDmre/1jaFSMaCoj+hMrN9NW0/oz2cFZBUO1wfufUqIls9BNUtjVOsu+rKAEKqv+HfgFNL0MiMBpiBl7xupxMQEj2NHyslFZpIWNAGM0NnDdjbZrYtSqC1GRmip+UbreClCcon43++sIIVM7BUZEp0/+SXXTnBFWfAHZz2hqHi9tUB5mQ3PDM+aju/nV8rcWBL7xpeT15Sqjdu9+2F0uMQD8jbLXCkvM2UVCw/niuvCPKQXYd2FVvtn6S+U1+lta83H7WQokpf8UIHMpa/kINdF6lW6SSoQJZM99N75ck3nX8YzTK6PYGwrWOPOuyBb6tqDvTT0a4VrVNr0tuMNShtUTck0nABo+NsGGp+YNjqONKmRQEfGUSs1Ac69we/3xii0RawZGB9hoUSjZHqUQSxSRTVC4WVBWEgJtNP73MKOz6e47jSClgrnX33xHpbbFz0Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(2906002)(36756003)(53546011)(6486002)(186003)(508600001)(8936002)(26005)(6666004)(38100700002)(8676002)(83380400001)(86362001)(31696002)(107886003)(956004)(44832011)(316002)(16576012)(2616005)(5660300002)(54906003)(4326008)(66476007)(31686004)(66946007)(66556008)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UkxnM1doZjR2UzJFcjhiWHRlRkxIYW9BcUk4SWlLZG82Mi9ha2pyUG1vVDlr?= =?utf-8?B?bUdmNGUweCtwbVBHcFJEUW1RcGpwTzYrWTA5UzdzRGp1cmxlaCt5bUkxeGIy?= =?utf-8?B?REsrcDFsQjBtMk1yWTh2dWtFbEIxWHpWVUtnS1cyWUFrc2ljblhMNTRnaVFI?= =?utf-8?B?dDVNak91T0dtTmZoSHlBVjM5UzhRMEJhbXk2V1dqWnlKLzRnYmFDeGhQRlV6?= =?utf-8?B?NjVINjZQWHBxYXJtbWdaNitwTkNoejNSM1dxUHEvL1kxRHpLbUhmUXhKb1hn?= =?utf-8?B?RlZlNW51dVBJT0dnTDB3SDhLQXlYT0lsOTFiWEorbDkrV0YycWU1TzMvb1c2?= =?utf-8?B?UjdQZjlGSGpSMG9VV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-8?B?VDVGY25SaVlZeExnejlFTHpUZEdrd3lCVU15d1lLNVJnUHp5Sk5jTGhwNlVl?= =?utf-8?B?OXhCdG9NQ1JEWFNjOGNhOEJJK2VQbDZYSHMrdFA4Mk05UFJQenlMUWQ0Y2p4?= =?utf-8?B?V1V1WCt6ZW5TYkRJOE4vMlpVMHU0c01sVjVNRzZFV05xRFpxNXNoVVp6TUlp?= =?utf-8?B?OVNMa01zdmx1QjZ1NWNqYTQ4VzJieTk0ZXVYRnQ3Tlc3L0xRNWtsME5KUnRz?= =?utf-8?B?akwrQ2xvaDhSN281d1lyNTFQSVlTQjJDZS9ySnJWS01PTTBqZEtPMWdMR093?= =?utf-8?B?N0x5S0FHTUwzYXI5K244cjNKb0kyMEphUmh0aHR5L3RWUTZtNDhhb1NFcCtX?= =?utf-8?B?eXlvZjdPSjhnT1NIMTg3OUcxQmh0MkJTRldEU01PcDhaSnRZejhtaXBKTitQ?= =?utf-8?B?eXNSMVdtZlN2alpFQmxGRFFoZThKZE5xNWFFa0V5NHRUMlp1RDBMcE9MVUQz?= =?utf-8?Q?oYB8eexqFJWMFntEAPK3m9onDnDJVfuEHiKo1aZ?= X-MS-Exchange-CrossTenant-Network-Message-Id: 74faea4b-d078-44ff-7abc-08d98cc52790 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 14:41:05.2191 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DMWjr+P93FpPEJdRGKUqOJj+PwpgFRtZJ/Y8ixATa9ErnxVj5rabe9kfFf4kAiVd523g7F0CZimXVQoUjDB+TQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4775 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [v1] ethdev: add telemetry endpoint for device info 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" On 9/29/2021 5:25 AM, Gowrishankar Muthukrishnan wrote: > Add telemetry endpoint /ethdev/info for device info. > > Signed-off-by: Gowrishankar Muthukrishnan > Change-Id: I3e6ee2bd1a80675473adf0bd884b194f98e28536 > --- > lib/ethdev/rte_ethdev.c | 92 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 92 insertions(+) > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index daf5ca9242..9b7bfa5f63 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -6242,6 +6242,96 @@ eth_dev_handle_port_link_status(const char *cmd __rte_unused, > return 0; > } > > +static int > +eth_dev_handle_port_info(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d) > +{ > + struct rte_tel_data *rxq_state, *txq_state; > + char mac_addr[RTE_ETHER_ADDR_LEN]; > + struct rte_eth_dev *eth_dev; > + char *end_param; > + int port_id, i; > + > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > + return -1; > + > + port_id = strtoul(params, &end_param, 0); > + if (*end_param != '\0') > + RTE_ETHDEV_LOG(NOTICE, > + "Extra parameters passed to ethdev telemetry command, ignoring"); > + > + if (!rte_eth_dev_is_valid_port(port_id)) > + return -EINVAL; > + > + eth_dev = &rte_eth_devices[port_id]; > + if (!eth_dev) > + return -EINVAL; > + > + rxq_state = rte_tel_data_alloc(); > + if (!rxq_state) > + return -ENOMEM; > + > + txq_state = rte_tel_data_alloc(); > + if (!txq_state) > + return -ENOMEM; > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_string(d, "name", eth_dev->data->name); > + rte_tel_data_add_dict_int(d, "state", eth_dev->state); > + rte_tel_data_add_dict_int(d, "nb_rx_queues", > + eth_dev->data->nb_rx_queues); > + rte_tel_data_add_dict_int(d, "nb_tx_queues", > + eth_dev->data->nb_tx_queues); > + rte_tel_data_add_dict_int(d, "port_id", eth_dev->data->port_id); > + rte_tel_data_add_dict_int(d, "mtu", eth_dev->data->mtu); > + rte_tel_data_add_dict_int(d, "rx_mbuf_size_min", > + eth_dev->data->min_rx_buf_size); > + rte_tel_data_add_dict_int(d, "rx_mbuf_alloc_fail", > + eth_dev->data->rx_mbuf_alloc_failed); > + snprintf(mac_addr, RTE_ETHER_ADDR_LEN, "%02x:%02x:%02x:%02x:%02x:%02x", > + eth_dev->data->mac_addrs->addr_bytes[0], > + eth_dev->data->mac_addrs->addr_bytes[1], > + eth_dev->data->mac_addrs->addr_bytes[2], > + eth_dev->data->mac_addrs->addr_bytes[3], > + eth_dev->data->mac_addrs->addr_bytes[4], > + eth_dev->data->mac_addrs->addr_bytes[5]); > + rte_tel_data_add_dict_string(d, "mac_addr", mac_addr); > + rte_tel_data_add_dict_int(d, "promiscuous", > + eth_dev->data->promiscuous); > + rte_tel_data_add_dict_int(d, "scattered_rx", > + eth_dev->data->scattered_rx); > + rte_tel_data_add_dict_int(d, "all_multicast", > + eth_dev->data->all_multicast); > + rte_tel_data_add_dict_int(d, "dev_started", eth_dev->data->dev_started); > + rte_tel_data_add_dict_int(d, "lro", eth_dev->data->lro); > + rte_tel_data_add_dict_int(d, "dev_configured", > + eth_dev->data->dev_configured); > + > + rte_tel_data_start_array(rxq_state, RTE_TEL_INT_VAL); > + for (i = 0; i < eth_dev->data->nb_rx_queues; i++) > + rte_tel_data_add_array_int(rxq_state, > + eth_dev->data->rx_queue_state[i]); > + > + rte_tel_data_start_array(txq_state, RTE_TEL_INT_VAL); > + for (i = 0; i < eth_dev->data->nb_tx_queues; i++) > + rte_tel_data_add_array_int(txq_state, > + eth_dev->data->tx_queue_state[i]); > + > + rte_tel_data_add_dict_container(d, "rxq_state", rxq_state, 0); > + rte_tel_data_add_dict_container(d, "txq_state", txq_state, 0); > + rte_tel_data_add_dict_int(d, "numa_node", eth_dev->data->numa_node); > + rte_tel_data_add_dict_int(d, "dev_flags", eth_dev->data->dev_flags); > + rte_tel_data_add_dict_int(d, "rx_offloads", > + eth_dev->data->dev_conf.rxmode.offloads); > + rte_tel_data_add_dict_int(d, "tx_offloads", > + eth_dev->data->dev_conf.txmode.offloads); > + rte_tel_data_add_dict_int(d, "ethdev_rss_hf", > + eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf); > + > + return 0; > +} > + > int > rte_eth_hairpin_queue_peer_update(uint16_t peer_port, uint16_t peer_queue, > struct rte_hairpin_peer_info *cur_info, > @@ -6323,4 +6413,6 @@ RTE_INIT(ethdev_init_telemetry) > rte_telemetry_register_cmd("/ethdev/link_status", > eth_dev_handle_port_link_status, > "Returns the link status for a port. Parameters: int port_id"); > + rte_telemetry_register_cmd("/ethdev/info", eth_dev_handle_port_info, > + "Returns the device info for a port. Parameters: int port_id"); > } > @Ciara, @Bruce, can you please review the set from telemetry perspective? And overall looks like good idea to provide more ethdev information via telemetry, but when we have this it becomes interface since applications may rely on it, is extending it breaks the apps? If so perhaps we should consider multiple small commands instead of one big 'info' one, what do you think?