public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] net: Fix protodown with macvlan
@ 2026-04-29 12:46 Ido Schimmel
  2026-04-29 12:46 ` [PATCH net-next 1/3] net: Do not unconditionally turn on carrier when clearing protodown Ido Schimmel
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Ido Schimmel @ 2026-04-29 12:46 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, pabeni, edumazet, andrew+netdev, horms, petrm,
	Ido Schimmel

When protodown is enabled on a macvlan, two bugs cause the macvlan to
incorrectly report an UP operational state:

1. Toggling protodown on and then off on the macvlan while the lower
device has no carrier causes the macvlan to report UP instead of
LOWERLAYERDOWN, since netif_change_proto_down() unconditionally turns
the carrier on.

2. Toggling the lower device's carrier while protodown is enabled on the
macvlan causes the macvlan to inherit the UP operational state,
effectively bypassing the protodown mechanism.

Patch #1 solves the first problem by introducing a new NDO that allows
different drivers to react differently to protodown being cleared. For
macvlan it is implemented by transferring the operational state from the
lower device. For vxlan (the other driver that supports protodown) it
continues to be implemented by turning on the carrier.

Patch #2 prevents a macvlan with protodown enabled from inheriting the
operational state of its lower device.

Patch #3 adds a selftest covering both bugs and the basic protodown
functionality.

Targeting at net-next since these are not regressions (i.e., never
worked).

Ido Schimmel (3):
  net: Do not unconditionally turn on carrier when clearing protodown
  macvlan: Do not transfer operational state when protodown is enabled
  selftests: net: Add protodown tests

 .../networking/net_cachelines/net_device.rst  |   1 -
 drivers/net/macvlan.c                         |  12 +-
 drivers/net/vxlan/vxlan_core.c                |   8 +-
 include/linux/netdevice.h                     |   6 +-
 net/core/dev.c                                |   4 +-
 net/core/rtnetlink.c                          |   2 +-
 tools/testing/selftests/net/Makefile          |   1 +
 tools/testing/selftests/net/protodown.sh      | 160 ++++++++++++++++++
 8 files changed, 185 insertions(+), 9 deletions(-)
 create mode 100755 tools/testing/selftests/net/protodown.sh

-- 
2.53.0


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

end of thread, other threads:[~2026-05-05  0:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-29 12:46 [PATCH net-next 0/3] net: Fix protodown with macvlan Ido Schimmel
2026-04-29 12:46 ` [PATCH net-next 1/3] net: Do not unconditionally turn on carrier when clearing protodown Ido Schimmel
2026-05-02  1:08   ` Jakub Kicinski
2026-05-03 18:08     ` Ido Schimmel
2026-05-05  0:55       ` Jakub Kicinski
2026-04-29 12:46 ` [PATCH net-next 2/3] macvlan: Do not transfer operational state when protodown is enabled Ido Schimmel
2026-05-02  1:09   ` Jakub Kicinski
2026-05-03 18:19     ` Ido Schimmel
2026-05-05  0:57       ` Jakub Kicinski
2026-04-29 12:46 ` [PATCH net-next 3/3] selftests: net: Add protodown tests Ido Schimmel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox