Lines Matching +full:current +full:- +full:speed

1 /* SPDX-License-Identifier: BSD-3-Clause */
40 * @v_opcode: opcodes for VF-PF communication
60 cmd->id = CPU_TO_LE32(vfid); in ice_aq_send_msg_to_vf()
68 return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd); in ice_aq_send_msg_to_vf()
74 * @v_opcode: opcodes for VF-PF communication
98 return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd); in ice_aq_send_msg_to_pf()
117 * @adv_link_support: determines the format of the returned link speed
120 * Convert link speed supported by HW to link speed supported by virtchnl.
121 * If adv_link_support is true, then return link speed in Mbps. Else return
122 * link speed as a VIRTCHNL_LINK_SPEED_* casted to a u32. Note that the caller
125 * expect the speed in Mbps.
130 u16 index = (u16)(ice_fls(link_speed) - 1); in ice_conv_link_speed_to_virtchnl()
135 /* Virtchnl speeds are not defined for every speed supported in in ice_conv_link_speed_to_virtchnl()
137 * drivers, while reporting the speed the new speed values are in ice_conv_link_speed_to_virtchnl()
182 /* Using the highest value for an unsigned 16-bit value 0xFFFF to indicate that
188 * ice_mbx_reset_snapshot - Initialize mailbox snapshot structure
198 ice_memset(&snap->mbx_buf, 0, sizeof(snap->mbx_buf), ICE_NONDMA_MEM); in ice_mbx_reset_snapshot()
199 snap->mbx_buf.state = ICE_MAL_VF_DETECT_STATE_NEW_SNAPSHOT; in ice_mbx_reset_snapshot()
202 LIST_FOR_EACH_ENTRY(vf_info, &snap->mbx_vf, ice_mbx_vf_info, list_entry) in ice_mbx_reset_snapshot()
203 vf_info->msg_count = 0; in ice_mbx_reset_snapshot()
207 * ice_mbx_traverse - Pass through mailbox snapshot
221 snap_buf = &hw->mbx_snapshot.mbx_buf; in ice_mbx_traverse()
226 num_iterations = ICE_RQ_DATA_MASK(++snap_buf->num_iterations); in ice_mbx_traverse()
229 * Condition-1: If the number of iterations in the mailbox is equal to in ice_mbx_traverse()
232 * Condition-2: If the maximum messages serviced in the mailbox for a in ice_mbx_traverse()
236 * to the maximum number of mailbox entries serviced in current work item. in ice_mbx_traverse()
238 if (num_iterations == snap_buf->head || in ice_mbx_traverse()
239 (snap_buf->max_num_msgs_mbx < ICE_IGNORE_MAX_MSG_CNT && in ice_mbx_traverse()
240 ++snap_buf->num_msg_proc >= snap_buf->max_num_msgs_mbx)) in ice_mbx_traverse()
245 * ice_mbx_detect_malvf - Detect malicious VF in snapshot
261 vf_info->msg_count++; in ice_mbx_detect_malvf()
263 if (vf_info->msg_count >= ICE_ASYNC_VF_MSG_THRESHOLD) in ice_mbx_detect_malvf()
273 * ice_e830_mbx_vf_dec_trig - Decrements the VF mailbox queue counter
284 u16 vfid = LE16_TO_CPU(event->desc.retval); in ice_e830_mbx_vf_dec_trig()
290 * ice_mbx_vf_clear_cnt_e830 - Clear the VF mailbox queue count
305 * ice_mbx_vf_state_handler - Handle states of the overflow algorithm
331 struct ice_mbx_snapshot *snap = &hw->mbx_snapshot; in ice_mbx_vf_state_handler()
333 struct ice_ctl_q_info *cq = &hw->mailboxq; in ice_mbx_vf_state_handler()
346 /* Checking if max messages allowed to be processed while servicing current in ice_mbx_vf_state_handler()
349 if (mbx_data->max_num_msgs_mbx <= ICE_ASYNC_VF_MSG_THRESHOLD) in ice_mbx_vf_state_handler()
355 * mailbox serviced in current interrupt. in ice_mbx_vf_state_handler()
357 if (mbx_data->async_watermark_val < ICE_ASYNC_VF_MSG_THRESHOLD || in ice_mbx_vf_state_handler()
358 mbx_data->async_watermark_val > mbx_data->max_num_msgs_mbx) in ice_mbx_vf_state_handler()
362 snap_buf = &snap->mbx_buf; in ice_mbx_vf_state_handler()
364 switch (snap_buf->state) { in ice_mbx_vf_state_handler()
371 * Mailbox for current interrupt. in ice_mbx_vf_state_handler()
373 snap_buf->num_pending_arq = mbx_data->num_pending_arq; in ice_mbx_vf_state_handler()
374 snap_buf->num_msg_proc = mbx_data->num_msg_proc; in ice_mbx_vf_state_handler()
375 snap_buf->max_num_msgs_mbx = mbx_data->max_num_msgs_mbx; in ice_mbx_vf_state_handler()
381 snap_buf->head = ICE_RQ_DATA_MASK(cq->rq.next_to_clean + in ice_mbx_vf_state_handler()
382 mbx_data->num_pending_arq); in ice_mbx_vf_state_handler()
383 snap_buf->tail = ICE_RQ_DATA_MASK(cq->rq.next_to_clean - 1); in ice_mbx_vf_state_handler()
384 snap_buf->num_iterations = snap_buf->tail; in ice_mbx_vf_state_handler()
391 if (snap_buf->num_pending_arq >= in ice_mbx_vf_state_handler()
392 mbx_data->async_watermark_val) { in ice_mbx_vf_state_handler()
416 snap_buf->state = new_state; in ice_mbx_vf_state_handler()
419 if (is_malvf && !vf_info->malicious) { in ice_mbx_vf_state_handler()
420 vf_info->malicious = 1; in ice_mbx_vf_state_handler()
428 * ice_mbx_clear_malvf - Clear VF mailbox info
432 * current mailbox tracking state.
436 vf_info->malicious = 0; in ice_mbx_clear_malvf()
437 vf_info->msg_count = 0; in ice_mbx_clear_malvf()
441 * ice_mbx_init_vf_info - Initialize a new VF mailbox tracking info
453 struct ice_mbx_snapshot *snap = &hw->mbx_snapshot; in ice_mbx_init_vf_info()
456 LIST_ADD(&vf_info->list_entry, &snap->mbx_vf); in ice_mbx_init_vf_info()
460 * ice_mbx_init_snapshot - Initialize mailbox snapshot data
467 struct ice_mbx_snapshot *snap = &hw->mbx_snapshot; in ice_mbx_init_snapshot()
469 INIT_LIST_HEAD(&snap->mbx_vf); in ice_mbx_init_snapshot()