Skip to content

RFC hsr: Implement more robust duplicate discard algorithm

Felix Maurer llvm netdev oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6selftests: hsr: Add ping test for PRPtools/testing/selftests/net/hsr/Makefile tools/testing/selftests/net/hsr/prp_ping.sh+142 -00 replies
2/6selftests: hsr: Check duplicates on HSR with VLANtools/testing/selftests/net/hsr/hsr_ping.sh tools/testing/selftests/net/hsr/settings+64 -1170 replies
3/6selftests: hsr: Add tests for faulty linkstools/testing/selftests/net/hsr/Makefile tools/testing/selftests/net/hsr/hsr_ping.sh tools/testing/selftests/net/hsr/link_faults.sh+270 -110 replies
4/6selftests: hsr: Add tests for more link faults with PRPtools/testing/selftests/net/hsr/link_faults.sh+74 -50 replies
5/6hsr: Implement more robust duplicate discard for PRPnet/hsr/hsr_framereg.c net/hsr/hsr_framereg.h+138 -670 replies
6/6selftests: hsr: Add more link fault tests for HSRtools/testing/selftests/net/hsr/hsr_ping.sh tools/testing/selftests/net/hsr/link_faults.sh tools/testing/selftests/net/hsr/settings+44 -280 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC net 0/6] hsr: Implement more robust duplicate discard algorithm

The PRP duplicate discard algorithm does not work reliably with certain link faults. Especially with packet loss on one link, the duplicate discard algorithm drops valid packets. For a more thorough description see patch 5.

My suggestion is to replace the current, drop window-based algorithm with a new one that tracks the received sequence numbers individually (description again in patch 5). I am sending this as an RFC to gather feedback mainly on two points:

1. Is the design generally acceptable? Of course, this change leads to higher memory usage and more work to do for each packet. But I argue that this is an acceptable trade-off to make for a more robust PRP behavior with faulty links. After all, PRP is to be used in environments where redundancy is needed and people are ready to maintain two duplicate networks to achieve it.
2. As the tests added in patch 6 show, HSR is subject to similar problems. I do not see a reason not to use a very similar algorithm for HSR as well (with a bitmap for each port). Any objections to doing that (in a later patch series)? This will make the trade-off with memory usage more pronounced, as the hsr_seq_block will grow by three more bitmaps, at least for each HSR node (of which we do not expect too many, as an HSR ring can not be infinitely large).

Most of the patches in this series are for the selftests. This is mainly to demonstrate the problems with the current duplicate discard algorithms, not so much about gathering feedback. Especially patch 1 and 2 are rather preparatory cleanups that do not have much to do with the actual problems the new algorithm tries to solve.

A few points I know not yet addressed are:
- HSR duplicate discard (see above).
- The KUnit test is not updated for the new algorithm. I will work on that before actual patch submission.
- Merging the sequence number blocks when two entries in the node table are merged because they belong to the same node.

Thank you for your feedback already!

---

Felix Maurer (6):
selftests: hsr: Add ping test for PRP
selftests: hsr: Check duplicates on HSR with VLAN
selftests: hsr: Add tests for faulty links
selftests: hsr: Add tests for more link faults with PRP
hsr: Implement more robust duplicate discard for PRP
selftests: hsr: Add more link fault tests for HSR

 net/hsr/hsr_framereg.c                        | 181 ++++++---
 net/hsr/hsr_framereg.h                        |  24 +-
 tools/testing/selftests/net/hsr/Makefile      |   2 +
 tools/testing/selftests/net/hsr/hsr_ping.sh   | 198 +++------
 .../testing/selftests/net/hsr/link_faults.sh  | 376 ++++++++++++++++++
 tools/testing/selftests/net/hsr/prp_ping.sh   | 141 +++++++
 tools/testing/selftests/net/hsr/settings      |   2 +-
 7 files changed, 714 insertions(+), 210 deletions(-)
 create mode 100755 tools/testing/selftests/net/hsr/link_faults.sh
 create mode 100755 tools/testing/selftests/net/hsr/prp_ping.sh

--
2.52.0