diff mbox series

[RFC,Focal] UBUNTU: SAUCE: selftests: net: ip_defrag: limit packet to 1000 fragments

Message ID 20200325160020.25605-1-cascardo@canonical.com
State New
Headers show
Series [RFC,Focal] UBUNTU: SAUCE: selftests: net: ip_defrag: limit packet to 1000 fragments | expand

Commit Message

Thadeu Lima de Souza Cascardo March 25, 2020, 4 p.m. UTC
The ip_defrag selftest will fail when run with a conntrack rule because
it might push more than a 1000 fragments through loopback. This will hit
the backlog limit, causing fragments to be dropped, leading to test
failures.

This is considered a real bug by Eric Dumazet, so the test change is
just a workaround so we can keep testing for other regressions while
avoiding this particular failure.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---

Sending this as an RFC as I didn't have the chance to really test it.

If you run only the first or second test after the conntrack rule is added on
ip_defrag.sh, and run ip_defrag.sh under a loop, you will hit this issue after
a couple of dozen runs or so. If I recall correctly, that is.

One fix that I did try was changing the backlog to 1250 and reverting it back
to 1000 after this test is finished. But that could mess up with tests that run
after this one or in case tests are run in parallel, so this other fix would be
preferable, but it hasn't been tested.

---
 tools/testing/selftests/net/ip_defrag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Seth Forshee March 25, 2020, 4:33 p.m. UTC | #1
On Wed, Mar 25, 2020 at 01:00:20PM -0300, Thadeu Lima de Souza Cascardo wrote:
> The ip_defrag selftest will fail when run with a conntrack rule because
> it might push more than a 1000 fragments through loopback. This will hit
> the backlog limit, causing fragments to be dropped, leading to test
> failures.
> 
> This is considered a real bug by Eric Dumazet, so the test change is
> just a workaround so we can keep testing for other regressions while
> avoiding this particular failure.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> ---
> 
> Sending this as an RFC as I didn't have the chance to really test it.
> 
> If you run only the first or second test after the conntrack rule is added on
> ip_defrag.sh, and run ip_defrag.sh under a loop, you will hit this issue after
> a couple of dozen runs or so. If I recall correctly, that is.
> 
> One fix that I did try was changing the backlog to 1250 and reverting it back
> to 1000 after this test is finished. But that could mess up with tests that run
> after this one or in case tests are run in parallel, so this other fix would be
> preferable, but it hasn't been tested.

The test already fails, so little harm in trying this workaround.
Applied, we'll see if it helps. Thanks!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/ip_defrag.c b/tools/testing/selftests/net/ip_defrag.c
index c0c9ecb891e1..b53fb67f8e5e 100644
--- a/tools/testing/selftests/net/ip_defrag.c
+++ b/tools/testing/selftests/net/ip_defrag.c
@@ -36,7 +36,7 @@  const struct in6_addr addr6 = IN6ADDR_LOOPBACK_INIT;
 static int payload_len;
 static int max_frag_len;
 
-#define MSG_LEN_MAX	10000	/* Max UDP payload length. */
+#define MSG_LEN_MAX	8000	/* Max UDP payload length. */
 
 #define IP4_MF		(1u << 13)  /* IPv4 MF flag. */
 #define IP6_MF		(1)  /* IPv6 MF flag. */