Skip to content

Commit da6f58c

Browse files
author
Hangbin Liu
committed
hsr: use netdev_master_upper_dev_link() when linking lower ports
JIRA: https://issues.redhat.com/browse/RHEL-100715 Upstream Status: net.git commit d67ca09 commit d67ca09 Author: Hangbin Liu <liuhangbin@gmail.com> Date: Tue Sep 2 06:55:58 2025 +0000 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> Signed-off-by: Hangbin Liu <haliu@redhat.com>
1 parent 008ae62 commit da6f58c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/hsr/hsr_slave.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ static int hsr_portdev_setup(struct hsr_priv *hsr, struct net_device *dev,
137137
struct netlink_ext_ack *extack)
138138

139139
{
140+
struct netdev_lag_upper_info lag_upper_info;
140141
struct net_device *hsr_dev;
141142
struct hsr_port *master;
142143
int res;
@@ -153,7 +154,9 @@ static int hsr_portdev_setup(struct hsr_priv *hsr, struct net_device *dev,
153154
master = hsr_port_get_hsr(hsr, HSR_PT_MASTER);
154155
hsr_dev = master->dev;
155156

156-
res = netdev_upper_dev_link(dev, hsr_dev, extack);
157+
lag_upper_info.tx_type = NETDEV_LAG_TX_TYPE_BROADCAST;
158+
lag_upper_info.hash_type = NETDEV_LAG_HASH_UNKNOWN;
159+
res = netdev_master_upper_dev_link(dev, hsr_dev, NULL, &lag_upper_info, extack);
157160
if (res)
158161
goto fail_upper_dev_link;
159162

0 commit comments

Comments
 (0)