All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 net-next] hsr: use netdev_master_upper_dev_link() when linking lower ports
@ 2025-09-02  6:55 Hangbin Liu
  2025-09-09  9:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Hangbin Liu @ 2025-09-02  6:55 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Jakub Acs, Sebastian Andrzej Siewior,
	Fernando Fernandez Mancera, Taehee Yoo, Hangbin Liu

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>
---

v2: no code change, update description, target to net-next (Jakub Kicinski)

---
 net/hsr/hsr_slave.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c
index 102eccf5ead7..8177ac6c2d26 100644
--- a/net/hsr/hsr_slave.c
+++ b/net/hsr/hsr_slave.c
@@ -143,6 +143,7 @@ static int hsr_portdev_setup(struct hsr_priv *hsr, struct net_device *dev,
 			     struct netlink_ext_ack *extack)
 
 {
+	struct netdev_lag_upper_info lag_upper_info;
 	struct net_device *hsr_dev;
 	struct hsr_port *master;
 	int res;
@@ -159,7 +160,9 @@ static int hsr_portdev_setup(struct hsr_priv *hsr, struct net_device *dev,
 	master = hsr_port_get_hsr(hsr, HSR_PT_MASTER);
 	hsr_dev = master->dev;
 
-	res = netdev_upper_dev_link(dev, hsr_dev, extack);
+	lag_upper_info.tx_type = NETDEV_LAG_TX_TYPE_BROADCAST;
+	lag_upper_info.hash_type = NETDEV_LAG_HASH_UNKNOWN;
+	res = netdev_master_upper_dev_link(dev, hsr_dev, NULL, &lag_upper_info, extack);
 	if (res)
 		goto fail_upper_dev_link;
 
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCHv2 net-next] hsr: use netdev_master_upper_dev_link() when linking lower ports
  2025-09-02  6:55 [PATCHv2 net-next] hsr: use netdev_master_upper_dev_link() when linking lower ports Hangbin Liu
@ 2025-09-09  9:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-09  9:30 UTC (permalink / raw)
  To: Hangbin Liu
  Cc: netdev, davem, edumazet, kuba, pabeni, horms, acsjakub, bigeasy,
	ffmancera, ap420073

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Tue,  2 Sep 2025 06:55:58 +0000 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [PATCHv2,net-next] hsr: use netdev_master_upper_dev_link() when linking lower ports
    https://git.kernel.org/netdev/net-next/c/d67ca09ca39f

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-09  9:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02  6:55 [PATCHv2 net-next] hsr: use netdev_master_upper_dev_link() when linking lower ports Hangbin Liu
2025-09-09  9:30 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.