Skip to content

Commit b0617e7

Browse files
nvmmaxSaeed Mahameed
authored and
Saeed Mahameed
committed
net/mlx5e: Properly block HW GRO when XDP is enabled
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: 83439f3 ("net/mlx5e: Add HW-GRO offload") Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent cf6e34c commit b0617e7

File tree

1 file changed

+12
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+12
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

+12
Original file line numberDiff line numberDiff line change
@@ -3905,6 +3905,18 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev,
39053905
netdev_warn(netdev, "LRO is incompatible with XDP\n");
39063906
features &= ~NETIF_F_LRO;
39073907
}
3908+
if (features & NETIF_F_GRO_HW) {
3909+
netdev_warn(netdev, "HW GRO is incompatible with XDP\n");
3910+
features &= ~NETIF_F_GRO_HW;
3911+
}
3912+
}
3913+
3914+
if (priv->xsk.refcnt) {
3915+
if (features & NETIF_F_GRO_HW) {
3916+
netdev_warn(netdev, "HW GRO is incompatible with AF_XDP (%u XSKs are active)\n",
3917+
priv->xsk.refcnt);
3918+
features &= ~NETIF_F_GRO_HW;
3919+
}
39083920
}
39093921

39103922
if (MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS)) {

0 commit comments

Comments
 (0)