Skip to content

Commit 1c31cb9

Browse files
nvmmaxSaeed Mahameed
authored andcommitted
net/mlx5e: Move the LRO-XSK check to mlx5e_fix_features
LRO is mutually exclusive with XSK. When LRO is enabled, it checks whether XSK is active. This commit moves this check to a more correct place at mlx5e_fix_features. Signed-off-by: Maxim Mikityanskiy <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent f7434ba commit 1c31cb9

File tree

1 file changed

+5
-7
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+5
-7
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3594,13 +3594,6 @@ static int set_feature_lro(struct net_device *netdev, bool enable)
35943594

35953595
mutex_lock(&priv->state_lock);
35963596

3597-
if (enable && priv->xsk.refcnt) {
3598-
netdev_warn(netdev, "LRO is incompatible with AF_XDP (%u XSKs are active)\n",
3599-
priv->xsk.refcnt);
3600-
err = -EINVAL;
3601-
goto out;
3602-
}
3603-
36043597
cur_params = &priv->channels.params;
36053598
if (enable && !MLX5E_GET_PFLAG(cur_params, MLX5E_PFLAG_RX_STRIDING_RQ)) {
36063599
netdev_warn(netdev, "can't set LRO with legacy RQ\n");
@@ -3916,6 +3909,11 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev,
39163909
}
39173910

39183911
if (priv->xsk.refcnt) {
3912+
if (features & NETIF_F_LRO) {
3913+
netdev_warn(netdev, "LRO is incompatible with AF_XDP (%u XSKs are active)\n",
3914+
priv->xsk.refcnt);
3915+
features &= ~NETIF_F_LRO;
3916+
}
39193917
if (features & NETIF_F_GRO_HW) {
39203918
netdev_warn(netdev, "HW GRO is incompatible with AF_XDP (%u XSKs are active)\n",
39213919
priv->xsk.refcnt);

0 commit comments

Comments
 (0)