Skip to content

netem: Fix skb duplication logic and prevent infinite loops

Cong Wang netdev 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest9 patches 7 repliesIn review
  2. v79 patches 2 repliesSuperseded
  3. v68 patches 7 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v59 patches14 repliesSuperseded
v46 patches6 repliesSuperseded
v34 patches6 repliesSuperseded
v22 patches6 repliesSuperseded
v12 patches13 repliesSuperseded

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9net_sched: Check the return value of qfq_choose_next_agg()net/sched/sch_qfq.c+2 -00 replies
2/9Revert "net/sched: Restrict conditions for adding duplicating netems to qdisc tree"net/sched/sch_netem.c+0 -400 replies
3/9Revert "selftests/tc-testing: Add tests for restrictions on netem duplication"tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json tools/testing/selftests/tc-testing/tc-tests/qdiscs/netem.json+3 -830 replies
4/9net_sched: Implement the right netem duplication behaviornet/sched/sch_netem.c+17 -100 replies
5/9selftests/tc-testing: Add a nested netem duplicate testtools/testing/selftests/tc-testing/tc-tests/qdiscs/netem.json+25 -00 replies
6/9selftests/tc-testing: Add a test case for prio with netem duplicatetools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json+29 -00 replies
7/9selftests/tc-testing: Add a test case for mq with netem duplicatetools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json+31 -00 replies
8/9selftests/tc-testing: Update test cases with netem duplicatetools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json+23 -270 replies
9/9selftests/tc-testing: Add a test case for HTB with netemtools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json+33 -00 replies

Reviews trailers per patch

2 of 9 patches have a Reviewed-by or Acked-by.

PatchXiang MeiStephen Hemminger
1/9R-b A-b
2/9
3/9
4/9A-b
5/9
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [Patch net v8 0/9] netem: Fix skb duplication logic and prevent infinite loops

This patchset fixes the infinite loops due to duplication in netem, the real root cause of this problem is enqueuing to the root qdisc, which is now changed to enqueuing to the same qdisc. This is more reasonable, more intuitive from users' perspective, less error-prone and more elegant from kernel developers' perspective.

Please see more details in patch 4/9 which contains two pages of detailed explanation including why it is safe and better.

This reverts the offending commits from William which clearly broke mq+netem use cases, as reported by two users.

All the TC test cases pass with this patchset.

---
v8: Fixed test 7c3b

v7: Fixed a typo in subject
Fixed a missing qdisc_tree_reduce_backlog()
Added a new selftest for backlog validation

v6: Dropped the init_user_ns check patch
Reordered the qfq patch
Rebased to the latest -net branch

v5: Reverted the offending commits
Added a init_user_ns check (4/9)
Rebased to the latest -net branch

v4: Added a fix for qfq qdisc (2/6)
Updated 1/6 patch description
Added a patch to update the enqueue reentrant behaviour tests

v3: Fixed the root cause of enqueuing to root
Switched back to netem_skb_cb safely
Added two more test cases

v2: Fixed a typo
Improved tdc selftest to check sent bytes

Cong Wang (9):
net_sched: Check the return value of qfq_choose_next_agg() 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: Implement the right netem duplication behavior selftests/tc-testing: Add a nested netem duplicate test selftests/tc-testing: Add a test case for prio with netem duplicate selftests/tc-testing: Add a test case for mq with netem duplicate selftests/tc-testing: Update test cases with netem duplicate selftests/tc-testing: Add a test case for HTB with netem

 net/sched/sch_netem.c                         |  67 +++-----
 net/sched/sch_qfq.c                           |   2 +
 .../tc-testing/tc-tests/infra/qdiscs.json     | 144 ++++++++++++++----
 .../tc-testing/tc-tests/qdiscs/netem.json     |  90 +++--------
 4 files changed, 153 insertions(+), 150 deletions(-)
Signature · 1 line
2.34.1