Skip to content

Commit 7907f23

Browse files
Aviv Hellerrleon
authored andcommitted
net/mlx5: Implement RoCE LAG feature
Available on dual port cards only, this feature keeps track, using netdev LAG events, of the bonding and link status of each port's PF netdev. When both of the card's PF netdevs are enslaved to the same bond/team master, and only them, LAG state is active. During LAG, only one IB device is present for both ports. In addition to the above, this commit includes FW commands used for managing the LAG, new facilities for adding and removing a single device by interface, and port remap functionality according to bond events. Please note that this feature is currently used only for mimicking Ethernet bonding for RoCE - netdevs functionality is not altered, and their bonding continues to be managed solely by bond/team driver. Signed-off-by: Aviv Heller <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 84df61e commit 7907f23

File tree

6 files changed

+588
-14
lines changed

6 files changed

+588
-14
lines changed

drivers/net/ethernet/mellanox/mlx5/core/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ obj-$(CONFIG_MLX5_CORE) += mlx5_core.o
33
mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
44
health.o mcg.o cq.o srq.o alloc.o qp.o port.o mr.o pd.o \
55
mad.o transobj.o vport.o sriov.o fs_cmd.o fs_core.o \
6-
fs_counters.o rl.o
6+
fs_counters.o rl.o lag.o
77

88
mlx5_core-$(CONFIG_MLX5_CORE_EN) += wq.o eswitch.o eswitch_offloads.o \
99
en_main.o en_common.o en_fs.o en_ethtool.o en_tx.o \

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3369,6 +3369,8 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv)
33693369
struct mlx5_eswitch *esw = mdev->priv.eswitch;
33703370
struct mlx5_eswitch_rep rep;
33713371

3372+
mlx5_lag_add(mdev, netdev);
3373+
33723374
if (mlx5e_vxlan_allowed(mdev)) {
33733375
rtnl_lock();
33743376
udp_tunnel_get_rx_info(netdev);
@@ -3391,6 +3393,7 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv)
33913393
{
33923394
queue_work(priv->wq, &priv->set_rx_mode_work);
33933395
mlx5e_disable_async_events(priv);
3396+
mlx5_lag_remove(priv->mdev);
33943397
}
33953398

33963399
static const struct mlx5e_profile mlx5e_nic_profile = {

0 commit comments

Comments
 (0)