Lines Matching +full:current +full:- +full:speed
1 // SPDX-License-Identifier: GPL-2.0
11 * @v_opcode: opcodes for VF-PF communication
31 cmd->id = cpu_to_le32(vfid); in ice_aq_send_msg_to_vf()
39 return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd); in ice_aq_send_msg_to_vf()
58 * @adv_link_support: determines the format of the returned link speed
61 * Convert link speed supported by HW to link speed supported by virtchnl.
62 * If adv_link_support is true, then return link speed in Mbps. Else return
63 * link speed as a VIRTCHNL_LINK_SPEED_* casted to a u32. Note that the caller
66 * expect the speed in Mbps.
71 u32 index = fls(link_speed) - 1; in ice_conv_link_speed_to_virtchnl()
76 /* Virtchnl speeds are not defined for every speed supported in in ice_conv_link_speed_to_virtchnl()
78 * drivers, while reporting the speed the new speed values are in ice_conv_link_speed_to_virtchnl()
123 /* Using the highest value for an unsigned 16-bit value 0xFFFF to indicate that
129 * ice_mbx_reset_snapshot - Reset mailbox snapshot structure
139 memset(&snap->mbx_buf, 0, sizeof(snap->mbx_buf)); in ice_mbx_reset_snapshot()
140 snap->mbx_buf.state = ICE_MAL_VF_DETECT_STATE_NEW_SNAPSHOT; in ice_mbx_reset_snapshot()
143 list_for_each_entry(vf_info, &snap->mbx_vf, list_entry) in ice_mbx_reset_snapshot()
144 vf_info->msg_count = 0; in ice_mbx_reset_snapshot()
148 * ice_mbx_traverse - Pass through mailbox snapshot
162 snap_buf = &hw->mbx_snapshot.mbx_buf; in ice_mbx_traverse()
167 num_iterations = ICE_RQ_DATA_MASK(++snap_buf->num_iterations); in ice_mbx_traverse()
170 * Condition-1: If the number of iterations in the mailbox is equal to in ice_mbx_traverse()
173 * Condition-2: If the maximum messages serviced in the mailbox for a in ice_mbx_traverse()
177 * to the maximum number of mailbox entries serviced in current work item. in ice_mbx_traverse()
179 if (num_iterations == snap_buf->head || in ice_mbx_traverse()
180 (snap_buf->max_num_msgs_mbx < ICE_IGNORE_MAX_MSG_CNT && in ice_mbx_traverse()
181 ++snap_buf->num_msg_proc >= snap_buf->max_num_msgs_mbx)) in ice_mbx_traverse()
186 * ice_mbx_detect_malvf - Detect malicious VF in snapshot
202 vf_info->msg_count++; in ice_mbx_detect_malvf()
204 if (vf_info->msg_count >= ICE_ASYNC_VF_MSG_THRESHOLD) in ice_mbx_detect_malvf()
214 * ice_mbx_vf_state_handler - Handle states of the overflow algorithm
240 struct ice_mbx_snapshot *snap = &hw->mbx_snapshot; in ice_mbx_vf_state_handler()
242 struct ice_ctl_q_info *cq = &hw->mailboxq; in ice_mbx_vf_state_handler()
248 return -EINVAL; in ice_mbx_vf_state_handler()
255 /* Checking if max messages allowed to be processed while servicing current in ice_mbx_vf_state_handler()
258 if (mbx_data->max_num_msgs_mbx <= ICE_ASYNC_VF_MSG_THRESHOLD) in ice_mbx_vf_state_handler()
259 return -EINVAL; in ice_mbx_vf_state_handler()
264 * mailbox serviced in current interrupt. in ice_mbx_vf_state_handler()
266 if (mbx_data->async_watermark_val < ICE_ASYNC_VF_MSG_THRESHOLD || in ice_mbx_vf_state_handler()
267 mbx_data->async_watermark_val > mbx_data->max_num_msgs_mbx) in ice_mbx_vf_state_handler()
268 return -EINVAL; in ice_mbx_vf_state_handler()
271 snap_buf = &snap->mbx_buf; in ice_mbx_vf_state_handler()
273 switch (snap_buf->state) { in ice_mbx_vf_state_handler()
280 * Mailbox for current interrupt. in ice_mbx_vf_state_handler()
282 snap_buf->num_pending_arq = mbx_data->num_pending_arq; in ice_mbx_vf_state_handler()
283 snap_buf->num_msg_proc = mbx_data->num_msg_proc; in ice_mbx_vf_state_handler()
284 snap_buf->max_num_msgs_mbx = mbx_data->max_num_msgs_mbx; in ice_mbx_vf_state_handler()
290 snap_buf->head = ICE_RQ_DATA_MASK(cq->rq.next_to_clean + in ice_mbx_vf_state_handler()
291 mbx_data->num_pending_arq); in ice_mbx_vf_state_handler()
292 snap_buf->tail = ICE_RQ_DATA_MASK(cq->rq.next_to_clean - 1); in ice_mbx_vf_state_handler()
293 snap_buf->num_iterations = snap_buf->tail; in ice_mbx_vf_state_handler()
300 if (snap_buf->num_pending_arq >= in ice_mbx_vf_state_handler()
301 mbx_data->async_watermark_val) { in ice_mbx_vf_state_handler()
322 status = -EIO; in ice_mbx_vf_state_handler()
325 snap_buf->state = new_state; in ice_mbx_vf_state_handler()
328 if (is_malvf && !vf_info->malicious) { in ice_mbx_vf_state_handler()
329 vf_info->malicious = 1; in ice_mbx_vf_state_handler()
337 * ice_mbx_clear_malvf - Clear VF mailbox info
341 * current mailbox tracking state.
345 vf_info->malicious = 0; in ice_mbx_clear_malvf()
346 vf_info->msg_count = 0; in ice_mbx_clear_malvf()
350 * ice_mbx_init_vf_info - Initialize a new VF mailbox tracking info
362 struct ice_mbx_snapshot *snap = &hw->mbx_snapshot; in ice_mbx_init_vf_info()
365 list_add(&vf_info->list_entry, &snap->mbx_vf); in ice_mbx_init_vf_info()
369 * ice_mbx_init_snapshot - Initialize mailbox snapshot data
376 struct ice_mbx_snapshot *snap = &hw->mbx_snapshot; in ice_mbx_init_snapshot()
378 INIT_LIST_HEAD(&snap->mbx_vf); in ice_mbx_init_snapshot()