telemetry: fix using ports of different types
authorBruce Richardson <bruce.richardson@intel.com>
Wed, 19 Dec 2018 11:59:50 +0000 (11:59 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Sat, 22 Dec 2018 02:23:06 +0000 (03:23 +0100)
commitfff6df7bf58e8907c710832738a26d8d67c8256c
treed6b7aeb92640e58bde25ac0e76fb3b2be7c0bd4c
parent7928b0fdf8f790b6178ad91cf41ee2f9df10e707
telemetry: fix using ports of different types

Different NIC ports can have different numbers of xstats on them, which
means that we can't just use the xstats list from the first port registered
in the telemetry library. Instead, we need to check the type of each port -
by checking its ops structure pointer - and register each port type once
with the metrics lib.

Fixes: fdbdb3f9ce46 ("telemetry: add initial connection socket")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
lib/librte_telemetry/rte_telemetry.c
lib/librte_telemetry/rte_telemetry_internal.h