From: Tariq Toukan <tariqt@nvidia.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, <netdev@vger.kernel.org>,
Paolo Abeni <pabeni@redhat.com>
Cc: Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
Alexei Lazar <alazar@nvidia.com>,
Cosmin Ratiu <cratiu@nvidia.com>,
Dragos Tatulea <dtatulea@nvidia.com>,
Gal Pressman <gal@nvidia.com>, Leon Romanovsky <leon@kernel.org>,
open list <linux-kernel@vger.kernel.org>,
<linux-rdma@vger.kernel.org>, Mark Bloch <mbloch@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Shahar Shitrit <shshitrit@nvidia.com>,
"Stanislav Fomichev" <sdf@fomichev.me>,
Stanislav Fomichev <sdf.kernel@gmail.com>,
"Tariq Toukan" <tariqt@nvidia.com>
Subject: [PATCH net-next] net/mlx5e: Rename state_destroy to rx_mode_active in flow steering
Date: Sun, 11 Oct 2026 12:31:00 +0300 [thread overview]
Message-ID: <20261011093100.769149-1-tariqt@nvidia.com> (raw)
From: Alexei Lazar <alazar@nvidia.com>
This flag controls the enablement of RX mode handling (promisc,
allmulti, broadcast, netdev addr sync). It acts as a safeguard
that prevents new FS (flow steering) operations during device
teardown. When the device is in destroying state it is set to
false to indicate RX mode operations are not allowed.
Its name is misleading, as it suggests a destroy-state flag
rather than RX mode activity. Rename it for clarity.
No functional change.
Signed-off-by: Alexei Lazar <alazar@nvidia.com>
Reviewed-by: Shahar Shitrit <shshitrit@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en/fs.h | 5 +++--
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 17 +++++++++--------
.../net/ethernet/mellanox/mlx5/core/en_main.c | 15 +++++++++------
3 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
index 4973fb473ff0..aa370227b7bc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
@@ -158,7 +158,7 @@ void mlx5e_destroy_flow_steering(struct mlx5e_flow_steering *fs, bool ntuple,
struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile,
struct mlx5_core_dev *mdev,
- bool state_destroy,
+ bool rx_mode_active,
struct dentry *dfs_root);
void mlx5e_fs_cleanup(struct mlx5e_flow_steering *fs);
struct mlx5e_vlan_table *mlx5e_fs_get_vlan(struct mlx5e_flow_steering *fs);
@@ -198,7 +198,8 @@ void mlx5e_fs_set_udp(struct mlx5e_flow_steering *fs, struct mlx5e_fs_udp *udp);
struct mlx5e_accel_fs_tcp *mlx5e_fs_get_accel_tcp(struct mlx5e_flow_steering *fs);
void mlx5e_fs_set_accel_tcp(struct mlx5e_flow_steering *fs, struct mlx5e_accel_fs_tcp *accel_tcp);
#endif
-void mlx5e_fs_set_state_destroy(struct mlx5e_flow_steering *fs, bool state_destroy);
+void mlx5e_fs_set_rx_mode_active(struct mlx5e_flow_steering *fs,
+ bool rx_mode_active);
void mlx5e_fs_set_vlan_strip_disable(struct mlx5e_flow_steering *fs, bool vlan_strip_disable);
struct mlx5_core_dev *mlx5e_fs_get_mdev(struct mlx5e_flow_steering *fs);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
index 12492c4a5d41..c19238bc821f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
@@ -44,7 +44,7 @@
struct mlx5e_flow_steering {
struct work_struct set_rx_mode_work;
- bool state_destroy;
+ bool rx_mode_active;
bool vlan_strip_disable;
struct mlx5_core_dev *mdev;
struct mlx5_flow_namespace *ns;
@@ -560,7 +560,7 @@ static void mlx5e_del_vlan_rules(struct mlx5e_flow_steering *fs)
for_each_set_bit(i, fs->vlan->active_svlans, VLAN_N_VID)
mlx5e_fs_del_vlan_rule(fs, MLX5E_VLAN_RULE_TYPE_MATCH_STAG_VID, i);
- WARN_ON_ONCE(fs->state_destroy);
+ WARN_ON_ONCE(fs->rx_mode_active);
mlx5e_remove_vlan_trap(fs);
@@ -743,7 +743,7 @@ static void mlx5e_handle_netdev_addr(struct mlx5e_flow_steering *fs,
mlx5e_for_each_hash_node(hn, tmp, fs->l2.netdev_mc, i)
hn->action = MLX5E_ACTION_DEL;
- if (fs->state_destroy)
+ if (fs->rx_mode_active)
mlx5e_sync_netdev_addr(fs, netdev, uc, mc);
mlx5e_apply_netdev_addr(fs);
@@ -840,7 +840,7 @@ void mlx5e_fs_set_rx_mode_work(struct mlx5e_flow_steering *fs,
goto update_vport_context;
}
- bool rx_mode_enable = fs->state_destroy;
+ bool rx_mode_enable = fs->rx_mode_active;
bool promisc_enabled = rx_mode_enable && (netdev->flags & IFF_PROMISC);
bool allmulti_enabled = rx_mode_enable && (netdev->flags & IFF_ALLMULTI);
bool broadcast_enabled = rx_mode_enable;
@@ -1479,7 +1479,7 @@ static void mlx5e_fs_debugfs_init(struct mlx5e_flow_steering *fs,
struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile,
struct mlx5_core_dev *mdev,
- bool state_destroy,
+ bool rx_mode_active,
struct dentry *dfs_root)
{
struct mlx5e_flow_steering *fs;
@@ -1490,7 +1490,7 @@ struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile,
goto err;
fs->mdev = mdev;
- fs->state_destroy = state_destroy;
+ fs->rx_mode_active = rx_mode_active;
if (mlx5e_profile_feature_cap(profile, FS_VLAN)) {
err = mlx5e_fs_vlan_alloc(fs);
if (err)
@@ -1606,9 +1606,10 @@ void mlx5e_fs_set_accel_tcp(struct mlx5e_flow_steering *fs, struct mlx5e_accel_f
}
#endif
-void mlx5e_fs_set_state_destroy(struct mlx5e_flow_steering *fs, bool state_destroy)
+void mlx5e_fs_set_rx_mode_active(struct mlx5e_flow_steering *fs,
+ bool rx_mode_active)
{
- fs->state_destroy = state_destroy;
+ fs->rx_mode_active = rx_mode_active;
}
void mlx5e_fs_set_vlan_strip_disable(struct mlx5e_flow_steering *fs,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index f90b5a34e097..478b5956044b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -6557,8 +6557,9 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
clear_bit(MLX5E_STATE_DESTROYING, &priv->state);
if (priv->fs)
- mlx5e_fs_set_state_destroy(priv->fs,
- !test_bit(MLX5E_STATE_DESTROYING, &priv->state));
+ mlx5e_fs_set_rx_mode_active(priv->fs,
+ !test_bit(MLX5E_STATE_DESTROYING,
+ &priv->state));
/* Validate the max_wqe_size_sq capability. */
if (WARN_ON_ONCE(mlx5e_get_max_sq_wqebbs(priv->mdev) < MLX5E_MAX_TX_WQEBBS)) {
@@ -6638,8 +6639,9 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
mlx5e_reset_channels(priv->netdev);
set_bit(MLX5E_STATE_DESTROYING, &priv->state);
if (priv->fs)
- mlx5e_fs_set_state_destroy(priv->fs,
- !test_bit(MLX5E_STATE_DESTROYING, &priv->state));
+ mlx5e_fs_set_rx_mode_active(priv->fs,
+ !test_bit(MLX5E_STATE_DESTROYING,
+ &priv->state));
cancel_work_sync(&priv->update_stats_work);
return err;
}
@@ -6650,8 +6652,9 @@ void mlx5e_detach_netdev(struct mlx5e_priv *priv)
set_bit(MLX5E_STATE_DESTROYING, &priv->state);
if (priv->fs)
- mlx5e_fs_set_state_destroy(priv->fs,
- !test_bit(MLX5E_STATE_DESTROYING, &priv->state));
+ mlx5e_fs_set_rx_mode_active(priv->fs,
+ !test_bit(MLX5E_STATE_DESTROYING,
+ &priv->state));
if (profile->disable)
profile->disable(priv);
base-commit: d8674294aefef02266c4d47ad10131f1bffbe534
--
2.44.0
next reply other threads:[~2026-10-11 9:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-11 9:31 Tariq Toukan [this message]
2026-10-12 18:39 ` Joe Damato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261011093100.769149-1-tariqt@nvidia.com \
--to=tariqt@nvidia.com \
--cc=alazar@nvidia.com \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=cratiu@nvidia.com \
--cc=davem@davemloft.net \
--cc=dtatulea@nvidia.com \
--cc=edumazet@kernel.org \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=sdf.kernel@gmail.com \
--cc=sdf@fomichev.me \
--cc=shshitrit@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®