linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] fix ipvlan/macvlan link event handing
@ 2025-04-03  8:58 Hangbin Liu
  2025-04-03  8:58 ` [PATCH net 1/3] ipvlan: fix NETDEV_UP/NETDEV_DOWN event handling Hangbin Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Hangbin Liu @ 2025-04-03  8:58 UTC (permalink / raw)
  To: netdev
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, Shuah Khan, Xiao Liang,
	Kuniyuki Iwashima, Alexander Lobakin, Stanislav Fomichev,
	Venkat Venkatsubra, Etienne Champetier, Di Zhu,
	Nikolay Aleksandrov, Travis Brown, Suresh Krishnan,
	linux-kselftest, Hangbin Liu

When setting the lower-layer link up/down, the ipvlan/macvlan device
synchronizes its state via netif_stacked_transfer_operstate(), which
only checks the carrier state. However, setting the link down does not
necessarily change the carrier state for virtual interfaces like bonding.
This causes the ipvlan/macvlan state to become out of sync with the
lower-layer link state. Fix this by explicitly changing the IFF_UP flag,
similar to how VLAN handles it.

Before the patch:
  # ./rtnetlink.sh -t "kci_test_vlan kci_test_ipvlan kci_test_macvlan"
  PASS: vlan link state correct
  FAIL: ipvlan link state incorrect
  FAIL: macvlan link state incorrect

After the patch set:
  # ./rtnetlink.sh -t "kci_test_vlan kci_test_ipvlan kci_test_macvlan"
  PASS: vlan link state correct
  PASS: ipvlan link state correct
  PASS: macvlan link state correct

Hangbin Liu (3):
  ipvlan: fix NETDEV_UP/NETDEV_DOWN event handling
  macvlan: fix NETDEV_UP/NETDEV_DOWN event handling
  selftests/rtnetlink.sh: add vlan/ipvlan/macvlan link state test

 drivers/net/ipvlan/ipvlan_main.c         | 20 +++++++-
 drivers/net/macvlan.c                    | 20 ++++++++
 tools/testing/selftests/net/rtnetlink.sh | 64 ++++++++++++++++++++++++
 3 files changed, 103 insertions(+), 1 deletion(-)

-- 
2.46.0


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

end of thread, other threads:[~2025-04-14  7:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03  8:58 [PATCH net 0/3] fix ipvlan/macvlan link event handing Hangbin Liu
2025-04-03  8:58 ` [PATCH net 1/3] ipvlan: fix NETDEV_UP/NETDEV_DOWN event handling Hangbin Liu
2025-04-03 10:28   ` Sabrina Dubroca
2025-04-03 13:09     ` Hangbin Liu
2025-04-03 15:00       ` Sabrina Dubroca
2025-04-14  7:02         ` Hangbin Liu
2025-04-03  8:58 ` [PATCH net 2/3] macvlan: " Hangbin Liu
2025-04-03  8:58 ` [PATCH net 3/3] selftests/rtnetlink.sh: add vlan/ipvlan/macvlan link state test Hangbin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).