]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: hsr: Add tests for more link faults with PRP
authorFelix Maurer <fmaurer@redhat.com>
Thu, 5 Feb 2026 13:57:32 +0000 (14:57 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 10 Feb 2026 11:02:29 +0000 (12:02 +0100)
commit8908c3c8cef437d8d2ad41f9b23f4305029d1782
tree3a159cc36e7cbc929ab022bbde62f9fef7f32e20
parent415e6367512bf8faca93eaaf46fbe23d841b4509
selftests: hsr: Add tests for more link faults with PRP

Add tests where one link has different rates of packet loss or reorders
packets. PRP should still be able to recover from these link faults and
show no packet loss.  However, it is acceptable to receive some level of
duplicate packets. This matches the current specification (IEC
62439-3:2021) of the duplicate discard algorithm that requires it to be
"designed such that it never rejects a legitimate frame, while occasional
acceptance of a duplicate can be tolerated." The rate of acceptable
duplicates in this test is intentionally high (10%) to make the test
stable, the values I observed in the worst test cases (20% loss) are around
5% duplicates.

The duplicates occur because of the 10ms ping interval in the test. As
blocks expire after 400ms based on the timestamp of the first received
sequence number in the block, every approx. 40th will lead to a new, clean
block being used where the sequence number hasn't been seen before. As this
occurs on both nodes in the test (for requests and replies), we observe
around 20 duplicate frames.

Signed-off-by: Felix Maurer <fmaurer@redhat.com>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://patch.msgid.link/7b36506d3a80e53786fe56526cf6046c74dfeee1.1770299429.git.fmaurer@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/net/hsr/link_faults.sh