151 lines
5.5 KiB
Diff
151 lines
5.5 KiB
Diff
From 9e854a91756c19006bbdf08d8b42d112a2f5f1b1 Mon Sep 17 00:00:00 2001
|
|
From: Kamal Heib <kheib@redhat.com>
|
|
Date: Mon, 20 Apr 2026 14:59:31 -0400
|
|
Subject: [PATCH] net/mlx5e: Update XDP features in switch channels
|
|
|
|
JIRA: https://redhat.atlassian.net/browse/RHEL-169055
|
|
|
|
commit 96a8395061358adcd4b6a4f0f4c8989ec69e8659
|
|
Author: Tariq Toukan <tariqt@nvidia.com>
|
|
Date: Sun Nov 30 12:13:36 2025 +0200
|
|
|
|
net/mlx5e: Update XDP features in switch channels
|
|
|
|
The XDP features state might depend of the state of other features, like
|
|
HW-LRO / HW-GRO.
|
|
|
|
In general, move the re-evaluation announcement of the XDP features
|
|
(xdp_set_features_flag_locked) into the flow where configuration gets
|
|
changed. There's no point in updating them elsewhere.
|
|
|
|
This is a more appropriate place, as this modifies the announced
|
|
features while channels are inactive, which avoids the small interval
|
|
between channel activation and the proper setting of the XDP features.
|
|
|
|
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
|
|
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
|
|
Reviewed-by: William Tu <witu@nvidia.com>
|
|
Link: https://patch.msgid.link/1764497617-1326331-2-git-send-email-tariqt@nvidia.com
|
|
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|
|
|
Signed-off-by: Kamal Heib <kheib@redhat.com>
|
|
|
|
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
|
|
index 85f940869968..a1d33c78aedd 100644
|
|
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
|
|
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
|
|
@@ -1242,7 +1242,7 @@ void mlx5e_netdev_attach_nic_profile(struct mlx5e_priv *priv);
|
|
void mlx5e_set_netdev_mtu_boundaries(struct mlx5e_priv *priv);
|
|
void mlx5e_build_nic_params(struct mlx5e_priv *priv, struct mlx5e_xsk *xsk, u16 mtu);
|
|
|
|
-void mlx5e_set_xdp_feature(struct net_device *netdev);
|
|
+void mlx5e_set_xdp_feature(struct mlx5e_priv *priv);
|
|
netdev_features_t mlx5e_features_check(struct sk_buff *skb,
|
|
struct net_device *netdev,
|
|
netdev_features_t features);
|
|
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
|
|
index 6e12bd196ec9..12ecb949bcc5 100644
|
|
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
|
|
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
|
|
@@ -2293,7 +2293,6 @@ static int set_pflag_rx_striding_rq(struct net_device *netdev, bool enable)
|
|
struct mlx5e_priv *priv = netdev_priv(netdev);
|
|
struct mlx5_core_dev *mdev = priv->mdev;
|
|
struct mlx5e_params new_params;
|
|
- int err;
|
|
|
|
if (enable) {
|
|
/* Checking the regular RQ here; mlx5e_validate_xsk_param called
|
|
@@ -2314,14 +2313,7 @@ static int set_pflag_rx_striding_rq(struct net_device *netdev, bool enable)
|
|
MLX5E_SET_PFLAG(&new_params, MLX5E_PFLAG_RX_STRIDING_RQ, enable);
|
|
mlx5e_set_rq_type(mdev, &new_params);
|
|
|
|
- err = mlx5e_safe_switch_params(priv, &new_params, NULL, NULL, true);
|
|
- if (err)
|
|
- return err;
|
|
-
|
|
- /* update XDP supported features */
|
|
- mlx5e_set_xdp_feature(netdev);
|
|
-
|
|
- return 0;
|
|
+ return mlx5e_safe_switch_params(priv, &new_params, NULL, NULL, true);
|
|
}
|
|
|
|
static int set_pflag_rx_no_csum_complete(struct net_device *netdev, bool enable)
|
|
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
|
|
index 261b96e41d7e..7c1f458a61f5 100644
|
|
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
|
|
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
|
|
@@ -3337,6 +3337,7 @@ static int mlx5e_switch_priv_params(struct mlx5e_priv *priv,
|
|
}
|
|
}
|
|
|
|
+ mlx5e_set_xdp_feature(priv);
|
|
return 0;
|
|
}
|
|
|
|
@@ -3368,6 +3369,7 @@ static int mlx5e_switch_priv_channels(struct mlx5e_priv *priv,
|
|
}
|
|
}
|
|
|
|
+ mlx5e_set_xdp_feature(priv);
|
|
if (!MLX5_CAP_GEN(priv->mdev, tis_tir_td_order))
|
|
mlx5e_close_channels(old_chs);
|
|
priv->profile->update_rx(priv);
|
|
@@ -4376,10 +4378,10 @@ static int mlx5e_handle_feature(struct net_device *netdev,
|
|
return 0;
|
|
}
|
|
|
|
-void mlx5e_set_xdp_feature(struct net_device *netdev)
|
|
+void mlx5e_set_xdp_feature(struct mlx5e_priv *priv)
|
|
{
|
|
- struct mlx5e_priv *priv = netdev_priv(netdev);
|
|
struct mlx5e_params *params = &priv->channels.params;
|
|
+ struct net_device *netdev = priv->netdev;
|
|
xdp_features_t val;
|
|
|
|
if (!netdev->netdev_ops->ndo_bpf ||
|
|
@@ -4428,9 +4430,6 @@ int mlx5e_set_features(struct net_device *netdev, netdev_features_t features)
|
|
return -EINVAL;
|
|
}
|
|
|
|
- /* update XDP supported features */
|
|
- mlx5e_set_xdp_feature(netdev);
|
|
-
|
|
return 0;
|
|
}
|
|
|
|
@@ -5805,7 +5804,7 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
|
|
netdev->priv_flags |= IFF_UNICAST_FLT;
|
|
|
|
netif_set_tso_max_size(netdev, GSO_MAX_SIZE);
|
|
- mlx5e_set_xdp_feature(netdev);
|
|
+ mlx5e_set_xdp_feature(priv);
|
|
mlx5e_set_netdev_dev_addr(netdev);
|
|
mlx5e_macsec_build_netdev(priv);
|
|
mlx5e_ipsec_build_netdev(priv);
|
|
@@ -5898,7 +5897,7 @@ static int mlx5e_nic_init(struct mlx5_core_dev *mdev,
|
|
rtnl_lock();
|
|
|
|
/* update XDP supported features */
|
|
- mlx5e_set_xdp_feature(netdev);
|
|
+ mlx5e_set_xdp_feature(priv);
|
|
|
|
if (take_rtnl)
|
|
rtnl_unlock();
|
|
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
|
|
index d19d743a88ae..8490e2039f7f 100644
|
|
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
|
|
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
|
|
@@ -866,7 +866,7 @@ static void mlx5e_build_rep_params(struct net_device *netdev)
|
|
if (take_rtnl)
|
|
rtnl_lock();
|
|
/* update XDP supported features */
|
|
- mlx5e_set_xdp_feature(netdev);
|
|
+ mlx5e_set_xdp_feature(priv);
|
|
if (take_rtnl)
|
|
rtnl_unlock();
|
|
|
|
--
|
|
2.50.1 (Apple Git-155)
|
|
|