Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
	<intel-wired-lan@lists.osuosl.org>
Cc: <netdev@vger.kernel.org>,
	Jan Sokolowski <jan.sokolowski@intel.com>,
	Padraig J Connolly <padraig.j.connolly@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v4444] i40e: add ability to reset VF for Tx and Rx MDD events
Date: Mon, 4 Nov 2024 09:19:51 -0800	[thread overview]
Message-ID: <a91c5981-ffd3-4c52-8b84-e81b506f0869@intel.com> (raw)
In-Reply-To: <20241029123637.1974604-1-aleksandr.loktionov@intel.com>



On 10/29/2024 5:36 AM, Aleksandr Loktionov wrote:
> Implement "mdd-auto-reset-vf" priv-flag to handle Tx and Rx MDD events for VFs.
> This flag is also used in other network adapters like ICE.
> 
> Usage:
> - "on"  - The problematic VF will be automatically reset
> 	  if a malformed descriptor is detected.
> - "off" - The problematic VF will be disabled.
> 
> In cases where a VF sends malformed packets classified as malicious, it can
> cause the Tx queue to freeze, rendering it unusable for several minutes. When
> an MDD event occurs, this new implementation allows for a graceful VF reset to
> quickly restore operational state.
> 
> Currently, VF iqueues are disabled if an MDD event occurs. This patch adds the
> ability to reset the VF if a Tx or Rx MDD event occurs. It also includes MDD
> event logging throttling to avoid dmesg pollution and unifies the format of
> Tx and Rx MDD messages.
> 
> Note: Standard message rate limiting functions like dev_info_ratelimited()
> do not meet our requirements. Custom rate limiting is implemented,
> please see the code for details.
> 
> Co-developed-by: Jan Sokolowski <jan.sokolowski@intel.com>
> Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
> Co-developed-by: Padraig J Connolly <padraig.j.connolly@intel.com>
> Signed-off-by:  Padraig J Connolly <padraig.j.connolly@intel.com>
> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
>   drivers/net/ethernet/intel/i40e/i40e.h        |   4 +-
>   .../net/ethernet/intel/i40e/i40e_debugfs.c    |   2 +-
>   .../net/ethernet/intel/i40e/i40e_ethtool.c    |   2 +
>   drivers/net/ethernet/intel/i40e/i40e_main.c   | 105 ++++++++++++++++--
>   .../ethernet/intel/i40e/i40e_virtchnl_pf.c    |   2 +-
>   .../ethernet/intel/i40e/i40e_virtchnl_pf.h    |  11 +-

Could you add info on this to the i40e Documentation/

>   6 files changed, 111 insertions(+), 15 deletions(-)

...

> +/**
> + * i40e_print_vf_mdd_event - print VF Tx/Rx malicious driver detect event
> + * @pf: board private structure
> + * @vf: pointer to the VF structure
> + * @is_tx: true - for Tx event, false - for  Rx
> + */
> +static void i40e_print_vf_mdd_event(struct i40e_pf *pf, struct i40e_vf *vf,
> +				       bool is_tx)
> +{
> +	dev_err(&pf->pdev->dev, is_tx ?
> +		"%lld Tx Malicious Driver Detection events detected on PF %d VF %d MAC %pm. mdd-auto-reset-vfs=%s\n" :
> +		"%lld Rx Malicious Driver Detection events detected on PF %d VF %d MAC %pm. mdd-auto-reset-vfs=%s\n",

This string is largely duplicated. Seems is_tx could adjust Tx/Rx only?

> +		vf->mdd_rx_events.count,

This needs to check for, and report, Tx counts?

> +		pf->hw.pf_id,
> +		vf->vf_id,
> +		vf->default_lan_addr.addr,
> +		test_bit(I40E_FLAG_MDD_AUTO_RESET_VF, pf->flags) ? "on" : "off");

This could use the new str_on_off() string helper.

> +}


Thanks,
Tony

      parent reply	other threads:[~2024-11-04 17:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 12:36 [Intel-wired-lan] [PATCH iwl-next v4444] i40e: add ability to reset VF for Tx and Rx MDD events Aleksandr Loktionov
2024-11-04 15:40 ` Michal Schmidt
2024-11-04 15:50   ` Michal Schmidt
2024-11-15 19:29   ` Loktionov, Aleksandr
2024-11-04 17:19 ` Tony Nguyen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a91c5981-ffd3-4c52-8b84-e81b506f0869@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jan.sokolowski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=padraig.j.connolly@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox