Lines Matching full:vlan

11 	dev_err(ice_pf_to_dev(vsi->back), "%s %d specified invalid VLAN tpid 0x%04x\n",  in print_invalid_tpid()
18 * @vlan: ice_vlan structure to validate
20 * Return true if the VLAN TPID is valid or if the VLAN TPID is 0 and the VLAN
21 * VID is 0, which allows for non-zero VLAN filters with the specified VLAN TPID
22 * and untagged VLAN 0 filters to be added to the prune list respectively.
24 static bool validate_vlan(struct ice_vsi *vsi, struct ice_vlan *vlan) in validate_vlan() argument
26 if (vlan->tpid != ETH_P_8021Q && vlan->tpid != ETH_P_8021AD && in validate_vlan()
27 vlan->tpid != ETH_P_QINQ1 && (vlan->tpid || vlan->vid)) { in validate_vlan()
28 print_invalid_tpid(vsi, vlan->tpid); in validate_vlan()
36 * ice_vsi_add_vlan - default add VLAN implementation for all VSI types
38 * @vlan: VLAN filter to add
40 int ice_vsi_add_vlan(struct ice_vsi *vsi, struct ice_vlan *vlan) in ice_vsi_add_vlan() argument
44 if (!validate_vlan(vsi, vlan)) in ice_vsi_add_vlan()
47 err = ice_fltr_add_vlan(vsi, vlan); in ice_vsi_add_vlan()
53 dev_err(ice_pf_to_dev(vsi->back), "Failure Adding VLAN %d on VSI %i, status %d\n", in ice_vsi_add_vlan()
54 vlan->vid, vsi->vsi_num, err); in ice_vsi_add_vlan()
60 * ice_vsi_del_vlan - default del VLAN implementation for all VSI types
62 * @vlan: VLAN filter to delete
64 int ice_vsi_del_vlan(struct ice_vsi *vsi, struct ice_vlan *vlan) in ice_vsi_del_vlan() argument
70 if (!validate_vlan(vsi, vlan)) in ice_vsi_del_vlan()
75 err = ice_fltr_remove_vlan(vsi, vlan); in ice_vsi_del_vlan()
81 dev_err(dev, "Error removing VLAN %d on VSI %i error: %d\n", in ice_vsi_del_vlan()
82 vlan->vid, vsi->vsi_num, err); in ice_vsi_del_vlan()
88 * ice_vsi_manage_vlan_insertion - Manage VLAN insertion for the VSI for Tx
101 /* Here we are configuring the VSI to let the driver add VLAN tags by in ice_vsi_manage_vlan_insertion()
102 * setting inner_vlan_flags to ICE_AQ_VSI_INNER_VLAN_TX_MODE_ALL. The actual VLAN tag in ice_vsi_manage_vlan_insertion()
107 /* Preserve existing VLAN strip setting */ in ice_vsi_manage_vlan_insertion()
115 dev_err(ice_pf_to_dev(vsi->back), "update VSI for VLAN insert failed, err %d aq_err %s\n", in ice_vsi_manage_vlan_insertion()
127 * ice_vsi_manage_vlan_stripping - Manage VLAN stripping for the VSI for Rx
138 /* do not allow modifying VLAN stripping when a port VLAN is configured in ice_vsi_manage_vlan_stripping()
150 /* Here we are configuring what the VSI should do with the VLAN tag in in ice_vsi_manage_vlan_stripping()
155 /* Strip VLAN tag from Rx packet and put it in the desc */ in ice_vsi_manage_vlan_stripping()
171 dev_err(ice_pf_to_dev(vsi->back), "update VSI for VLAN strip failed, ena = %d err %d aq_err %s\n", in ice_vsi_manage_vlan_stripping()
214 struct ice_vsi_vlan_info *vlan) in ice_save_vlan_info() argument
216 vlan->sw_flags2 = info->sw_flags2; in ice_save_vlan_info()
217 vlan->inner_vlan_flags = info->inner_vlan_flags; in ice_save_vlan_info()
218 vlan->outer_vlan_flags = info->outer_vlan_flags; in ice_save_vlan_info()
223 struct ice_vsi_vlan_info *vlan) in ice_restore_vlan_info() argument
225 info->sw_flags2 = vlan->sw_flags2; in ice_restore_vlan_info()
226 info->inner_vlan_flags = vlan->inner_vlan_flags; in ice_restore_vlan_info()
227 info->outer_vlan_flags = vlan->outer_vlan_flags; in ice_restore_vlan_info()
231 * __ice_vsi_set_inner_port_vlan - set port VLAN VSI context settings to enable a port VLAN
233 * @pvid_info: VLAN ID and QoS used to set the PVID VSI context field
260 dev_info(ice_hw_to_dev(hw), "update VSI for port VLAN failed, err %d aq_err %s\n", in __ice_vsi_set_inner_port_vlan()
273 int ice_vsi_set_inner_port_vlan(struct ice_vsi *vsi, struct ice_vlan *vlan) in ice_vsi_set_inner_port_vlan() argument
277 if (vlan->tpid != ETH_P_8021Q) in ice_vsi_set_inner_port_vlan()
280 if (vlan->prio > 7) in ice_vsi_set_inner_port_vlan()
283 port_vlan_info = vlan->vid | (vlan->prio << VLAN_PRIO_SHIFT); in ice_vsi_set_inner_port_vlan()
308 dev_err(ice_hw_to_dev(hw), "update VSI for port VLAN failed, err %d aq_err %s\n", in ice_vsi_clear_inner_port_vlan()
316 * ice_cfg_vlan_pruning - enable or disable VLAN pruning on the VSI
317 * @vsi: VSI to enable or disable VLAN pruning on
318 * @ena: set to true to enable VLAN pruning and false to disable it
331 /* Don't enable VLAN pruning if the netdev is currently in promiscuous in ice_cfg_vlan_pruning()
332 * mode. VLAN pruning will be enabled when the interface exits in ice_cfg_vlan_pruning()
333 * promiscuous mode if any VLAN filters are active. in ice_cfg_vlan_pruning()
354 …netdev_err(vsi->netdev, "%sabling VLAN pruning on VSI handle: %d, VSI HW ID: %d failed, err = %d, … in ice_cfg_vlan_pruning()
401 …dev_err(ice_pf_to_dev(vsi->back), "Failed to configure Tx VLAN anti-spoof %s for VSI %d, error %d\… in ice_cfg_vlan_antispoof()
447 * ice_vsi_ena_outer_stripping - enable outer VLAN stripping
449 * @tpid: TPID to enable outer VLAN stripping for
451 * Enable outer VLAN stripping via VSI context. This function should only be
459 * Only modify outer VLAN stripping settings and the VLAN TPID. Outer VLAN
462 * This enables hardware to strip a VLAN tag with the specified TPID to be
472 /* do not allow modifying VLAN stripping when a port VLAN is configured in ice_vsi_ena_outer_stripping()
487 /* clear current outer VLAN strip settings */ in ice_vsi_ena_outer_stripping()
499 …dev_err(ice_pf_to_dev(vsi->back), "update VSI for enabling outer VLAN stripping failed, err %d aq_… in ice_vsi_ena_outer_stripping()
509 * ice_vsi_dis_outer_stripping - disable outer VLAN stripping
512 * Disable outer VLAN stripping via VSI context. This function should only be
516 * Only modify the outer VLAN stripping settings. The VLAN TPID and outer VLAN
519 * This tells the hardware to not strip any VLAN tagged packets, thus leaving
520 * them in the packet. This enables software offloaded VLAN stripping and
521 * disables hardware offloaded VLAN stripping.
538 /* clear current outer VLAN strip settings */ in ice_vsi_dis_outer_stripping()
546 …dev_err(ice_pf_to_dev(vsi->back), "update VSI for disabling outer VLAN stripping failed, err %d aq… in ice_vsi_dis_outer_stripping()
556 * ice_vsi_ena_outer_insertion - enable outer VLAN insertion
558 * @tpid: TPID to enable outer VLAN insertion for
560 * Enable outer VLAN insertion via VSI context. This function should only be
568 * Only modify outer VLAN insertion settings and the VLAN TPID. Outer VLAN
571 * This allows a VLAN tag with the specified TPID to be inserted in the transmit
593 /* clear current outer VLAN insertion settings */ in ice_vsi_ena_outer_insertion()
606 …dev_err(ice_pf_to_dev(vsi->back), "update VSI for enabling outer VLAN insertion failed, err %d aq_… in ice_vsi_ena_outer_insertion()
616 * ice_vsi_dis_outer_insertion - disable outer VLAN insertion
619 * Disable outer VLAN insertion via VSI context. This function should only be
623 * Only modify the outer VLAN insertion settings. The VLAN TPID and outer VLAN
626 * This tells the hardware to not allow any VLAN tagged packets in the transmit
627 * descriptor. This enables software offloaded VLAN insertion and disables
628 * hardware offloaded VLAN insertion.
645 /* clear current outer VLAN insertion settings */ in ice_vsi_dis_outer_insertion()
656 …dev_err(ice_pf_to_dev(vsi->back), "update VSI for disabling outer VLAN insertion failed, err %d aq… in ice_vsi_dis_outer_insertion()
666 * __ice_vsi_set_outer_port_vlan - set the outer port VLAN and related settings
668 * @vlan_info: packed u16 that contains the VLAN prio and ID
669 * @tpid: TPID of the port VLAN
671 * Set the port VLAN prio, ID, and TPID.
673 * Enable VLAN pruning so the VSI doesn't receive any traffic that doesn't match
674 * a VLAN prune rule. The caller should take care to add a VLAN prune rule that
675 * matches the port VLAN ID and TPID.
677 * Tell hardware to strip outer VLAN tagged packets on receive and don't put
679 * the port VLAN ID or TPID they are assigned to.
681 * Tell hardware to prevent outer VLAN tag insertion on transmit and only allow
684 * Also, tell the hardware to insert the port VLAN on transmit.
722 …dev_err(ice_pf_to_dev(vsi->back), "update VSI for setting outer port based VLAN failed, err %d aq_… in __ice_vsi_set_outer_port_vlan()
737 * @vlan: ice_vlan structure used to set the port VLAN
739 * Set the outer port VLAN via VSI context. This function should only be
743 * Use the ice_vlan structure passed in to set this VSI in a port VLAN.
745 int ice_vsi_set_outer_port_vlan(struct ice_vsi *vsi, struct ice_vlan *vlan) in ice_vsi_set_outer_port_vlan() argument
749 if (vlan->prio > (VLAN_PRIO_MASK >> VLAN_PRIO_SHIFT)) in ice_vsi_set_outer_port_vlan()
752 port_vlan_info = vlan->vid | (vlan->prio << VLAN_PRIO_SHIFT); in ice_vsi_set_outer_port_vlan()
754 return __ice_vsi_set_outer_port_vlan(vsi, port_vlan_info, vlan->tpid); in ice_vsi_set_outer_port_vlan()
758 * ice_vsi_clear_outer_port_vlan - clear outer port vlan
761 * The function is restoring previously set vlan config (saved in
762 * vsi->vlan_info). Setting happens in port vlan configuration.
784 …dev_err(ice_pf_to_dev(vsi->back), "update VSI for clearing outer port based VLAN failed, err %d aq… in ice_vsi_clear_outer_port_vlan()
832 …dev_err(ice_pf_to_dev(vsi->back), "update VSI for clearing port based VLAN failed, err %d aq_err %… in ice_vsi_clear_port_vlan()