Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net/mlx5e: Allow set_rx_mode on uplink representor

set_rx_mode handler was skipped on uplink representor, since uplink
relies on FDB to forward all traffic to it by default, which works
perfectly on a single PF per physical port configuration, as explicit
mac request isn't required, but In case of multi-host and DPU
environments, uplink can only use own mac address, as set_rx_mode
wasn't honored in uplink rep.

Since MPFs (Multi PF switch) requires PFs to request explicit mac
forwarding, this patch enables set_rx_mode on uplink representor to
allow PF mac programming into MPFs table in switchdev mode, allowing
use-cases such as arbitrary mac address forwarding via linux bridge.

Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260319005456.82745-1-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Saeed Mahameed and committed by
Jakub Kicinski
609e7925 2e69e558

+12 -3
+10
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
··· 822 822 void mlx5e_fs_set_rx_mode_work(struct mlx5e_flow_steering *fs, 823 823 struct net_device *netdev) 824 824 { 825 + struct mlx5e_priv *priv = netdev_priv(netdev); 825 826 struct mlx5e_l2_table *ea = &fs->l2; 827 + 828 + if (mlx5e_is_uplink_rep(priv)) { 829 + mlx5e_handle_netdev_addr(fs, netdev); 830 + goto update_vport_context; 831 + } 826 832 827 833 bool rx_mode_enable = fs->state_destroy; 828 834 bool promisc_enabled = rx_mode_enable && (netdev->flags & IFF_PROMISC); ··· 869 863 ea->allmulti_enabled = allmulti_enabled; 870 864 ea->broadcast_enabled = broadcast_enabled; 871 865 866 + update_vport_context: 872 867 mlx5e_vport_context_update(fs, netdev); 873 868 } 874 869 ··· 989 982 int err = 0; 990 983 u8 *mc_dmac; 991 984 u8 *mv_dmac; 985 + 986 + if (!ft) 987 + return -EINVAL; 992 988 993 989 spec = kvzalloc_obj(*spec); 994 990 if (!spec)
-3
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 4102 4102 4103 4103 static void mlx5e_nic_set_rx_mode(struct mlx5e_priv *priv) 4104 4104 { 4105 - if (mlx5e_is_uplink_rep(priv)) 4106 - return; /* no rx mode for uplink rep */ 4107 - 4108 4105 queue_work(priv->wq, &priv->set_rx_mode_work); 4109 4106 } 4110 4107
+2
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
··· 1369 1369 netdev_unlock(priv->netdev); 1370 1370 rtnl_unlock(); 1371 1371 1372 + /* clean-up uplink's mpfs mac table */ 1373 + queue_work(priv->wq, &priv->set_rx_mode_work); 1372 1374 mlx5e_rep_bridge_cleanup(priv); 1373 1375 mlx5e_dcbnl_delete_app(priv); 1374 1376 mlx5_notifier_unregister(mdev, &priv->events_nb);