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.

hsr: use netdev_master_upper_dev_link() when linking lower ports

Unlike VLAN devices, HSR changes the lower device’s rx_handler, which
prevents the lower device from being attached to another master.
Switch to using netdev_master_upper_dev_link() when setting up the lower
device.

This could improves user experience, since ip link will now display the
HSR device as the master for its ports.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://patch.msgid.link/20250902065558.360927-1-liuhangbin@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Hangbin Liu and committed by
Paolo Abeni
d67ca09c c27334ae

+4 -1
+4 -1
net/hsr/hsr_slave.c
··· 143 143 struct netlink_ext_ack *extack) 144 144 145 145 { 146 + struct netdev_lag_upper_info lag_upper_info; 146 147 struct net_device *hsr_dev; 147 148 struct hsr_port *master; 148 149 int res; ··· 160 159 master = hsr_port_get_hsr(hsr, HSR_PT_MASTER); 161 160 hsr_dev = master->dev; 162 161 163 - res = netdev_upper_dev_link(dev, hsr_dev, extack); 162 + lag_upper_info.tx_type = NETDEV_LAG_TX_TYPE_BROADCAST; 163 + lag_upper_info.hash_type = NETDEV_LAG_HASH_UNKNOWN; 164 + res = netdev_master_upper_dev_link(dev, hsr_dev, NULL, &lag_upper_info, extack); 164 165 if (res) 165 166 goto fail_upper_dev_link; 166 167