linux-mainline/drivers/net/ethernet/intel
Jacob Keller be96815c61 ice: call ice_is_malicious_vf() from ice_vc_process_vf_msg()
The main loop in __ice_clean_ctrlq first checks if a VF might be malicious
before calling ice_vc_process_vf_msg(). This results in duplicate code in
both functions to obtain a reference to the VF, and exports the
ice_is_malicious_vf() from ice_virtchnl.c unnecessarily.

Refactor ice_is_malicious_vf() to be a static function that takes a pointer
to the VF. Call this in ice_vc_process_vf_msg() just after we obtain a
reference to the VF by calling ice_get_vf_by_id.

Pass the mailbox data from the __ice_clean_ctrlq function into
ice_vc_process_vf_msg() instead of calling ice_is_malicious_vf().

This reduces the number of exported functions and avoids the need to obtain
the VF reference twice for every mailbox message.

Note that the state check for ICE_VF_STATE_DIS is kept in
ice_is_malicious_vf() and we call this before checking that state in
ice_vc_process_vf_msg. This is intentional, as we stop responding to VF
messages from a VF once we detect that it may be overflowing the mailbox.
This ensures that we continue to silently ignore the message as before
without responding via ice_vc_send_msg_to_vf().

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>
2023-03-13 11:06:06 -07:00
..
e1000
e1000e e1000e: Remove unnecessary aer.h include 2023-03-08 23:34:39 -08:00
fm10k fm10k: Remove unnecessary aer.h include 2023-03-08 23:34:39 -08:00
i40e i40e: Remove unnecessary aer.h include 2023-03-08 23:34:39 -08:00
iavf iavf: Remove unnecessary aer.h include 2023-03-08 23:34:39 -08:00
ice ice: call ice_is_malicious_vf() from ice_vc_process_vf_msg() 2023-03-13 11:06:06 -07:00
igb igb: Remove unnecessary aer.h include 2023-03-08 23:34:39 -08:00
igbvf
igc Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 2023-03-09 23:35:49 -08:00
ixgb
ixgbe ixgbe: Remove unnecessary aer.h include 2023-03-08 23:34:39 -08:00
ixgbevf drivers: net: turn on XDP features 2023-02-02 20:48:23 -08:00
e100.c
Kconfig ice: remove unnecessary CONFIG_ICE_GNSS 2023-02-26 14:53:09 +00:00
Makefile