From: Intel-wired-lan <[email protected]> on behalf of Aleksandr Loktionov <[email protected]> Sent: Friday, November 15, 2024 8:42 PM To: [email protected] <[email protected]>; Nguyen, Anthony L <[email protected]>; Loktionov, Aleksandr <[email protected]> Cc: [email protected] <[email protected]>; Sokolowski, Jan <[email protected]>; Connolly, Padraig J <[email protected]> Subject: [Intel-wired-lan] [PATCH iwl-next v5] i40e: add ability to reset VF for Tx and Rx MDD events 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 queues 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 <[email protected]> Signed-off-by: Jan Sokolowski <[email protected]> Co-developed-by: Padraig J Connolly <[email protected]> Signed-off-by: Padraig J Connolly <[email protected]> Signed-off-by: Aleksandr Loktionov <[email protected]> --- v4->v5 + documentation - 2nd clear_bit(__I40E_MDD_EVENT_PENDING) * rate limit v3->v4 refactor two helper functions into one v2->v3 fix compilation issue v1->v2 fix compilation issue --- .../device_drivers/ethernet/intel/i40e.rst | 12 ++ 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 | 107 +++++++++++++++--- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +- .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 11 +- 7 files changed, 123 insertions(+), 17 deletions(-) diff --git a/Documentation/networking/device_drivers/ethernet/intel/i40e.rst b/Documentation/networking/device_drivers/ethernet/intel/i40e.rst index 4fbaa1a..53d9d58 100644 --- a/Documentation/networking/device_drivers/ethernet/intel/i40e.rst +++ b/Documentation/networking/device_drivers/ethernet/intel/i40e.rst @@ -299,6 +299,18 @@ Use ethtool to view and set link-down-on-close, as follows:: Tested-by: Rafal Romanowski <[email protected]>
