net: Fix protodown with macvlan
Status from this message: This series was applied to netdev/net-next.git (main)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest4 patches 0 repliesApplied 4/4
- v23 patches 1 replySuperseded
- v13 patches 6 repliesSuperseded
Changes in v3 from the cover letter
- Keep protodown restricted to carrier state and avoid changing / calling netif_stacked_transfer_operstate().
v2: https://lore.kernel.org/netdev/[email protected]/
- Move protodown handling away from drivers to the core (Jakub).
- Add a new test case for vxlan.
v1: https://lore.kernel.org/netdev/[email protected]/
Patches in v3 All 4 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | net: Set dev->proto_down before changing carrier statenet/ | +1 | 0 replies | Applied |
| 2/4 | net: Do not turn on carrier when protodown is onnet/ | +3 | 0 replies | Applied |
| 3/4 | net: Do not unconditionally turn on carrier when turning off protodownnet/ | +20 | 0 replies | Applied |
| 4/4 | selftests: net: Add protodown teststools/ tools/ | +183 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH net-next v3 0/4] net: Fix protodown with macvlan
When protodown is enabled on a macvlan, two bugs cause the macvlan to incorrectly gain carrier:
1. Toggling the lower device's carrier while protodown is enabled on the macvlan causes the macvlan to gain carrier, 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 gain carrier, since netif_change_proto_down() unconditionally turns the carrier on.
Patch #1 is a preparation.
Patch #2 solves the first problem by making netif_carrier_on() return early when protodown is on.
Patch #3 solves the second problem by only calling netif_carrier_on() when protodown is turned off if there is no linked net device or if the linked net device has a carrier.
Patch #4 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.
v3:
- Keep protodown restricted to carrier state and avoid changing / calling netif_stacked_transfer_operstate().
v2: https://lore.kernel.org/netdev/[email protected]/
- Move protodown handling away from drivers to the core (Jakub).
- Add a new test case for vxlan.
v1: https://lore.kernel.org/netdev/[email protected]/
Ido Schimmel (4):
net: Set dev->proto_down before changing carrier state
net: Do not turn on carrier when protodown is on
net: Do not unconditionally turn on carrier when turning off protodown
selftests: net: Add protodown tests
net/core/dev.c | 23 ++- net/sched/sch_generic.c | 3 + tools/testing/selftests/net/Makefile | 1 + tools/testing/selftests/net/protodown.sh | 182 +++++++++++++++++++++++ 4 files changed, 207 insertions(+), 2 deletions(-) create mode 100755 tools/testing/selftests/net/protodown.sh
Signature · 1 line
2.54.0