aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMohammed Hawari <mohammed@hawari.fr>2022-09-06 18:08:12 +0200
committerDamjan Marion <dmarion@0xa5.net>2022-09-08 12:02:14 +0000
commit503225c45832491b1a0374ad9db931aefc590d6f (patch)
tree009021082bff34c41b4dfb32a08db76ccb557e26 /src/plugins
parent563d34ba9d3e887662320835c755e379e994deda (diff)
avf: check for VLAN_TOGGLE capability
The ability to modify the vlan setting must be checked prior to using VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2 both for inner and outer vlan stripping Change-Id: Iffe306c34b81a6077ad6ba5deb3f5b61b5475897 Type: fix Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/avf/device.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c
index d12785cc552..ae6597da183 100644
--- a/src/plugins/avf/device.c
+++ b/src/plugins/avf/device.c
@@ -1038,6 +1038,12 @@ avf_device_init (vlib_main_t * vm, avf_main_t * am, avf_device_t * ad,
outer = vc.offloads.stripping_support.outer & mask;
inner = vc.offloads.stripping_support.inner & mask;
+ /* Check for ability to modify the VLAN setting */
+ outer =
+ vc.offloads.stripping_support.outer & VIRTCHNL_VLAN_TOGGLE ? outer : 0;
+ inner =
+ vc.offloads.stripping_support.inner & VIRTCHNL_VLAN_TOGGLE ? inner : 0;
+
if ((outer || inner) &&
(error = avf_op_disable_vlan_stripping_v2 (vm, ad, outer, inner)))
return error;