Skip to content

Commit 1e308c6

Browse files
Kaaameanguy11
authored andcommitted
ice: Fix max VLANs available for VF
Legacy VLAN implementation allows for untrusted VF to have 8 VLAN filters, not counting VLAN 0 filters. Current VLAN_V2 implementation lowers available filters for VF, by counting in VLAN 0 filter for both TPIDs. Fix this by counting only non zero VLAN filters. Without this patch, untrusted VF would not be able to access 8 VLAN filters. Fixes: cc71de8 ("ice: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2") Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com> Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com> Tested-by: Marek Szlosek <marek.szlosek@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 9b134b1 commit 1e308c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/intel/ice/ice_virtchnl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2948,7 +2948,8 @@ ice_vc_validate_add_vlan_filter_list(struct ice_vsi *vsi,
29482948
struct virtchnl_vlan_filtering_caps *vfc,
29492949
struct virtchnl_vlan_filter_list_v2 *vfl)
29502950
{
2951-
u16 num_requested_filters = vsi->num_vlan + vfl->num_elements;
2951+
u16 num_requested_filters = ice_vsi_num_non_zero_vlans(vsi) +
2952+
vfl->num_elements;
29522953

29532954
if (num_requested_filters > vfc->max_filters)
29542955
return false;

0 commit comments

Comments
 (0)