Patch "net/mlx5e: Properly block HW GRO when XDP is enabled" has been added to the 5.17-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net/mlx5e: Properly block HW GRO when XDP is enabled

to the 5.17-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-mlx5e-properly-block-hw-gro-when-xdp-is-enabled.patch
and it can be found in the queue-5.17 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 583ffb01346f07604fe03b6fb417bd466d872c24
Author: Maxim Mikityanskiy <maximmi@xxxxxxxxxx>
Date:   Tue Apr 12 18:54:26 2022 +0300

    net/mlx5e: Properly block HW GRO when XDP is enabled
    
    [ Upstream commit b0617e7b35001c92c8fa777e1a095d3e693813df ]
    
    HW GRO is incompatible and mutually exclusive with XDP and XSK. However,
    the needed checks are only made when enabling XDP. If HW GRO is enabled
    when XDP is already active, the command will succeed, and XDP will be
    skipped in the data path, although still enabled.
    
    This commit fixes the bug by checking the XDP and XSK status in
    mlx5e_fix_features and disabling HW GRO if XDP is enabled.
    
    Fixes: 83439f3c37aa ("net/mlx5e: Add HW-GRO offload")
    Signed-off-by: Maxim Mikityanskiy <maximmi@xxxxxxxxxx>
    Reviewed-by: Tariq Toukan <tariqt@xxxxxxxxxx>
    Signed-off-by: Saeed Mahameed <saeedm@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 1f8fc8d77bc3..4b83dd05afcd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3870,6 +3870,18 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev,
 			netdev_warn(netdev, "LRO is incompatible with XDP\n");
 			features &= ~NETIF_F_LRO;
 		}
+		if (features & NETIF_F_GRO_HW) {
+			netdev_warn(netdev, "HW GRO is incompatible with XDP\n");
+			features &= ~NETIF_F_GRO_HW;
+		}
+	}
+
+	if (priv->xsk.refcnt) {
+		if (features & NETIF_F_GRO_HW) {
+			netdev_warn(netdev, "HW GRO is incompatible with AF_XDP (%u XSKs are active)\n",
+				    priv->xsk.refcnt);
+			features &= ~NETIF_F_GRO_HW;
+		}
 	}
 
 	if (MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS)) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux