aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk
diff options
context:
space:
mode:
authorHaggai Eran <haggai.eran@gmail.com>2020-02-04 14:09:04 +0200
committerDamjan Marion <dmarion@me.com>2020-02-05 09:19:35 +0000
commit2347278d9530690e0cec815652f5749def673404 (patch)
tree317d83d076024ca2132101a4531d0d0ffe500bc9 /src/plugins/dpdk
parent574be8fe22d4c49c860793e32bac199a454c2161 (diff)
dpdk: output switch information
Type: feature Output DPDK switch information to allow finding out which DPDK ports are associated with which DPDK representor ports. Signed-off-by: Haggai Eran <haggai.eran@gmail.com> Change-Id: I612cbd5a97e04787eca13423f53c7283d5945e37
Diffstat (limited to 'src/plugins/dpdk')
-rw-r--r--src/plugins/dpdk/device/format.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c
index 8ef46512c6f..0db58d8ec2f 100644
--- a/src/plugins/dpdk/device/format.c
+++ b/src/plugins/dpdk/device/format.c
@@ -544,6 +544,20 @@ ptr2sname (void *p)
return info.dli_sname;
}
+static u8 *
+format_switch_info (u8 * s, va_list * args)
+{
+ struct rte_eth_switch_info *si =
+ va_arg (*args, struct rte_eth_switch_info *);
+
+ if (si->name)
+ s = format (s, "name %s ", si->name);
+
+ s = format (s, "domain id %d port id %d", si->domain_id, si->port_id);
+
+ return s;
+}
+
u8 *
format_dpdk_device (u8 * s, va_list * args)
{
@@ -609,6 +623,13 @@ format_dpdk_device (u8 * s, va_list * args)
vec_free (s2);
}
+ if (di.switch_info.domain_id != RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID)
+ {
+ s =
+ format (s, "%Uswitch info: %U\n", format_white_space, indent + 2,
+ format_switch_info, &di.switch_info);
+ }
+
if (1 < verbose)
{
s = format (s, "%Umodule: %U\n", format_white_space, indent + 2,