diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_common.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_common.c | 30 | 
1 files changed, 18 insertions, 12 deletions
| diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index 71d032cc5fa7..661beea6af79 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -45,6 +45,9 @@ static enum ice_status ice_set_mac_type(struct ice_hw *hw)  /**   * ice_clear_pf_cfg - Clear PF configuration   * @hw: pointer to the hardware structure + * + * Clears any existing PF configuration (VSIs, VSI lists, switch rules, port + * configuration, flow director filters, etc.).   */  enum ice_status ice_clear_pf_cfg(struct ice_hw *hw)  { @@ -1483,7 +1486,7 @@ enum ice_status ice_get_link_status(struct ice_port_info *pi, bool *link_up)  	struct ice_phy_info *phy_info;  	enum ice_status status = 0; -	if (!pi) +	if (!pi || !link_up)  		return ICE_ERR_PARAM;  	phy_info = &pi->phy; @@ -1619,20 +1622,23 @@ __ice_aq_get_set_rss_lut(struct ice_hw *hw, u16 vsi_id, u8 lut_type, u8 *lut,  	}  	/* LUT size is only valid for Global and PF table types */ -	if (lut_size == ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128) { -		flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128_FLAG << -			  ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) & -			 ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M; -	} else if (lut_size == ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512) { +	switch (lut_size) { +	case ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128: +		break; +	case ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512:  		flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512_FLAG <<  			  ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) &  			 ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M; -	} else if ((lut_size == ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K) && -		   (lut_type == ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF)) { -		flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K_FLAG << -			  ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) & -			 ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M; -	} else { +		break; +	case ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K: +		if (lut_type == ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF) { +			flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K_FLAG << +				  ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) & +				 ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M; +			break; +		} +		/* fall-through */ +	default:  		status = ICE_ERR_PARAM;  		goto ice_aq_get_set_rss_lut_exit;  	} |