diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_sriov.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_sriov.c | 40 | 
1 files changed, 20 insertions, 20 deletions
| diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c index aa11d07793d4..52c6bac41bf7 100644 --- a/drivers/net/ethernet/intel/ice/ice_sriov.c +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c @@ -18,7 +18,7 @@   * queue and asynchronously sending message via   * ice_sq_send_cmd() function   */ -enum ice_status +int  ice_aq_send_msg_to_vf(struct ice_hw *hw, u16 vfid, u32 v_opcode, u32 v_retval,  		      u8 *msg, u16 msglen, struct ice_sq_cd *cd)  { @@ -228,7 +228,7 @@ ice_mbx_traverse(struct ice_hw *hw,   * sent per VF and marks the VF as malicious if it exceeds   * the permissible number of messages to send.   */ -static enum ice_status +static int  ice_mbx_detect_malvf(struct ice_hw *hw, u16 vf_id,  		     enum ice_mbx_snapshot_state *new_state,  		     bool *is_malvf) @@ -236,7 +236,7 @@ ice_mbx_detect_malvf(struct ice_hw *hw, u16 vf_id,  	struct ice_mbx_snapshot *snap = &hw->mbx_snapshot;  	if (vf_id >= snap->mbx_vf.vfcntr_len) -		return ICE_ERR_OUT_OF_RANGE; +		return -EIO;  	/* increment the message count in the VF array */  	snap->mbx_vf.vf_cntr[vf_id]++; @@ -297,7 +297,7 @@ static void ice_mbx_reset_snapshot(struct ice_mbx_snapshot *snap)   * Detect: If pending message count exceeds watermark traverse   * the static snapshot and look for a malicious VF.   */ -enum ice_status +int  ice_mbx_vf_state_handler(struct ice_hw *hw,  			 struct ice_mbx_data *mbx_data, u16 vf_id,  			 bool *is_malvf) @@ -306,10 +306,10 @@ ice_mbx_vf_state_handler(struct ice_hw *hw,  	struct ice_mbx_snap_buffer_data *snap_buf;  	struct ice_ctl_q_info *cq = &hw->mailboxq;  	enum ice_mbx_snapshot_state new_state; -	enum ice_status status = 0; +	int status = 0;  	if (!is_malvf || !mbx_data) -		return ICE_ERR_BAD_PTR; +		return -EINVAL;  	/* When entering the mailbox state machine assume that the VF  	 * is not malicious until detected. @@ -320,7 +320,7 @@ ice_mbx_vf_state_handler(struct ice_hw *hw,  	  * interrupt is not less than the defined AVF message threshold.  	  */  	if (mbx_data->max_num_msgs_mbx <= ICE_ASYNC_VF_MSG_THRESHOLD) -		return ICE_ERR_INVAL_SIZE; +		return -EINVAL;  	/* The watermark value should not be lesser than the threshold limit  	 * set for the number of asynchronous messages a VF can send to mailbox @@ -329,7 +329,7 @@ ice_mbx_vf_state_handler(struct ice_hw *hw,  	 */  	if (mbx_data->async_watermark_val < ICE_ASYNC_VF_MSG_THRESHOLD ||  	    mbx_data->async_watermark_val > mbx_data->max_num_msgs_mbx) -		return ICE_ERR_PARAM; +		return -EINVAL;  	new_state = ICE_MAL_VF_DETECT_STATE_INVALID;  	snap_buf = &snap->mbx_buf; @@ -383,7 +383,7 @@ ice_mbx_vf_state_handler(struct ice_hw *hw,  	default:  		new_state = ICE_MAL_VF_DETECT_STATE_INVALID; -		status = ICE_ERR_CFG; +		status = -EIO;  	}  	snap_buf->state = new_state; @@ -405,20 +405,20 @@ ice_mbx_vf_state_handler(struct ice_hw *hw,   * the input vf_id against the bitmap to verify if the VF has been   * detected in any previous mailbox iterations.   */ -enum ice_status +int  ice_mbx_report_malvf(struct ice_hw *hw, unsigned long *all_malvfs,  		     u16 bitmap_len, u16 vf_id, bool *report_malvf)  {  	if (!all_malvfs || !report_malvf) -		return ICE_ERR_PARAM; +		return -EINVAL;  	*report_malvf = false;  	if (bitmap_len < hw->mbx_snapshot.mbx_vf.vfcntr_len) -		return ICE_ERR_INVAL_SIZE; +		return -EINVAL;  	if (vf_id >= bitmap_len) -		return ICE_ERR_OUT_OF_RANGE; +		return -EIO;  	/* If the vf_id is found in the bitmap set bit and boolean to true */  	if (!test_and_set_bit(vf_id, all_malvfs)) @@ -441,19 +441,19 @@ ice_mbx_report_malvf(struct ice_hw *hw, unsigned long *all_malvfs,   * that the new VF loaded is not considered malicious before going   * through the overflow detection algorithm.   */ -enum ice_status +int  ice_mbx_clear_malvf(struct ice_mbx_snapshot *snap, unsigned long *all_malvfs,  		    u16 bitmap_len, u16 vf_id)  {  	if (!snap || !all_malvfs) -		return ICE_ERR_PARAM; +		return -EINVAL;  	if (bitmap_len < snap->mbx_vf.vfcntr_len) -		return ICE_ERR_INVAL_SIZE; +		return -EINVAL;  	/* Ensure VF ID value is not larger than bitmap or VF counter length */  	if (vf_id >= bitmap_len || vf_id >= snap->mbx_vf.vfcntr_len) -		return ICE_ERR_OUT_OF_RANGE; +		return -EIO;  	/* Clear VF ID bit in the bitmap tracking malicious VFs attached to PF */  	clear_bit(vf_id, all_malvfs); @@ -482,7 +482,7 @@ ice_mbx_clear_malvf(struct ice_mbx_snapshot *snap, unsigned long *all_malvfs,   * called to ensure that the vf_count can be compared against the number   * of VFs supported as defined in the functional capabilities of the device.   */ -enum ice_status ice_mbx_init_snapshot(struct ice_hw *hw, u16 vf_count) +int ice_mbx_init_snapshot(struct ice_hw *hw, u16 vf_count)  {  	struct ice_mbx_snapshot *snap = &hw->mbx_snapshot; @@ -491,13 +491,13 @@ enum ice_status ice_mbx_init_snapshot(struct ice_hw *hw, u16 vf_count)  	 * the functional capabilities of the PF.  	 */  	if (!vf_count || vf_count > hw->func_caps.num_allocd_vfs) -		return ICE_ERR_INVAL_SIZE; +		return -EINVAL;  	snap->mbx_vf.vf_cntr = devm_kcalloc(ice_hw_to_dev(hw), vf_count,  					    sizeof(*snap->mbx_vf.vf_cntr),  					    GFP_KERNEL);  	if (!snap->mbx_vf.vf_cntr) -		return ICE_ERR_NO_MEMORY; +		return -ENOMEM;  	/* Setting the VF counter length to the number of allocated  	 * VFs for given PF's functional capabilities. |