diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_lib.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_lib.c | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 6e34c40e7840..8d5d6635a123 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c | |||
| @@ -1010,6 +1010,13 @@ static int ice_vsi_init(struct ice_vsi *vsi) | |||
| 1010 | ICE_AQ_VSI_SEC_FLAG_ENA_MAC_ANTI_SPOOF; | 1010 | ICE_AQ_VSI_SEC_FLAG_ENA_MAC_ANTI_SPOOF; |
| 1011 | } | 1011 | } |
| 1012 | 1012 | ||
| 1013 | /* Allow control frames out of main VSI */ | ||
| 1014 | if (vsi->type == ICE_VSI_PF) { | ||
| 1015 | ctxt->info.sec_flags |= ICE_AQ_VSI_SEC_FLAG_ALLOW_DEST_OVRD; | ||
| 1016 | ctxt->info.valid_sections |= | ||
| 1017 | cpu_to_le16(ICE_AQ_VSI_PROP_SECURITY_VALID); | ||
| 1018 | } | ||
| 1019 | |||
| 1013 | ret = ice_add_vsi(hw, vsi->idx, ctxt, NULL); | 1020 | ret = ice_add_vsi(hw, vsi->idx, ctxt, NULL); |
| 1014 | if (ret) { | 1021 | if (ret) { |
| 1015 | dev_err(&pf->pdev->dev, | 1022 | dev_err(&pf->pdev->dev, |
| @@ -2534,7 +2541,7 @@ ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi, | |||
| 2534 | ice_cfg_sw_lldp(vsi, true, true); | 2541 | ice_cfg_sw_lldp(vsi, true, true); |
| 2535 | 2542 | ||
| 2536 | /* Rx LLDP packets */ | 2543 | /* Rx LLDP packets */ |
| 2537 | if (!test_bit(ICE_FLAG_ENABLE_FW_LLDP, pf->flags)) | 2544 | if (!test_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags)) |
| 2538 | ice_cfg_sw_lldp(vsi, false, true); | 2545 | ice_cfg_sw_lldp(vsi, false, true); |
| 2539 | } | 2546 | } |
| 2540 | 2547 | ||
| @@ -2810,6 +2817,10 @@ void ice_vsi_dis_irq(struct ice_vsi *vsi) | |||
| 2810 | 2817 | ||
| 2811 | ice_flush(hw); | 2818 | ice_flush(hw); |
| 2812 | 2819 | ||
| 2820 | /* don't call synchronize_irq() for VF's from the host */ | ||
| 2821 | if (vsi->type == ICE_VSI_VF) | ||
| 2822 | return; | ||
| 2823 | |||
| 2813 | ice_for_each_q_vector(vsi, i) | 2824 | ice_for_each_q_vector(vsi, i) |
| 2814 | synchronize_irq(pf->msix_entries[i + base].vector); | 2825 | synchronize_irq(pf->msix_entries[i + base].vector); |
| 2815 | } | 2826 | } |
| @@ -2877,7 +2888,7 @@ int ice_vsi_release(struct ice_vsi *vsi) | |||
| 2877 | /* The Rx rule will only exist to remove if the LLDP FW | 2888 | /* The Rx rule will only exist to remove if the LLDP FW |
| 2878 | * engine is currently stopped | 2889 | * engine is currently stopped |
| 2879 | */ | 2890 | */ |
| 2880 | if (!test_bit(ICE_FLAG_ENABLE_FW_LLDP, pf->flags)) | 2891 | if (!test_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags)) |
| 2881 | ice_cfg_sw_lldp(vsi, false, false); | 2892 | ice_cfg_sw_lldp(vsi, false, false); |
| 2882 | } | 2893 | } |
| 2883 | 2894 | ||
| @@ -3170,3 +3181,33 @@ out: | |||
| 3170 | return ret; | 3181 | return ret; |
| 3171 | } | 3182 | } |
| 3172 | #endif /* CONFIG_DCB */ | 3183 | #endif /* CONFIG_DCB */ |
| 3184 | |||
| 3185 | /** | ||
| 3186 | * ice_vsi_cfg_mac_fltr - Add or remove a MAC address filter for a VSI | ||
| 3187 | * @vsi: the VSI being configured MAC filter | ||
| 3188 | * @macaddr: the MAC address to be added. | ||
| 3189 | * @set: Add or delete a MAC filter | ||
| 3190 | * | ||
| 3191 | * Adds or removes MAC address filter entry for VF VSI | ||
| 3192 | */ | ||
| 3193 | enum ice_status | ||
| 3194 | ice_vsi_cfg_mac_fltr(struct ice_vsi *vsi, const u8 *macaddr, bool set) | ||
| 3195 | { | ||
| 3196 | LIST_HEAD(tmp_add_list); | ||
| 3197 | enum ice_status status; | ||
| 3198 | |||
| 3199 | /* Update MAC filter list to be added or removed for a VSI */ | ||
| 3200 | if (ice_add_mac_to_list(vsi, &tmp_add_list, macaddr)) { | ||
| 3201 | status = ICE_ERR_NO_MEMORY; | ||
| 3202 | goto cfg_mac_fltr_exit; | ||
| 3203 | } | ||
| 3204 | |||
| 3205 | if (set) | ||
| 3206 | status = ice_add_mac(&vsi->back->hw, &tmp_add_list); | ||
| 3207 | else | ||
| 3208 | status = ice_remove_mac(&vsi->back->hw, &tmp_add_list); | ||
| 3209 | |||
| 3210 | cfg_mac_fltr_exit: | ||
| 3211 | ice_free_fltr_list(&vsi->back->pdev->dev, &tmp_add_list); | ||
| 3212 | return status; | ||
| 3213 | } | ||
