net/sched: Fix packet loops in mirred and netem
Get series with b4
b4 am [email protected]Versions newest first
- v3 Latest7 patches 8 repliesIn review
Changes in v3 from the cover letter
- Renamed skb->ttl to skb->tc_depth to avoid confusion with IP TTL
- Expanded commit messages
- Split mirred and netem test cases into separate patches
- No code changes from v2
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | net: Introduce skb tc depth field to track packet loopsinclude/ | +2 | 0 replies | |
| 2/7 | net/sched: Revert "net/sched: Restrict conditions for adding duplicating netems to qdisc tree"net/ | +0 | 0 replies | |
| 3/7 | Revert "selftests/tc-testing: Add tests for restrictions on netem duplication"tools/ tools/ | +3 | 0 replies | |
| 4/7 | net/sched: fix packet loop on netem when duplicate is onnet/ | +3 | 1 reply | |
| 5/7 | net/sched: Fix ethx:ingress -> ethy:egress -> ethx:ingress mirred loopnet/ | +30 | 0 replies | |
| 6/7 | selftests/tc-testing: Add mirred test cases exercising loopstools/ | +615 | 0 replies | |
| 7/7 | selftests/tc-testing: Add netem test case exercising loopstools/ | +32 | 2 replies |
Reviews trailers per patch
All 7 patches have a Reviewed-by or Acked-by.
| Patch | Stephen Hemminger | Victor Nogueira | Jamal Hadi Salim | William Liu |
|---|---|---|---|---|
| 1/7 | R-b | |||
| 2/7 | R-b | |||
| 3/7 | R-b | |||
| 4/7 | R-b | R-b | ||
| 5/7 | R-b | T-b | ||
| 6/7 | A-b | A-b | ||
| 7/7 | A-b | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH net v3 0/7] net/sched: Fix packet loops in mirred and netem
This a minor revision of Jamal's series that fixes packet loops caused by mirred ingress redirects and netem duplication in stacked qdisc trees.
The core idea is a 2-bit per-skb tc_depth counter that travels with the packet. The existing per-CPU mirred nest tracking loses state when a packet is deferred through the backlog or moves between CPUs via XPS/RPS. A per-skb field covers both cases.
Patch 1 adds the tc_depth field in a padding hole in sk_buff. Patches 2-3 revert the check_netem_in_tree() fix and its tests, which broke legitimate multi-netem configurations. Patch 4 uses tc_depth to stop netem duplicate recursion. Patch 5 uses tc_depth to catch mirred ingress redirect loops. Patches 6-7 add mirred and netem test cases.
Thanks to Jamal and Victor for fixing this.
There are additional netem bug fixes in the pipeline but those are held back until this series lands.
Changes in v3:
- Renamed skb->ttl to skb->tc_depth to avoid confusion with IP TTL
- Expanded commit messages
- Split mirred and netem test cases into separate patches
- No code changes from v2
Changes in v2:
- Do not reuse skb->from_ingress (which was moved to skb->cb)
Jamal Hadi Salim (5):
net: Introduce skb tc depth field to track packet loops net/sched: Revert "net/sched: Restrict conditions for adding
duplicating netems to qdisc tree"
Revert "selftests/tc-testing: Add tests for restrictions on netem
duplication"
net/sched: fix packet loop on netem when duplicate is on net/sched: Fix ethx:ingress -> ethy:egress -> ethx:ingress mirred loop
Victor Nogueira (2):
selftests/tc-testing: Add mirred test cases exercising loops selftests/tc-testing: Add netem test case exercising loops
include/linux/skbuff.h | 2 + net/sched/act_mirred.c | 47 +- net/sched/sch_netem.c | 47 +- .../tc-testing/tc-tests/actions/mirred.json | 616 +++++++++++++++++- .../tc-testing/tc-tests/infra/qdiscs.json | 5 +- .../tc-testing/tc-tests/qdiscs/netem.json | 96 +-- 6 files changed, 676 insertions(+), 137 deletions(-)
Signature · 1 line
2.53.0