aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_lib.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-08-24 19:46:45 -0400
committerDavid S. Miller <davem@davemloft.net>2019-08-24 19:46:45 -0400
commita914a84110354925afbae72d2ade97773e018abd (patch)
treeee4ae3e7745ca830e3e669946429af6e615ab84d /drivers/net/ethernet/intel/ice/ice_lib.c
parentace4cedea934618024dec2f5664b1777b5dc56c6 (diff)
parent8b2c858240aca43c59fc7762f10754354406883d (diff)
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 100GbE Intel Wired LAN Driver Updates 2019-08-23 This series contains updates to ice driver only. Dave adds logic for the necessary bits to be set in the VSI context for the PF_VSI and the TX_descriptors for control packets egressing the PF_VSI. Updated the logic to detect both DCBx and LLDP states in the firmware engine to account for situations where DCBx is enabled and LLDP is disabled. Fixed the driver to treat the DCBx state of "NOT_STARTED" as a valid state and should not assume "is_fw_lldp" true automatically. Since "enable-fw-lldp" flag was confusing and cumbersome, change the flag to "fw-lldp-agent" with a value of on or off to help clarify whether the LLDP agent is running or not. Brett fixes an issue where synchronize_irq() was being called from the host of VF's, which should not be done. Michal fixed an issue when rebuilding the DCBx configuration while in IEEE mode versus CEE mode, so add a check before copying the configuration value to ensure we are only in CEE mode. Jake fixes the PF to reject any VF request to setup head writeback since the support has been deprecated. Mitch adds an additional check to ensure the VF is active before sending out an error message that a message was unable to be sent to a particular VF. Chinh updates the driver to use "topology" mode when checking the PHY for status, since this mode provides us the current module type that is available. Fixes the driver from clearing the auto_fec_enable bit which was blocking a user from forcing non-spec compliant FEC configurations. Amruth does a refactor on the code to first check, then assign in the virtual channel space. Bruce updates the driver to actually update the stats when a user runs the ethtool command 'ethtool -S <iface>' instead of providing a snapshot of the stats that maybe from a second ago. Akeem fixes up the adding/removing of VSI MAC filters for VFs, so that VFs cannot add/remove a filter from another VSI. We now track the number of filters added right from when the VF resources get allocated and won't get into MAC filter mis-match issue in the switch. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_lib.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_lib.c45
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 */
3193enum ice_status
3194ice_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
3210cfg_mac_fltr_exit:
3211 ice_free_fltr_list(&vsi->back->pdev->dev, &tmp_add_list);
3212 return status;
3213}