From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 619B9A057B; Thu, 2 Apr 2020 12:09:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E1392C15; Thu, 2 Apr 2020 12:09:53 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id DE6072BCE for ; Thu, 2 Apr 2020 12:09:50 +0200 (CEST) IronPort-SDR: zeqUzvzTMnxsE8jeEoyImbfZafK4tMuGR+zPWPfQNIMprVv+YEnNMCEJ8UolYOKGfoZhsxzErr 6ciyoGU/jbmw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2020 03:09:49 -0700 IronPort-SDR: 4ko3Olm2xt3bxJf7j3YSiLhznAHiaee9cWV+BQ/VIAOL0ft/t1P1Tg5VQZsNDkVLSz2m/qgqvQ nUPXGwO833GA== X-IronPort-AV: E=Sophos;i="5.72,335,1580803200"; d="scan'208";a="423077351" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.39.44]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 02 Apr 2020 03:09:47 -0700 Date: Thu, 2 Apr 2020 11:09:44 +0100 From: Bruce Richardson To: "Wiles, Keith" Cc: "Power, Ciara" , "Laatz, Kevin" , "dev@dpdk.org" , "Pattan, Reshma" Message-ID: <20200402100944.GA158@bricha3-MOBL.ger.corp.intel.com> References: <20200319171907.60891-1-ciara.power@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Subject: Re: [dpdk-dev] [PATCH 00/12] update and simplify telemetry library. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 Wed, Apr 01, 2020 at 04:48:21PM +0000, Wiles, Keith wrote: > > > > On Mar 19, 2020, at 12:18 PM, Ciara Power > > wrote: > > > > This patchset extensively reworks the telemetry library adding new > > functionality and simplifying much of the existing code, while > > maintaining backward compatibility. > > > > This work is based on the previously sent RFC for a "process info" > > library: https://patchwork.dpdk.org/project/dpdk/list/?series=7741 > > However, rather than creating a new library, this patchset takes that > > work and merges it into the existing telemetry library, as mentioned > > above. > > > > The telemetry library as shipped in 19.11 is based upon the metrics > > library and outputs all statistics based on that as a source. However, > > this limits the telemetry output to only port-level statistics > > information, rather than allowing it to be used as a general scheme for > > telemetry information across all DPDK libraries. > > > > With this patchset applied, rather than the telemetry library being > > responsible for pulling ethdev stats and pushing them into the metrics > > library for retrieval later, each library e.g. ethdev, rawdev, and even > > the metrics library itself (for backwards compatiblity) now handle > > their own stats. Any library or app can register a callback function > > with telemetry, which will be called if requested by the client > > connected via the telemetry socket. The callback function in the > > library/app then formats its stats, or other data, into a JSON string, > > and returns it to telemetry to be sent to the client. > > > > To maintain backward compatibility, e.g. to allow the dpdk telemetry > > collectd plugin to continue to work, some of the existing telemetry > > code is kept, but is moved into the metrics library, and callbacks are > > registered with telemetry for the legacy commands that were supported > > previously. > > > > The new version of the library, apart from the legacy interface support > > for backward compatibility, does not have an external dependency on the > > Jansson library, allowing the library to be enabled by default. > > > > Note: In this version of the patchset, telemetry output is provided by > > the ethdev, rawdev and eal libraries, but this may be expanded further > > in later versions which are planned ahead of the merge deadline for > > 20.05 > > > Thanks for the feedback Keith, agree with all your points. Some further comments inline below. NOTE: We hope to send out a V2 very soon, so not all feedback about new commands may make it into that V2, but they should be able to be added later - either in V3 or subsequent patch. [We'll try and get at least some of them in for V2, though.] /Bruce > I am looking at the patch and noticed we are adding new lines to the JSON output, they are not required. The spaces in the text could be removed as well as it will reduce the amount of data being sent. The output can be put into a JSON formatter to see the data better if needed. > The output from the new telemetry should not include any spaces. The whitespace in the output of the script shown comes from python, since it uses the json python library to parse (and therefore verify as correct json) the received info, and then uses json.dumps to print it out. + reply = json.loads(fd.recv(1024 * 12).decode()) + print(json.dumps(reply)) You can tweak the format you'd like the output displayed in by adding some more paramters to the json.dumps() call. As for the legacy support, it will include some whitespace as we have kept the output byte-for-byte idential as far as possible to avoid any compatibilty issues. > Some required information I believe needs to be added to the patch. > - Command to get the Link status of a port Speed/Duplex/LinkState via a new command ‘/ethdev/linkstate,X’ or I added it to the /ethdev/list command. I also added the total devices and available devices via the DPDK APIs. > I think a linkstate command is a good idea. We'll see about adding it. > { > "/ethdev/list": { > "ports": [{ > "port": 0, > "duplex": "Full", > "state": "UP", > "rate": 40000 > }, { > "port": 1, > "duplex": "Full", > "state": "UP", > "rate": 100000 > }, { > "port": 2, > "duplex": "Full", > "state": "UP", > "rate": 40000 > }, { > "port": 3, > "duplex": "Full", > "state": "UP", > "rate": 100000 > }], > "avail": 4, > "total": 4 > } > } > > The next one is the format of the /ethdev/stats are not very usable as most of the fields are not supported in drivers. > Yes, it's a problem. For V2 we are going to rename this to xstats, so that the standard ethdev stats can be added as a separate command. We did xstats originally because that was what was done previously in telemetry. We have planned to add standard stats in future. > { > "/ethdev/stats": { > "rx_good_packets": 0, > "tx_good_packets": 0, > "rx_good_bytes": 0, > "tx_good_bytes": 0, > "rx_missed_errors": 0, > "rx_errors": 0, > "tx_errors": 0, > "rx_mbuf_allocation_errors": 0, > "rx_q0packets": 0, > "rx_q0bytes": 0, > "rx_q0errors": 0, > "tx_q0packets": 0, > "tx_q0bytes": 0, > "rx_unicast_packets": 0, > "rx_multicast_packets": 0, > "rx_broadcast_packets": 0, > "rx_dropped_packets": 0, > "rx_unknown_protocol_packets": 5, > "tx_unicast_packets": 0, > "tx_multicast_packets": 0, > "tx_broadcast_packets": 0, > "tx_dropped_packets": 0, > "tx_link_down_dropped": 0, > "rx_crc_errors": 0, > "rx_illegal_byte_errors": 0, > "rx_error_bytes": 0, > "mac_local_errors": 0, > "mac_remote_errors": 0, > "rx_length_errors": 0, > "tx_xon_packets": 0, > "rx_xon_packets": 0, > "tx_xoff_packets": 0, > "rx_xoff_packets": 0, > "rx_size_64_packets": 0, > "rx_size_65_to_127_packets": 5, > "rx_size_128_to_255_packets": 0, > "rx_size_256_to_511_packets": 0, > "rx_size_512_to_1023_packets": 0, > "rx_size_1024_to_1522_packets": 0, > "rx_size_1523_to_max_packets": 0, > "rx_undersized_errors": 0, > "rx_oversize_errors": 0, > "rx_mac_short_dropped": 0, > "rx_fragmented_errors": 0, > "rx_jabber_errors": 0, > "tx_size_64_packets": 0, > "tx_size_65_to_127_packets": 6, > "tx_size_128_to_255_packets": 0, > "tx_size_256_to_511_packets": 0, > "tx_size_512_to_1023_packets": 0, > "tx_size_1024_to_1522_packets": 0, > "tx_size_1523_to_max_packets": 0, > "rx_flow_director_atr_match_packets": 0, > "rx_flow_director_sb_match_packets": 0, > "tx_low_power_idle_status": 0, > "rx_low_power_idle_status": 0, > "tx_low_power_idle_count": 0, > "rx_low_power_idle_count": 0, > "rx_priority0_xon_packets": 0, > "rx_priority1_xon_packets": 0, > "rx_priority2_xon_packets": 0, > "rx_priority3_xon_packets": 0, > "rx_priority4_xon_packets": 0, > "rx_priority5_xon_packets": 0, > "rx_priority6_xon_packets": 0, > "rx_priority7_xon_packets": 0, > "rx_priority0_xoff_packets": 0, > "rx_priority1_xoff_packets": 0, > "rx_priority2_xoff_packets": 0, > "rx_priority3_xoff_packets": 0, > "rx_priority4_xoff_packets": 0, > "rx_priority5_xoff_packets": 0, > "rx_priority6_xoff_packets": 0, > "rx_priority7_xoff_packets": 0, > "tx_priority0_xon_packets": 0, > "tx_priority1_xon_packets": 0, > "tx_priority2_xon_packets": 0, > "tx_priority3_xon_packets": 0, > "tx_priority4_xon_packets": 0, > "tx_priority5_xon_packets": 0, > "tx_priority6_xon_packets": 0, > "tx_priority7_xon_packets": 0, > "tx_priority0_xoff_packets": 0, > "tx_priority1_xoff_packets": 0, > "tx_priority2_xoff_packets": 0, > "tx_priority3_xoff_packets": 0, > "tx_priority4_xoff_packets": 0, > "tx_priority5_xoff_packets": 0, > "tx_priority6_xoff_packets": 0, > "tx_priority7_xoff_packets": 0, > "tx_priority0_xon_to_xoff_packets": 0, > "tx_priority1_xon_to_xoff_packets": 0, > "tx_priority2_xon_to_xoff_packets": 0, > "tx_priority3_xon_to_xoff_packets": 0, > "tx_priority4_xon_to_xoff_packets": 0, > "tx_priority5_xon_to_xoff_packets": 0, > "tx_priority6_xon_to_xoff_packets": 0, > "tx_priority7_xon_to_xoff_packets": 0 > } > } > > Most of the fields above are device dependent and very difficult to this data from device to device. The array based information like queue stats needs to be an array in json. The packet size counters are great, but not all of the ports support hardware versions. I would like to see us add these to all PMDs even if we have to do them in software and then added to the basic /ethdev/stats output. > > I create a simpler layout with just the basic values from the dpdk stats get API. Even the queue data is not valid for most ports, but I hope we can add software support to drivers that do not have hardware queue stats. The following is much easier to parse and use then the above format. Note I added the portid value to structure. I used my own names for the fields, just easier to type, but we can use the ones above. > { > “/ethdev/stats”: { > "portid": 0, > "ipackets": 0, > "opackets": 0, > "ibytes": 0, > "obytes": 0, > "imissed": 0, > "ierrors": 0, > "oerrors": 0, > "rx_nombuf": 0, > "q_ipackets": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], > "q_opackets": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], > "q_ibytes": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], > "q_obytes": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], > "q_errors": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] > } > } > > If we need device specific data then we need to create a new command to dump this data instead e.g. ‘/ethdev/xstats,X'. Yep, +1. Stay tuned for V2! :-) > > —Keith