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()
49 dev_err(ice_pf_to_dev(vsi->back), "Failure Adding VLAN %d on VSI %i, status %d\n", in ice_vsi_add_vlan()
50 vlan->vid, vsi->vsi_num, err); in ice_vsi_add_vlan()
59 * ice_vsi_del_vlan - default del VLAN implementation for all VSI types
61 * @vlan: VLAN filter to delete
63 int ice_vsi_del_vlan(struct ice_vsi *vsi, struct ice_vlan *vlan) in ice_vsi_del_vlan() argument
69 if (!validate_vlan(vsi, vlan)) in ice_vsi_del_vlan()
74 err = ice_fltr_remove_vlan(vsi, vlan); in ice_vsi_del_vlan()
80 dev_err(dev, "Error removing VLAN %d on VSI %i error: %d\n", in ice_vsi_del_vlan()
81 vlan->vid, vsi->vsi_num, err); in ice_vsi_del_vlan()
87 * ice_vsi_manage_vlan_insertion - Manage VLAN insertion for the VSI for Tx
100 /* Here we are configuring the VSI to let the driver add VLAN tags by in ice_vsi_manage_vlan_insertion()
101 * setting inner_vlan_flags to ICE_AQ_VSI_INNER_VLAN_TX_MODE_ALL. The actual VLAN tag in ice_vsi_manage_vlan_insertion()
106 /* Preserve existing VLAN strip setting */ in ice_vsi_manage_vlan_insertion()
114 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()
126 * ice_vsi_manage_vlan_stripping - Manage VLAN stripping for the VSI for Rx
137 /* do not allow modifying VLAN stripping when a port VLAN is configured in ice_vsi_manage_vlan_stripping()
149 /* Here we are configuring what the VSI should do with the VLAN tag in in ice_vsi_manage_vlan_stripping()
154 /* Strip VLAN tag from Rx packet and put it in the desc */ in ice_vsi_manage_vlan_stripping()
170 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()
213 struct ice_vsi_vlan_info *vlan) in ice_save_vlan_info() argument
215 vlan->sw_flags2 = info->sw_flags2; in ice_save_vlan_info()
216 vlan->inner_vlan_flags = info->inner_vlan_flags; in ice_save_vlan_info()
217 vlan->outer_vlan_flags = info->outer_vlan_flags; in ice_save_vlan_info()
222 struct ice_vsi_vlan_info *vlan) in ice_restore_vlan_info() argument
224 info->sw_flags2 = vlan->sw_flags2; in ice_restore_vlan_info()
225 info->inner_vlan_flags = vlan->inner_vlan_flags; in ice_restore_vlan_info()
226 info->outer_vlan_flags = vlan->outer_vlan_flags; in ice_restore_vlan_info()
230 * __ice_vsi_set_inner_port_vlan - set port VLAN VSI context settings to enable a port VLAN
232 * @pvid_info: VLAN ID and QoS used to set the PVID VSI context field
259 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()
272 int ice_vsi_set_inner_port_vlan(struct ice_vsi *vsi, struct ice_vlan *vlan) in ice_vsi_set_inner_port_vlan() argument
276 if (vlan->tpid != ETH_P_8021Q) in ice_vsi_set_inner_port_vlan()
279 if (vlan->prio > 7) in ice_vsi_set_inner_port_vlan()
282 port_vlan_info = vlan->vid | (vlan->prio << VLAN_PRIO_SHIFT); in ice_vsi_set_inner_port_vlan()
307 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()
315 * ice_cfg_vlan_pruning - enable or disable VLAN pruning on the VSI
316 * @vsi: VSI to enable or disable VLAN pruning on
317 * @ena: set to true to enable VLAN pruning and false to disable it
330 /* Don't enable VLAN pruning if the netdev is currently in promiscuous in ice_cfg_vlan_pruning()
331 * mode. VLAN pruning will be enabled when the interface exits in ice_cfg_vlan_pruning()
332 * promiscuous mode if any VLAN filters are active. in ice_cfg_vlan_pruning()
353 …netdev_err(vsi->netdev, "%sabling VLAN pruning on VSI handle: %d, VSI HW ID: %d failed, err = %d, … in ice_cfg_vlan_pruning()
400 …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()
446 * ice_vsi_ena_outer_stripping - enable outer VLAN stripping
448 * @tpid: TPID to enable outer VLAN stripping for
450 * Enable outer VLAN stripping via VSI context. This function should only be
458 * Only modify outer VLAN stripping settings and the VLAN TPID. Outer VLAN
461 * This enables hardware to strip a VLAN tag with the specified TPID to be
471 /* do not allow modifying VLAN stripping when a port VLAN is configured in ice_vsi_ena_outer_stripping()
486 /* clear current outer VLAN strip settings */ in ice_vsi_ena_outer_stripping()
498 …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()
508 * ice_vsi_dis_outer_stripping - disable outer VLAN stripping
511 * Disable outer VLAN stripping via VSI context. This function should only be
515 * Only modify the outer VLAN stripping settings. The VLAN TPID and outer VLAN
518 * This tells the hardware to not strip any VLAN tagged packets, thus leaving
519 * them in the packet. This enables software offloaded VLAN stripping and
520 * disables hardware offloaded VLAN stripping.
537 /* clear current outer VLAN strip settings */ in ice_vsi_dis_outer_stripping()
545 …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()
555 * ice_vsi_ena_outer_insertion - enable outer VLAN insertion
557 * @tpid: TPID to enable outer VLAN insertion for
559 * Enable outer VLAN insertion via VSI context. This function should only be
567 * Only modify outer VLAN insertion settings and the VLAN TPID. Outer VLAN
570 * This allows a VLAN tag with the specified TPID to be inserted in the transmit
592 /* clear current outer VLAN insertion settings */ in ice_vsi_ena_outer_insertion()
605 …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()
615 * ice_vsi_dis_outer_insertion - disable outer VLAN insertion
618 * Disable outer VLAN insertion via VSI context. This function should only be
622 * Only modify the outer VLAN insertion settings. The VLAN TPID and outer VLAN
625 * This tells the hardware to not allow any VLAN tagged packets in the transmit
626 * descriptor. This enables software offloaded VLAN insertion and disables
627 * hardware offloaded VLAN insertion.
644 /* clear current outer VLAN insertion settings */ in ice_vsi_dis_outer_insertion()
655 …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()
665 * __ice_vsi_set_outer_port_vlan - set the outer port VLAN and related settings
667 * @vlan_info: packed u16 that contains the VLAN prio and ID
668 * @tpid: TPID of the port VLAN
670 * Set the port VLAN prio, ID, and TPID.
672 * Enable VLAN pruning so the VSI doesn't receive any traffic that doesn't match
673 * a VLAN prune rule. The caller should take care to add a VLAN prune rule that
674 * matches the port VLAN ID and TPID.
676 * Tell hardware to strip outer VLAN tagged packets on receive and don't put
678 * the port VLAN ID or TPID they are assigned to.
680 * Tell hardware to prevent outer VLAN tag insertion on transmit and only allow
683 * Also, tell the hardware to insert the port VLAN on transmit.
721 …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()
736 * @vlan: ice_vlan structure used to set the port VLAN
738 * Set the outer port VLAN via VSI context. This function should only be
742 * Use the ice_vlan structure passed in to set this VSI in a port VLAN.
744 int ice_vsi_set_outer_port_vlan(struct ice_vsi *vsi, struct ice_vlan *vlan) in ice_vsi_set_outer_port_vlan() argument
748 if (vlan->prio > (VLAN_PRIO_MASK >> VLAN_PRIO_SHIFT)) in ice_vsi_set_outer_port_vlan()
751 port_vlan_info = vlan->vid | (vlan->prio << VLAN_PRIO_SHIFT); in ice_vsi_set_outer_port_vlan()
753 return __ice_vsi_set_outer_port_vlan(vsi, port_vlan_info, vlan->tpid); in ice_vsi_set_outer_port_vlan()
757 * ice_vsi_clear_outer_port_vlan - clear outer port vlan
760 * The function is restoring previously set vlan config (saved in
761 * vsi->vlan_info). Setting happens in port vlan configuration.
783 …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()