* [PATCH net-next] net/mlx5e: Enable mac forwarding on uplink representor
@ 2026-03-10 10:48 Tariq Toukan
2026-03-12 3:33 ` Jakub Kicinski
0 siblings, 1 reply; 6+ messages in thread
From: Tariq Toukan @ 2026-03-10 10:48 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Tariq Toukan, Mark Bloch, Leon Romanovsky, netdev,
linux-rdma, linux-kernel, Gal Pressman, Moshe Shemesh,
Dragos Tatulea
From: Saeed Mahameed <saeedm@nvidia.com>
MAC forwarding and namely 'set_rx_mode' handler, was disabled on uplink
representor as they rely on FDB to forward all traffic to it by default,
which works perfectly on a single PF per physical port configuration.
But, in case of multi-host and DPU environments, uplink was stuck
with its own mac, since MPFs (Multi PF switch) requires PFs to request
explicit mac forwarding.
This small patch enables mac forwarding to MPFs via uplink representor,
by enabling only the mac (uc/mc) list handling logic in
mlx5e_set_rx_mode() handler for uplink representor netdevs.
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 10 ++++++++++
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ---
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 ++
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
index 9352e2183312..d7556d611155 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
@@ -823,8 +823,14 @@ static void mlx5e_destroy_promisc_table(struct mlx5e_flow_steering *fs)
void mlx5e_fs_set_rx_mode_work(struct mlx5e_flow_steering *fs,
struct net_device *netdev)
{
+ struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5e_l2_table *ea = &fs->l2;
+ if (mlx5e_is_uplink_rep(priv)) {
+ mlx5e_handle_netdev_addr(fs, netdev);
+ goto update_vport_context;
+ }
+
bool rx_mode_enable = fs->state_destroy;
bool promisc_enabled = rx_mode_enable && (netdev->flags & IFF_PROMISC);
bool allmulti_enabled = rx_mode_enable && (netdev->flags & IFF_ALLMULTI);
@@ -864,6 +870,7 @@ void mlx5e_fs_set_rx_mode_work(struct mlx5e_flow_steering *fs,
ea->allmulti_enabled = allmulti_enabled;
ea->broadcast_enabled = broadcast_enabled;
+update_vport_context:
mlx5e_vport_context_update(fs, netdev);
}
@@ -984,6 +991,9 @@ static int mlx5e_add_l2_flow_rule(struct mlx5e_flow_steering *fs,
u8 *mc_dmac;
u8 *mv_dmac;
+ if (!ft)
+ return -EINVAL;
+
spec = kvzalloc_obj(*spec);
if (!spec)
return -ENOMEM;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index f7009da94f0b..3eebdf402129 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -4102,9 +4102,6 @@ mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
static void mlx5e_nic_set_rx_mode(struct mlx5e_priv *priv)
{
- if (mlx5e_is_uplink_rep(priv))
- return; /* no rx mode for uplink rep */
-
queue_work(priv->wq, &priv->set_rx_mode_work);
}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 1db4ecb2356f..8992f0f7a870 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -1369,6 +1369,8 @@ static void mlx5e_uplink_rep_disable(struct mlx5e_priv *priv)
netdev_unlock(priv->netdev);
rtnl_unlock();
+ /* clean-up uplink's mpfs mac table */
+ queue_work(priv->wq, &priv->set_rx_mode_work);
mlx5e_rep_bridge_cleanup(priv);
mlx5e_dcbnl_delete_app(priv);
mlx5_notifier_unregister(mdev, &priv->events_nb);
base-commit: 52ede1bce557c66309f41ac29dd190be23ca9129
--
2.44.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net/mlx5e: Enable mac forwarding on uplink representor
2026-03-10 10:48 [PATCH net-next] net/mlx5e: Enable mac forwarding on uplink representor Tariq Toukan
@ 2026-03-12 3:33 ` Jakub Kicinski
2026-03-17 18:12 ` Saeed Mahameed
0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2026-03-12 3:33 UTC (permalink / raw)
To: Tariq Toukan
Cc: Eric Dumazet, Paolo Abeni, Andrew Lunn, David S. Miller,
Saeed Mahameed, Mark Bloch, Leon Romanovsky, netdev, linux-rdma,
linux-kernel, Gal Pressman, Moshe Shemesh, Dragos Tatulea
On Tue, 10 Mar 2026 12:48:41 +0200 Tariq Toukan wrote:
> This small patch enables mac forwarding to MPFs via uplink representor,
"mac forwarding to MPF via uplink representor"
Can't wrap my head around this "via". Could you explain this better?
Perhaps some tool can spit out a little diagram to make the flow clear?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net/mlx5e: Enable mac forwarding on uplink representor
2026-03-12 3:33 ` Jakub Kicinski
@ 2026-03-17 18:12 ` Saeed Mahameed
2026-03-17 21:36 ` Jakub Kicinski
0 siblings, 1 reply; 6+ messages in thread
From: Saeed Mahameed @ 2026-03-17 18:12 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Tariq Toukan, Eric Dumazet, Paolo Abeni, Andrew Lunn,
David S. Miller, Saeed Mahameed, Mark Bloch, Leon Romanovsky,
netdev, linux-rdma, linux-kernel, Gal Pressman, Moshe Shemesh,
Dragos Tatulea
On 11 Mar 20:33, Jakub Kicinski wrote:
>On Tue, 10 Mar 2026 12:48:41 +0200 Tariq Toukan wrote:
>> This small patch enables mac forwarding to MPFs via uplink representor,
>
>"mac forwarding to MPF via uplink representor"
>Can't wrap my head around this "via". Could you explain this better?
>Perhaps some tool can spit out a little diagram to make the flow clear?
>
Mac forwarding in the sense of linux bridge mac forwarding mechanism which
requires set_rx_mode ndo to be implemented.
Linux-bridge --> mlx5-uplink-rep --> set_rx_mode --> set up mac in HW.
Thanks,
Saeed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net/mlx5e: Enable mac forwarding on uplink representor
2026-03-17 18:12 ` Saeed Mahameed
@ 2026-03-17 21:36 ` Jakub Kicinski
2026-03-18 19:10 ` Saeed Mahameed
0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2026-03-17 21:36 UTC (permalink / raw)
To: Saeed Mahameed
Cc: Tariq Toukan, Eric Dumazet, Paolo Abeni, Andrew Lunn,
David S. Miller, Saeed Mahameed, Mark Bloch, Leon Romanovsky,
netdev, linux-rdma, linux-kernel, Gal Pressman, Moshe Shemesh,
Dragos Tatulea
On Tue, 17 Mar 2026 11:12:15 -0700 Saeed Mahameed wrote:
> On 11 Mar 20:33, Jakub Kicinski wrote:
> >On Tue, 10 Mar 2026 12:48:41 +0200 Tariq Toukan wrote:
> >> This small patch enables mac forwarding to MPFs via uplink representor,
> >
> >"mac forwarding to MPF via uplink representor"
> >Can't wrap my head around this "via". Could you explain this better?
> >Perhaps some tool can spit out a little diagram to make the flow clear?
> >
>
> Mac forwarding in the sense of linux bridge mac forwarding mechanism which
> requires set_rx_mode ndo to be implemented.
>
> Linux-bridge --> mlx5-uplink-rep --> set_rx_mode --> set up mac in HW.
And the actual forwarding happens in SW bridge? This is just to
configure the Rx filter not to discard on Rx?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net/mlx5e: Enable mac forwarding on uplink representor
2026-03-17 21:36 ` Jakub Kicinski
@ 2026-03-18 19:10 ` Saeed Mahameed
2026-03-18 23:44 ` Jakub Kicinski
0 siblings, 1 reply; 6+ messages in thread
From: Saeed Mahameed @ 2026-03-18 19:10 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Tariq Toukan, Eric Dumazet, Paolo Abeni, Andrew Lunn,
David S. Miller, Saeed Mahameed, Mark Bloch, Leon Romanovsky,
netdev, linux-rdma, linux-kernel, Gal Pressman, Moshe Shemesh,
Dragos Tatulea
On 17 Mar 14:36, Jakub Kicinski wrote:
>On Tue, 17 Mar 2026 11:12:15 -0700 Saeed Mahameed wrote:
>> On 11 Mar 20:33, Jakub Kicinski wrote:
>> >On Tue, 10 Mar 2026 12:48:41 +0200 Tariq Toukan wrote:
>> >> This small patch enables mac forwarding to MPFs via uplink representor,
>> >
>> >"mac forwarding to MPF via uplink representor"
>> >Can't wrap my head around this "via". Could you explain this better?
>> >Perhaps some tool can spit out a little diagram to make the flow clear?
>> >
>>
>> Mac forwarding in the sense of linux bridge mac forwarding mechanism which
>> requires set_rx_mode ndo to be implemented.
>>
>> Linux-bridge --> mlx5-uplink-rep --> set_rx_mode --> set up mac in HW.
>
>And the actual forwarding happens in SW bridge? This is just to
>configure the Rx filter not to discard on Rx?
Yes Forwarding happens on the SW bridge, just to register the mac so it
won't get dropped.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net/mlx5e: Enable mac forwarding on uplink representor
2026-03-18 19:10 ` Saeed Mahameed
@ 2026-03-18 23:44 ` Jakub Kicinski
0 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2026-03-18 23:44 UTC (permalink / raw)
To: Saeed Mahameed
Cc: Tariq Toukan, Eric Dumazet, Paolo Abeni, Andrew Lunn,
David S. Miller, Saeed Mahameed, Mark Bloch, Leon Romanovsky,
netdev, linux-rdma, linux-kernel, Gal Pressman, Moshe Shemesh,
Dragos Tatulea
On Wed, 18 Mar 2026 12:10:37 -0700 Saeed Mahameed wrote:
> >> Mac forwarding in the sense of linux bridge mac forwarding mechanism which
> >> requires set_rx_mode ndo to be implemented.
> >>
> >> Linux-bridge --> mlx5-uplink-rep --> set_rx_mode --> set up mac in HW.
> >
> >And the actual forwarding happens in SW bridge? This is just to
> >configure the Rx filter not to discard on Rx?
>
> Yes Forwarding happens on the SW bridge, just to register the mac so it
> won't get dropped.
Ah! Please respin with a better explanation and calling that out?
I think it's fair for the reader to assume offload when reading
about representors.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-03-18 23:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 10:48 [PATCH net-next] net/mlx5e: Enable mac forwarding on uplink representor Tariq Toukan
2026-03-12 3:33 ` Jakub Kicinski
2026-03-17 18:12 ` Saeed Mahameed
2026-03-17 21:36 ` Jakub Kicinski
2026-03-18 19:10 ` Saeed Mahameed
2026-03-18 23:44 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox