* [PATCH net-next 0/5] net/mlx5: misc changes 2025-07-09
@ 2025-07-08 21:16 Tariq Toukan
2025-07-08 21:16 ` [PATCH net-next 1/5] net/mlx5e: Remove unused VLAN insertion logic in TX path Tariq Toukan
` (5 more replies)
0 siblings, 6 replies; 13+ messages in thread
From: Tariq Toukan @ 2025-07-08 21:16 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Gal Pressman, Leon Romanovsky, Saeed Mahameed,
Tariq Toukan, Mark Bloch, netdev, linux-rdma, linux-kernel
Hi,
This series contains misc enhancements to the mlx5 driver.
Regards,
Tariq
Carolina Jubran (1):
net/mlx5e: Remove unused VLAN insertion logic in TX path
Cosmin Ratiu (1):
net/mlx5e: CT: extract a memcmp from a spinlock section
Gal Pressman (1):
net/mlx5e: Replace recursive VLAN push handling with an iterative loop
Maor Gottlieb (1):
net/mlx5: Warn when write combining is not supported
Tariq Toukan (1):
net/mlx5e: RX, Remove unnecessary RQT redirects
drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 -
.../net/ethernet/mellanox/mlx5/core/en/ptp.c | 2 -
.../mellanox/mlx5/core/en/reporter_tx.c | 1 -
.../ethernet/mellanox/mlx5/core/en/rx_res.c | 4 +-
.../mellanox/mlx5/core/en/tc/act/vlan.c | 43 ++++++++++---------
.../ethernet/mellanox/mlx5/core/en/tc_ct.c | 5 ++-
.../net/ethernet/mellanox/mlx5/core/en_main.c | 2 -
.../net/ethernet/mellanox/mlx5/core/en_tx.c | 9 +---
drivers/net/ethernet/mellanox/mlx5/core/wc.c | 3 ++
9 files changed, 31 insertions(+), 39 deletions(-)
base-commit: 19c066f940666bf6c0982635e4441100ca8d75bc
--
2.31.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH net-next 1/5] net/mlx5e: Remove unused VLAN insertion logic in TX path
2025-07-08 21:16 [PATCH net-next 0/5] net/mlx5: misc changes 2025-07-09 Tariq Toukan
@ 2025-07-08 21:16 ` Tariq Toukan
2025-07-09 17:23 ` Simon Horman
2025-07-08 21:16 ` [PATCH net-next 2/5] net/mlx5e: CT: extract a memcmp from a spinlock section Tariq Toukan
` (4 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Tariq Toukan @ 2025-07-08 21:16 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Gal Pressman, Leon Romanovsky, Saeed Mahameed,
Tariq Toukan, Mark Bloch, netdev, linux-rdma, linux-kernel,
Carolina Jubran
From: Carolina Jubran <cjubran@nvidia.com>
The VLAN insertion capability (`wqe_vlan_insert`) was never enabled on
all mlx5 devices. When VLAN TX offload is advertised but this
capability is not supported, the driver uses inline headers to insert
the VLAN tag.
To support this, the driver used to set the
`MLX5E_SQ_STATE_VLAN_NEED_L2_INLINE` bit to enforce L2 inline mode
when `wqe_vlan_insert` was not supported. Since the capability is
disabled on all devices, this logic was always active, and the SQ flag
has become redundant. L2 inline is enforced unconditionally for
VLAN-tagged packets.
The `skb_vlan_tag_present()` check in the else-if block of
`mlx5e_sq_xmit_wqe()` is never true by this point in the TX flow,
as the VLAN tag has already been inserted by the driver using inline
headers. As a result, this code is never executed.
Remove the redundant SQ state, dead VLAN insertion code block, and
related logic.
Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 -
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c | 2 --
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 1 -
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 --
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 9 +--------
5 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index 65a73913b9a2..64e69e616b1f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -383,7 +383,6 @@ enum {
MLX5E_SQ_STATE_RECOVERING,
MLX5E_SQ_STATE_IPSEC,
MLX5E_SQ_STATE_DIM,
- MLX5E_SQ_STATE_VLAN_NEED_L2_INLINE,
MLX5E_SQ_STATE_PENDING_XSK_TX,
MLX5E_SQ_STATE_PENDING_TLS_RX_RESYNC,
MLX5E_NUM_SQ_STATES, /* Must be kept last */
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
index 5d0014129a7e..391b4e9c9dc4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
@@ -340,8 +340,6 @@ static int mlx5e_ptp_alloc_txqsq(struct mlx5e_ptp *c, int txq_ix,
sq->stats = &c->priv->ptp_stats.sq[tc];
sq->ptpsq = ptpsq;
INIT_WORK(&sq->recover_work, mlx5e_tx_err_cqe_work);
- if (!MLX5_CAP_ETH(mdev, wqe_vlan_insert))
- set_bit(MLX5E_SQ_STATE_VLAN_NEED_L2_INLINE, &sq->state);
sq->stop_room = param->stop_room;
sq->ptp_cyc2time = mlx5_sq_ts_translator(mdev);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
index c3bda4612fa9..bd96988e102c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
@@ -13,7 +13,6 @@ static const char * const sq_sw_state_type_name[] = {
[MLX5E_SQ_STATE_RECOVERING] = "recovering",
[MLX5E_SQ_STATE_IPSEC] = "ipsec",
[MLX5E_SQ_STATE_DIM] = "dim",
- [MLX5E_SQ_STATE_VLAN_NEED_L2_INLINE] = "vlan_need_l2_inline",
[MLX5E_SQ_STATE_PENDING_XSK_TX] = "pending_xsk_tx",
[MLX5E_SQ_STATE_PENDING_TLS_RX_RESYNC] = "pending_tls_rx_resync",
};
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index e8e5b347f9b2..fee323ade522 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -1677,8 +1677,6 @@ static int mlx5e_alloc_txqsq(struct mlx5e_channel *c,
sq->hw_mtu = MLX5E_SW2HW_MTU(params, params->sw_mtu);
sq->max_sq_mpw_wqebbs = mlx5e_get_max_sq_aligned_wqebbs(mdev);
INIT_WORK(&sq->recover_work, mlx5e_tx_err_cqe_work);
- if (!MLX5_CAP_ETH(mdev, wqe_vlan_insert))
- set_bit(MLX5E_SQ_STATE_VLAN_NEED_L2_INLINE, &sq->state);
if (mlx5_ipsec_device_caps(c->priv->mdev))
set_bit(MLX5E_SQ_STATE_IPSEC, &sq->state);
if (param->is_mpw)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index 55a8629f0792..e6a301ba3254 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -256,8 +256,7 @@ mlx5e_tx_wqe_inline_mode(struct mlx5e_txqsq *sq, struct sk_buff *skb,
mode = sq->min_inline_mode;
- if (skb_vlan_tag_present(skb) &&
- test_bit(MLX5E_SQ_STATE_VLAN_NEED_L2_INLINE, &sq->state))
+ if (skb_vlan_tag_present(skb))
mode = max_t(u8, MLX5_INLINE_MODE_L2, mode);
return mode;
@@ -483,12 +482,6 @@ mlx5e_sq_xmit_wqe(struct mlx5e_txqsq *sq, struct sk_buff *skb,
}
eseg->inline_hdr.sz |= cpu_to_be16(ihs);
dseg += wqe_attr->ds_cnt_inl;
- } else if (skb_vlan_tag_present(skb)) {
- eseg->insert.type = cpu_to_be16(MLX5_ETH_WQE_INSERT_VLAN);
- if (skb->vlan_proto == cpu_to_be16(ETH_P_8021AD))
- eseg->insert.type |= cpu_to_be16(MLX5_ETH_WQE_SVLAN);
- eseg->insert.vlan_tci = cpu_to_be16(skb_vlan_tag_get(skb));
- stats->added_vlan_packets++;
}
dseg += wqe_attr->ds_cnt_ids;
--
2.31.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 2/5] net/mlx5e: CT: extract a memcmp from a spinlock section
2025-07-08 21:16 [PATCH net-next 0/5] net/mlx5: misc changes 2025-07-09 Tariq Toukan
2025-07-08 21:16 ` [PATCH net-next 1/5] net/mlx5e: Remove unused VLAN insertion logic in TX path Tariq Toukan
@ 2025-07-08 21:16 ` Tariq Toukan
2025-07-09 17:24 ` Simon Horman
2025-07-08 21:16 ` [PATCH net-next 3/5] net/mlx5e: Replace recursive VLAN push handling with an iterative loop Tariq Toukan
` (3 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Tariq Toukan @ 2025-07-08 21:16 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Gal Pressman, Leon Romanovsky, Saeed Mahameed,
Tariq Toukan, Mark Bloch, netdev, linux-rdma, linux-kernel,
Cosmin Ratiu
From: Cosmin Ratiu <cratiu@nvidia.com>
This reduces the time the lock is held and reduces contention.
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
index 81332cd4a582..870d12364f99 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
@@ -1195,6 +1195,7 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft,
struct flow_action_entry *meta_action;
unsigned long cookie = flow->cookie;
struct mlx5_ct_entry *entry;
+ bool has_nat;
int err;
meta_action = mlx5_tc_ct_get_ct_metadata_action(flow_rule);
@@ -1236,6 +1237,8 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft,
err = mlx5_tc_ct_rule_to_tuple_nat(&entry->tuple_nat, flow_rule);
if (err)
goto err_set;
+ has_nat = memcmp(&entry->tuple, &entry->tuple_nat,
+ sizeof(entry->tuple));
spin_lock_bh(&ct_priv->ht_lock);
@@ -1244,7 +1247,7 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft,
if (err)
goto err_entries;
- if (memcmp(&entry->tuple, &entry->tuple_nat, sizeof(entry->tuple))) {
+ if (has_nat) {
err = rhashtable_lookup_insert_fast(&ct_priv->ct_tuples_nat_ht,
&entry->tuple_nat_node,
tuples_nat_ht_params);
--
2.31.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 3/5] net/mlx5e: Replace recursive VLAN push handling with an iterative loop
2025-07-08 21:16 [PATCH net-next 0/5] net/mlx5: misc changes 2025-07-09 Tariq Toukan
2025-07-08 21:16 ` [PATCH net-next 1/5] net/mlx5e: Remove unused VLAN insertion logic in TX path Tariq Toukan
2025-07-08 21:16 ` [PATCH net-next 2/5] net/mlx5e: CT: extract a memcmp from a spinlock section Tariq Toukan
@ 2025-07-08 21:16 ` Tariq Toukan
2025-07-09 17:24 ` Simon Horman
2025-07-10 2:47 ` Jakub Kicinski
2025-07-08 21:16 ` [PATCH net-next 4/5] net/mlx5: Warn when write combining is not supported Tariq Toukan
` (2 subsequent siblings)
5 siblings, 2 replies; 13+ messages in thread
From: Tariq Toukan @ 2025-07-08 21:16 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Gal Pressman, Leon Romanovsky, Saeed Mahameed,
Tariq Toukan, Mark Bloch, netdev, linux-rdma, linux-kernel
From: Gal Pressman <gal@nvidia.com>
mlx5e_tc_act_vlan_add_push_action() uses tail-recursion to walk through
a stack of VLAN devices.
There is no need for a complicated recursion with unnecessary stack
consumption and less obvious code flow, rewrite the function so that it
uses a do while loop instead.
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
.../mellanox/mlx5/core/en/tc/act/vlan.c | 43 ++++++++++---------
1 file changed, 22 insertions(+), 21 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/vlan.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/vlan.c
index a13c5e707b83..9bdb5820c553 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/vlan.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/vlan.c
@@ -94,29 +94,30 @@ mlx5e_tc_act_vlan_add_push_action(struct mlx5e_priv *priv,
struct net_device **out_dev,
struct netlink_ext_ack *extack)
{
- struct net_device *vlan_dev = *out_dev;
- struct flow_action_entry vlan_act = {
- .id = FLOW_ACTION_VLAN_PUSH,
- .vlan.vid = vlan_dev_vlan_id(vlan_dev),
- .vlan.proto = vlan_dev_vlan_proto(vlan_dev),
- .vlan.prio = 0,
- };
- int err;
-
- err = parse_tc_vlan_action(priv, &vlan_act, attr->esw_attr, &attr->action, extack, NULL);
- if (err)
- return err;
-
- rcu_read_lock();
- *out_dev = dev_get_by_index_rcu(dev_net(vlan_dev), dev_get_iflink(vlan_dev));
- rcu_read_unlock();
- if (!*out_dev)
- return -ENODEV;
+ do {
+ struct net_device *vlan_dev = *out_dev;
+ struct flow_action_entry vlan_act = {
+ .id = FLOW_ACTION_VLAN_PUSH,
+ .vlan.vid = vlan_dev_vlan_id(vlan_dev),
+ .vlan.proto = vlan_dev_vlan_proto(vlan_dev),
+ .vlan.prio = 0,
+ };
+ int err;
+
+ err = parse_tc_vlan_action(priv, &vlan_act, attr->esw_attr,
+ &attr->action, extack, NULL);
+ if (err)
+ return err;
- if (is_vlan_dev(*out_dev))
- err = mlx5e_tc_act_vlan_add_push_action(priv, attr, out_dev, extack);
+ rcu_read_lock();
+ *out_dev = dev_get_by_index_rcu(dev_net(vlan_dev),
+ dev_get_iflink(vlan_dev));
+ rcu_read_unlock();
+ if (!*out_dev)
+ return -ENODEV;
+ } while (is_vlan_dev(*out_dev));
- return err;
+ return 0;
}
int
--
2.31.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 4/5] net/mlx5: Warn when write combining is not supported
2025-07-08 21:16 [PATCH net-next 0/5] net/mlx5: misc changes 2025-07-09 Tariq Toukan
` (2 preceding siblings ...)
2025-07-08 21:16 ` [PATCH net-next 3/5] net/mlx5e: Replace recursive VLAN push handling with an iterative loop Tariq Toukan
@ 2025-07-08 21:16 ` Tariq Toukan
2025-07-09 17:24 ` Simon Horman
2025-07-08 21:16 ` [PATCH net-next 5/5] net/mlx5e: RX, Remove unnecessary RQT redirects Tariq Toukan
2025-07-10 3:00 ` [PATCH net-next 0/5] net/mlx5: misc changes 2025-07-09 patchwork-bot+netdevbpf
5 siblings, 1 reply; 13+ messages in thread
From: Tariq Toukan @ 2025-07-08 21:16 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Gal Pressman, Leon Romanovsky, Saeed Mahameed,
Tariq Toukan, Mark Bloch, netdev, linux-rdma, linux-kernel,
Maor Gottlieb
From: Maor Gottlieb <maorg@nvidia.com>
Warn if write combining is not supported, as it can impact latency.
Add the warning message to be printed only when the driver actually
run the test and detect unsupported state, rather than when
inheriting parent's result for SFs.
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Reviewed-by: Michael Guralnik <michaelgur@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/wc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/wc.c b/drivers/net/ethernet/mellanox/mlx5/core/wc.c
index 740b719e7072..2f0316616fa4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/wc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/wc.c
@@ -378,6 +378,9 @@ static void mlx5_core_test_wc(struct mlx5_core_dev *mdev)
mlx5_free_bfreg(mdev, &sq->bfreg);
err_alloc_bfreg:
kfree(sq);
+
+ if (mdev->wc_state == MLX5_WC_STATE_UNSUPPORTED)
+ mlx5_core_warn(mdev, "Write combining is not supported\n");
}
bool mlx5_wc_support_get(struct mlx5_core_dev *mdev)
--
2.31.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 5/5] net/mlx5e: RX, Remove unnecessary RQT redirects
2025-07-08 21:16 [PATCH net-next 0/5] net/mlx5: misc changes 2025-07-09 Tariq Toukan
` (3 preceding siblings ...)
2025-07-08 21:16 ` [PATCH net-next 4/5] net/mlx5: Warn when write combining is not supported Tariq Toukan
@ 2025-07-08 21:16 ` Tariq Toukan
2025-07-09 17:24 ` Simon Horman
2025-07-10 3:00 ` [PATCH net-next 0/5] net/mlx5: misc changes 2025-07-09 patchwork-bot+netdevbpf
5 siblings, 1 reply; 13+ messages in thread
From: Tariq Toukan @ 2025-07-08 21:16 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Gal Pressman, Leon Romanovsky, Saeed Mahameed,
Tariq Toukan, Mark Bloch, netdev, linux-rdma, linux-kernel
RQTs (Receive Queue Table) should redirect traffic to the channels' RQs
when they're active. Otherwise, redirect to the designated "drop RQ".
RQTs are created in "inactive" state, pointing to the "drop RQ".
In activate and de-activate flows, do not "deactivate" the rest of RQTs
(beyond the num of channels), as they are already inactive.
This cuts down unnecessary execution of FW commands (MODIFY_RQT), and
improves the latency of open/close channels or configuration change.
Perf:
NIC: Connect-X7.
Configuration: 1 combined channel, max num channels 248.
Measure time for "interface up + interface down".
Before: 0.313 sec
After: 0.057 sec (5.5x faster)
247 MODIFY_RQT commands saved in interface up.
247 MODIFY_RQT commands saved in interface down.
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c
index 5fcbe47337b0..b3fdb1afa1e6 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c
@@ -579,8 +579,6 @@ void mlx5e_rx_res_channels_activate(struct mlx5e_rx_res *res, struct mlx5e_chann
for (ix = 0; ix < nch; ix++)
mlx5e_rx_res_channel_activate_direct(res, chs, ix);
- for (ix = nch; ix < res->max_nch; ix++)
- mlx5e_rx_res_channel_deactivate_direct(res, ix);
if (res->features & MLX5E_RX_RES_FEATURE_PTP) {
u32 rqn;
@@ -603,7 +601,7 @@ void mlx5e_rx_res_channels_deactivate(struct mlx5e_rx_res *res)
mlx5e_rx_res_rss_disable(res);
- for (ix = 0; ix < res->max_nch; ix++)
+ for (ix = 0; ix < res->rss_nch; ix++)
mlx5e_rx_res_channel_deactivate_direct(res, ix);
if (res->features & MLX5E_RX_RES_FEATURE_PTP) {
--
2.31.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 1/5] net/mlx5e: Remove unused VLAN insertion logic in TX path
2025-07-08 21:16 ` [PATCH net-next 1/5] net/mlx5e: Remove unused VLAN insertion logic in TX path Tariq Toukan
@ 2025-07-09 17:23 ` Simon Horman
0 siblings, 0 replies; 13+ messages in thread
From: Simon Horman @ 2025-07-09 17:23 UTC (permalink / raw)
To: Tariq Toukan
Cc: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller, Saeed Mahameed, Gal Pressman, Leon Romanovsky,
Saeed Mahameed, Mark Bloch, netdev, linux-rdma, linux-kernel,
Carolina Jubran
On Wed, Jul 09, 2025 at 12:16:23AM +0300, Tariq Toukan wrote:
> From: Carolina Jubran <cjubran@nvidia.com>
>
> The VLAN insertion capability (`wqe_vlan_insert`) was never enabled on
> all mlx5 devices. When VLAN TX offload is advertised but this
> capability is not supported, the driver uses inline headers to insert
> the VLAN tag.
>
> To support this, the driver used to set the
> `MLX5E_SQ_STATE_VLAN_NEED_L2_INLINE` bit to enforce L2 inline mode
> when `wqe_vlan_insert` was not supported. Since the capability is
> disabled on all devices, this logic was always active, and the SQ flag
> has become redundant. L2 inline is enforced unconditionally for
> VLAN-tagged packets.
>
> The `skb_vlan_tag_present()` check in the else-if block of
> `mlx5e_sq_xmit_wqe()` is never true by this point in the TX flow,
> as the VLAN tag has already been inserted by the driver using inline
> headers. As a result, this code is never executed.
>
> Remove the redundant SQ state, dead VLAN insertion code block, and
> related logic.
>
> Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 2/5] net/mlx5e: CT: extract a memcmp from a spinlock section
2025-07-08 21:16 ` [PATCH net-next 2/5] net/mlx5e: CT: extract a memcmp from a spinlock section Tariq Toukan
@ 2025-07-09 17:24 ` Simon Horman
0 siblings, 0 replies; 13+ messages in thread
From: Simon Horman @ 2025-07-09 17:24 UTC (permalink / raw)
To: Tariq Toukan
Cc: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller, Saeed Mahameed, Gal Pressman, Leon Romanovsky,
Saeed Mahameed, Mark Bloch, netdev, linux-rdma, linux-kernel,
Cosmin Ratiu
On Wed, Jul 09, 2025 at 12:16:24AM +0300, Tariq Toukan wrote:
> From: Cosmin Ratiu <cratiu@nvidia.com>
>
> This reduces the time the lock is held and reduces contention.
>
> Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 3/5] net/mlx5e: Replace recursive VLAN push handling with an iterative loop
2025-07-08 21:16 ` [PATCH net-next 3/5] net/mlx5e: Replace recursive VLAN push handling with an iterative loop Tariq Toukan
@ 2025-07-09 17:24 ` Simon Horman
2025-07-10 2:47 ` Jakub Kicinski
1 sibling, 0 replies; 13+ messages in thread
From: Simon Horman @ 2025-07-09 17:24 UTC (permalink / raw)
To: Tariq Toukan
Cc: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller, Saeed Mahameed, Gal Pressman, Leon Romanovsky,
Saeed Mahameed, Mark Bloch, netdev, linux-rdma, linux-kernel
On Wed, Jul 09, 2025 at 12:16:25AM +0300, Tariq Toukan wrote:
> From: Gal Pressman <gal@nvidia.com>
>
> mlx5e_tc_act_vlan_add_push_action() uses tail-recursion to walk through
> a stack of VLAN devices.
>
> There is no need for a complicated recursion with unnecessary stack
> consumption and less obvious code flow, rewrite the function so that it
> uses a do while loop instead.
>
> Signed-off-by: Gal Pressman <gal@nvidia.com>
> Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 4/5] net/mlx5: Warn when write combining is not supported
2025-07-08 21:16 ` [PATCH net-next 4/5] net/mlx5: Warn when write combining is not supported Tariq Toukan
@ 2025-07-09 17:24 ` Simon Horman
0 siblings, 0 replies; 13+ messages in thread
From: Simon Horman @ 2025-07-09 17:24 UTC (permalink / raw)
To: Tariq Toukan
Cc: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller, Saeed Mahameed, Gal Pressman, Leon Romanovsky,
Saeed Mahameed, Mark Bloch, netdev, linux-rdma, linux-kernel,
Maor Gottlieb
On Wed, Jul 09, 2025 at 12:16:26AM +0300, Tariq Toukan wrote:
> From: Maor Gottlieb <maorg@nvidia.com>
>
> Warn if write combining is not supported, as it can impact latency.
> Add the warning message to be printed only when the driver actually
> run the test and detect unsupported state, rather than when
> inheriting parent's result for SFs.
>
> Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
> Reviewed-by: Michael Guralnik <michaelgur@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 5/5] net/mlx5e: RX, Remove unnecessary RQT redirects
2025-07-08 21:16 ` [PATCH net-next 5/5] net/mlx5e: RX, Remove unnecessary RQT redirects Tariq Toukan
@ 2025-07-09 17:24 ` Simon Horman
0 siblings, 0 replies; 13+ messages in thread
From: Simon Horman @ 2025-07-09 17:24 UTC (permalink / raw)
To: Tariq Toukan
Cc: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller, Saeed Mahameed, Gal Pressman, Leon Romanovsky,
Saeed Mahameed, Mark Bloch, netdev, linux-rdma, linux-kernel
On Wed, Jul 09, 2025 at 12:16:27AM +0300, Tariq Toukan wrote:
> RQTs (Receive Queue Table) should redirect traffic to the channels' RQs
> when they're active. Otherwise, redirect to the designated "drop RQ".
>
> RQTs are created in "inactive" state, pointing to the "drop RQ".
> In activate and de-activate flows, do not "deactivate" the rest of RQTs
> (beyond the num of channels), as they are already inactive.
>
> This cuts down unnecessary execution of FW commands (MODIFY_RQT), and
> improves the latency of open/close channels or configuration change.
>
> Perf:
> NIC: Connect-X7.
> Configuration: 1 combined channel, max num channels 248.
> Measure time for "interface up + interface down".
>
> Before: 0.313 sec
> After: 0.057 sec (5.5x faster)
>
> 247 MODIFY_RQT commands saved in interface up.
> 247 MODIFY_RQT commands saved in interface down.
>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 3/5] net/mlx5e: Replace recursive VLAN push handling with an iterative loop
2025-07-08 21:16 ` [PATCH net-next 3/5] net/mlx5e: Replace recursive VLAN push handling with an iterative loop Tariq Toukan
2025-07-09 17:24 ` Simon Horman
@ 2025-07-10 2:47 ` Jakub Kicinski
1 sibling, 0 replies; 13+ messages in thread
From: Jakub Kicinski @ 2025-07-10 2:47 UTC (permalink / raw)
To: Tariq Toukan
Cc: Eric Dumazet, Paolo Abeni, Andrew Lunn, David S. Miller,
Saeed Mahameed, Gal Pressman, Leon Romanovsky, Saeed Mahameed,
Mark Bloch, netdev, linux-rdma, linux-kernel
On Wed, 9 Jul 2025 00:16:25 +0300 Tariq Toukan wrote:
> + rcu_read_lock();
> + *out_dev = dev_get_by_index_rcu(dev_net(vlan_dev),
> + dev_get_iflink(vlan_dev));
> + rcu_read_unlock();
> + if (!*out_dev)
> + return -ENODEV;
> + } while (is_vlan_dev(*out_dev));
Would be good adding a comment here to explain why this odd rcu lock
/ lookup / rcu unlock / keep using the return value outside of rcu
protection - code flow is correct :S
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 0/5] net/mlx5: misc changes 2025-07-09
2025-07-08 21:16 [PATCH net-next 0/5] net/mlx5: misc changes 2025-07-09 Tariq Toukan
` (4 preceding siblings ...)
2025-07-08 21:16 ` [PATCH net-next 5/5] net/mlx5e: RX, Remove unnecessary RQT redirects Tariq Toukan
@ 2025-07-10 3:00 ` patchwork-bot+netdevbpf
5 siblings, 0 replies; 13+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-10 3:00 UTC (permalink / raw)
To: Tariq Toukan
Cc: edumazet, kuba, pabeni, andrew+netdev, davem, saeed, gal, leon,
saeedm, mbloch, netdev, linux-rdma, linux-kernel
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 9 Jul 2025 00:16:22 +0300 you wrote:
> Hi,
>
> This series contains misc enhancements to the mlx5 driver.
>
> Regards,
> Tariq
>
> [...]
Here is the summary with links:
- [net-next,1/5] net/mlx5e: Remove unused VLAN insertion logic in TX path
https://git.kernel.org/netdev/net-next/c/ade89d1f2486
- [net-next,2/5] net/mlx5e: CT: extract a memcmp from a spinlock section
https://git.kernel.org/netdev/net-next/c/122d86aa2a0c
- [net-next,3/5] net/mlx5e: Replace recursive VLAN push handling with an iterative loop
https://git.kernel.org/netdev/net-next/c/c0ca344d796c
- [net-next,4/5] net/mlx5: Warn when write combining is not supported
https://git.kernel.org/netdev/net-next/c/d980f371b134
- [net-next,5/5] net/mlx5e: RX, Remove unnecessary RQT redirects
https://git.kernel.org/netdev/net-next/c/a194be578376
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2025-07-10 3:00 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-08 21:16 [PATCH net-next 0/5] net/mlx5: misc changes 2025-07-09 Tariq Toukan
2025-07-08 21:16 ` [PATCH net-next 1/5] net/mlx5e: Remove unused VLAN insertion logic in TX path Tariq Toukan
2025-07-09 17:23 ` Simon Horman
2025-07-08 21:16 ` [PATCH net-next 2/5] net/mlx5e: CT: extract a memcmp from a spinlock section Tariq Toukan
2025-07-09 17:24 ` Simon Horman
2025-07-08 21:16 ` [PATCH net-next 3/5] net/mlx5e: Replace recursive VLAN push handling with an iterative loop Tariq Toukan
2025-07-09 17:24 ` Simon Horman
2025-07-10 2:47 ` Jakub Kicinski
2025-07-08 21:16 ` [PATCH net-next 4/5] net/mlx5: Warn when write combining is not supported Tariq Toukan
2025-07-09 17:24 ` Simon Horman
2025-07-08 21:16 ` [PATCH net-next 5/5] net/mlx5e: RX, Remove unnecessary RQT redirects Tariq Toukan
2025-07-09 17:24 ` Simon Horman
2025-07-10 3:00 ` [PATCH net-next 0/5] net/mlx5: misc changes 2025-07-09 patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).