summaryrefslogtreecommitdiffstats
path: root/src/plugins/avf/format.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-05-19 10:35:10 +0200
committerDamjan Marion <damarion@cisco.com>2021-05-19 10:35:32 +0200
commit8fe2afe88360a7ad4f6a22f4bf049511066e97af (patch)
tree86449ac5b3ce3ba8ac8e1b19930eb536a76da3e8 /src/plugins/avf/format.c
parentfb50bc31bfd54902231925749cacbbcd6dfccc96 (diff)
avf: print stats in separate log class
Type: improvement Change-Id: Ia1a4b1b1acad989cbd47a805b900160ba0071071 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/avf/format.c')
-rw-r--r--src/plugins/avf/format.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/avf/format.c b/src/plugins/avf/format.c
index 26157804c77..0a153a093d9 100644
--- a/src/plugins/avf/format.c
+++ b/src/plugins/avf/format.c
@@ -239,3 +239,22 @@ format_avf_vlan_caps (u8 *s, va_list *args)
vc->offloads.ethertype_match);
return s;
}
+
+u8 *
+format_avf_eth_stats (u8 *s, va_list *args)
+{
+ virtchnl_eth_stats_t *es = va_arg (*args, virtchnl_eth_stats_t *);
+ u32 indent = format_get_indent (s);
+ u8 *v = 0;
+
+#define _(st) \
+ if (v) \
+ v = format (v, "\n%U", format_white_space, indent); \
+ v = format (v, "%-20s = %lu", #st, es->st);
+ foreach_virtchnl_eth_stats
+#undef _
+
+ s = format (s, "%v", v);
+ vec_free (v);
+ return s;
+}