ethdev: add telemetry callbacks
authorBruce Richardson <bruce.richardson@intel.com>
Thu, 30 Apr 2020 16:01:29 +0000 (17:01 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 10 May 2020 22:37:01 +0000 (00:37 +0200)
commitc190daedb9b1486db7834d139859e0b4c063a0b0
treea2272fedc4027ac8b3455272acb782ea21ae8255
parent6a2967c112a3aa36c903b1554202732dcb2dd190
ethdev: add telemetry callbacks

The ethdev library now registers commands with telemetry, and
implements the callback functions. These commands allow the list of
ethdev ports and the xstats and link status for a port to be queried.

An example using ethdev commands is shown below:

Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2
{"version": "DPDK 20.05.0-rc0", "pid": 64379, "max_output_len": 16384}
--> /
{"/": ["/", "/ethdev/link_status", "/ethdev/list", "/ethdev/xstats", \
    "/help", "/info"]}
--> /ethdev/list
{"/ethdev/list": [0, 1, 2, 3]}
--> /ethdev/link_status,0
{"/ethdev/link_status": {"status": "UP", "speed": 10000, "duplex": \
    "full-duplex"}}
--> /ethdev/xstats,0
{"/ethdev/xstats": {"rx_good_packets": 0, "tx_good_packets": 0, \
    <snip>
    "tx_priority7_xon_to_xoff_packets": 0}}

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: Keith Wiles <keith.wiles@intel.com>
lib/librte_ethdev/Makefile
lib/librte_ethdev/meson.build
lib/librte_ethdev/rte_ethdev.c