aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/avf/format.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-03-30 14:41:35 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2021-04-01 13:51:35 +0000
commita1510f592bf4c91ec68c5e217e112f0c1f756035 (patch)
tree09f5681743351cb50019dee3bef3c825cc2a13ac /src/plugins/avf/format.c
parentacc665a9de9ed545cfa0c5b442287fa7ce5c7e9f (diff)
avf: disable VLAN stripping on E810 using V2 VLAN APIs
Type: fix Change-Id: I9bb19a5c9b5b48825f19a4ac124a3628ceaa081d Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/avf/format.c')
-rw-r--r--src/plugins/avf/format.c78
1 files changed, 71 insertions, 7 deletions
diff --git a/src/plugins/avf/format.c b/src/plugins/avf/format.c
index 5dbfae2b378..26157804c77 100644
--- a/src/plugins/avf/format.c
+++ b/src/plugins/avf/format.c
@@ -168,10 +168,74 @@ format_avf_input_trace (u8 * s, va_list * args)
return s;
}
-/*
- * fd.io coding-style-patch-verification: ON
- *
- * Local Variables:
- * eval: (c-set-style "gnu")
- * End:
- */
+u8 *
+format_avf_vlan_support (u8 *s, va_list *args)
+{
+ virtchnl_vlan_support_t v = va_arg (*args, u32);
+ int not_first = 0;
+
+ char *strs[32] = {
+#define _(a, b, c) [a] = c,
+ foreach_virtchnl_vlan_support_bit
+#undef _
+ };
+
+ if (v == VIRTCHNL_VLAN_UNSUPPORTED)
+ return format (s, "unsupported");
+
+ for (int i = 0; i < 32; i++)
+ {
+ if ((v & (1 << i)) == 0)
+ continue;
+ if (not_first)
+ s = format (s, " ");
+ if (strs[i])
+ s = format (s, "%s", strs[i]);
+ else
+ s = format (s, "unknown(%u)", i);
+ not_first = 1;
+ }
+ return s;
+}
+
+u8 *
+format_avf_vlan_supported_caps (u8 *s, va_list *args)
+{
+ virtchnl_vlan_supported_caps_t *sc =
+ va_arg (*args, virtchnl_vlan_supported_caps_t *);
+ u32 indent = format_get_indent (s);
+
+ s = format (s, "outer: %U", format_avf_vlan_support, sc->outer);
+ s = format (s, "\n%Uinner: %U", format_white_space, indent,
+ format_avf_vlan_support, sc->inner);
+ return s;
+}
+
+u8 *
+format_avf_vlan_caps (u8 *s, va_list *args)
+{
+ virtchnl_vlan_caps_t *vc = va_arg (*args, virtchnl_vlan_caps_t *);
+ u32 indent = format_get_indent (s);
+
+ s = format (s, "filtering:");
+ s = format (s, "\n%Usupport:", format_white_space, indent + 2);
+ s =
+ format (s, "\n%U%U", format_white_space, indent + 4,
+ format_avf_vlan_supported_caps, &vc->filtering.filtering_support);
+ s = format (s, "\n%Uethertype-init: 0x%x", format_white_space, indent + 4,
+ vc->filtering.ethertype_init);
+ s = format (s, "\n%Umax-filters: %u", format_white_space, indent + 4,
+ vc->filtering.max_filters);
+ s = format (s, "\n%Uoffloads:", format_white_space, indent);
+ s = format (s, "\n%Ustripping support:", format_white_space, indent + 2);
+ s = format (s, "\n%U%U", format_white_space, indent + 4,
+ format_avf_vlan_supported_caps, &vc->offloads.stripping_support);
+ s = format (s, "\n%Uinserion support:", format_white_space, indent + 2);
+ s = format (s, "\n%U%U", format_white_space, indent + 4,
+ format_avf_vlan_supported_caps, &vc->offloads.insertion_support);
+ s = format (s, "\n%Uethertype-init: 0x%x", format_white_space, indent + 4,
+ vc->offloads.ethertype_init);
+ s = format (s, "\n%Uethertype-match: 0x%x", format_white_space, indent + 4,
+ vc->offloads.ethertype_match);
+ return s;
+}