// SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2019-2021, Intel Corporation. */ #include "ice_vsi_vlan_ops.h" #include "ice_vsi_vlan_lib.h" #include "ice_vlan_mode.h" #include "ice.h" #include "ice_vf_vsi_vlan_ops.h" #include "ice_sriov.h" static int noop_vlan_arg(struct ice_vsi __always_unused *vsi, struct ice_vlan __always_unused *vlan) { … } static int noop_vlan(struct ice_vsi __always_unused *vsi) { … } static void ice_port_vlan_on(struct ice_vsi *vsi) { … } static void ice_port_vlan_off(struct ice_vsi *vsi) { … } /** * ice_vf_vsi_enable_port_vlan - Set VSI VLAN ops to support port VLAN * @vsi: VF's VSI being configured * * The function won't create port VLAN, it only allows to create port VLAN * using VLAN ops on the VF VSI. */ void ice_vf_vsi_enable_port_vlan(struct ice_vsi *vsi) { … } /** * ice_vf_vsi_disable_port_vlan - Clear VSI support for creating port VLAN * @vsi: VF's VSI being configured * * The function should be called after removing port VLAN on VSI * (using VLAN ops) */ void ice_vf_vsi_disable_port_vlan(struct ice_vsi *vsi) { … } /** * ice_vf_vsi_init_vlan_ops - Initialize default VSI VLAN ops for VF VSI * @vsi: VF's VSI being configured * * If Double VLAN Mode (DVM) is enabled, assume that the VF supports the new * VIRTCHNL_VF_VLAN_OFFLOAD_V2 capability and set up the VLAN ops accordingly. * If SVM is enabled maintain the same level of VLAN support previous to * VIRTCHNL_VF_VLAN_OFFLOAD_V2. */ void ice_vf_vsi_init_vlan_ops(struct ice_vsi *vsi) { … } /** * ice_vf_vsi_cfg_dvm_legacy_vlan_mode - Config VLAN mode for old VFs in DVM * @vsi: VF's VSI being configured * * This should only be called when Double VLAN Mode (DVM) is enabled, there * is not a port VLAN enabled on this VF, and the VF negotiates * VIRTCHNL_VF_OFFLOAD_VLAN. * * This function sets up the VF VSI's inner and outer ice_vsi_vlan_ops and also * initializes software only VLAN mode (i.e. allow all VLANs). Also, use no-op * implementations for any functions that may be called during the lifetime of * the VF so these methods do nothing and succeed. */ void ice_vf_vsi_cfg_dvm_legacy_vlan_mode(struct ice_vsi *vsi) { … } /** * ice_vf_vsi_cfg_svm_legacy_vlan_mode - Config VLAN mode for old VFs in SVM * @vsi: VF's VSI being configured * * This should only be called when Single VLAN Mode (SVM) is enabled, there is * not a port VLAN enabled on this VF, and the VF negotiates * VIRTCHNL_VF_OFFLOAD_VLAN. * * All of the normal SVM VLAN ops are identical for this case. However, by * default Rx VLAN filtering should be turned off by default in this case. */ void ice_vf_vsi_cfg_svm_legacy_vlan_mode(struct ice_vsi *vsi) { … }