public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/3] net: Fix protodown with macvlan
@ 2026-05-05  8:16 Ido Schimmel
  2026-05-05  8:16 ` [PATCH net-next v2 1/3] net: Do not inherit operational state when protodown is on Ido Schimmel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ido Schimmel @ 2026-05-05  8:16 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, pabeni, edumazet, 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 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.

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

Patch #1 solves the first problem by making
netif_stacked_transfer_operstate() return early when protodown is on.

Patch #2 solves the second problem by calling
netif_stacked_transfer_operstate() instead of netif_carrier_on() when
protodown is disabled on a net device that has a linked net 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).

Note that while these changes are in the core, they should only affect
macvlan as protodown is only supported by macvlan and vxlan and only the
former has a linked net device.

v2:
- Move protodown handling away from drivers to the core (Jakub).
- Add a new test case for vxlan.
v1: https://lore.kernel.org/netdev/20260429124624.835335-1-idosch@nvidia.com/

Ido Schimmel (3):
  net: Do not inherit operational state when protodown is on
  net: Do not unconditionally turn on carrier when turning off protodown
  selftests: net: Add protodown tests

 net/core/dev.c                           |  28 +++-
 tools/testing/selftests/net/Makefile     |   1 +
 tools/testing/selftests/net/protodown.sh | 182 +++++++++++++++++++++++
 3 files changed, 209 insertions(+), 2 deletions(-)
 create mode 100755 tools/testing/selftests/net/protodown.sh

-- 
2.54.0


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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05  8:16 [PATCH net-next v2 0/3] net: Fix protodown with macvlan Ido Schimmel
2026-05-05  8:16 ` [PATCH net-next v2 1/3] net: Do not inherit operational state when protodown is on Ido Schimmel
2026-05-05  8:16 ` [PATCH net-next v2 2/3] net: Do not unconditionally turn on carrier when turning off protodown Ido Schimmel
2026-05-05  8:16 ` [PATCH net-next v2 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