diff options
| author | Jacob Keller <jacob.e.keller@intel.com> | 2023-02-22 09:09:17 -0800 | 
|---|---|---|
| committer | Tony Nguyen <anthony.l.nguyen@intel.com> | 2023-03-13 11:06:06 -0700 | 
| commit | afc24d6584fbd246d98c0feb464b94da67661e3e (patch) | |
| tree | 574d8f949e0f63589786b07779f82de5f876a991 /drivers/net/ethernet/intel/ice/ice_main.c | |
| parent | 3f22fc3131b814f0d5d1ce6d94fb8239e6df1754 (diff) | |
ice: pass mbxdata to ice_is_malicious_vf()
The ice_is_malicious_vf() function takes information about the current
state of the mailbox during a single interrupt. This information includes
the number of messages processed so far, as well as the number of pending
messages not yet processed.
A future refactor is going to make ice_vc_process_vf_msg() call
ice_is_malicious_vf() instead of having it called separately in ice_main.c
This change will require passing all the necessary arguments into
ice_vc_process_vf_msg().
To make this simpler, have the main loop fill in the struct ice_mbx_data
and pass that rather than passing in the num_msg_proc and num_msg_pending.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: Marek Szlosek <marek.szlosek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_main.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_main.c | 10 | 
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 615a731d7afe..a7e7a186009e 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -1393,6 +1393,8 @@ static void ice_aq_cancel_waiting_tasks(struct ice_pf *pf)  	wake_up(&pf->aq_wait_queue);  } +#define ICE_MBX_OVERFLOW_WATERMARK 64 +  /**   * __ice_clean_ctrlq - helper function to clean controlq rings   * @pf: ptr to struct ice_pf @@ -1483,6 +1485,7 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)  		return 0;  	do { +		struct ice_mbx_data data = {};  		u16 opcode;  		int ret; @@ -1509,7 +1512,12 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)  			ice_vf_lan_overflow_event(pf, &event);  			break;  		case ice_mbx_opc_send_msg_to_pf: -			if (!ice_is_malicious_vf(pf, &event, i, pending)) +			data.num_msg_proc = i; +			data.num_pending_arq = pending; +			data.max_num_msgs_mbx = hw->mailboxq.num_rq_entries; +			data.async_watermark_val = ICE_MBX_OVERFLOW_WATERMARK; + +			if (!ice_is_malicious_vf(pf, &event, &data))  				ice_vc_process_vf_msg(pf, &event);  			break;  		case ice_aqc_opc_fw_logging:  | 
