[Intel-wired-lan] [net PATCH 1/2] i40e: stop disabling VFs due to PF error responses

Jankowski, Konrad0 konrad0.jankowski at intel.com
Wed Mar 2 21:27:57 UTC 2022



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
> Jacob Keller
> Sent: Thursday, February 17, 2022 1:52 AM
> To: Intel Wired LAN <intel-wired-lan at lists.osuosl.org>
> Subject: [Intel-wired-lan] [net PATCH 1/2] i40e: stop disabling VFs due to PF
> error responses
> 
> The i40e_vc_send_msg_to_vf_ex (and its wrapper
> i40e_vc_send_msg_to_vf) function has logic to detect "failure" responses
> sent to the VF. If a VF is sent more than
> I40E_DEFAULT_NUM_INVALID_MSGS_ALLOWED, then the VF is marked as
> disabled. In either case, a dev_info message is printed stating that a VF
> opcode failed.
> 
> This logic originates from the early implementation of VF support in commit
> 5c3c48ac6bf5 ("i40e: implement virtual device interface").
> 
> That commit did not go far enough. The "logic" for this behavior seems to be
> that error responses somehow indicate a malicious VF. This is not really true.
> The PF might be sending an error for any number of reasons such as lacking
> resources, an unsupported operation, etc. This does not indicate a malicious
> VF. We already have a separate robust malicious VF detection which relies on
> hardware logic to detect and prevent a variety of behaviors.
> 
> There is no justification for this behavior in the original implementation. In
> fact, a later commit 18b7af57d9c1 ("i40e: Lower some message levels")
> reduced the opcode failure message from a dev_err to a dev_info. In
> addition, recent commit 01cbf50877e6 ("i40e: Fix to not show opcode msg on
> unsuccessful VF MAC change") changed the logic to allow quieting it for
> expected failures.
> 
> That commit prevented this logic from kicking in for specific circumstances.
> This change did not go far enough. The behavior is not documented nor is it
> part of any requirement for our products. Other operating systems such as
> the FreeBSD implementation of our driver do not include this logic.
> 
> It is clear this check does not make sense, and causes problems which led to
> ugly workarounds.
> 
> Fix this by just removing the entire logic and the need for the
> i40e_vc_send_msg_to_vf_ex function.
> 
> Fixes: 01cbf50877e6 ("i40e: Fix to not show opcode msg on unsuccessful VF
> MAC change")
> Fixes: 5c3c48ac6bf5 ("i40e: implement virtual device interface")
> Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
> ---
>  .../net/ethernet/intel/i40e/i40e_debugfs.c    |  6 +-
>  .../ethernet/intel/i40e/i40e_virtchnl_pf.c    | 57 +++----------------
>  .../ethernet/intel/i40e/i40e_virtchnl_pf.h    |  5 --
>  3 files changed, 9 insertions(+), 59 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> index 1e57cc8c47d7..9db5001297c7 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> @@ -742,10 +742,8 @@ static void i40e_dbg_dump_vf(struct i40e_pf *pf, int
> vf_id)

Tested-by: Konrad Jankowski <konrad0.jankowski at intel.com>


More information about the Intel-wired-lan mailing list