Patch "selftests: xsk: Deflakify STATS_RX_DROPPED test" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests: xsk: Deflakify STATS_RX_DROPPED test

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-xsk-deflakify-stats_rx_dropped-test.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0d458f6aee9f3db567e9b7242fcfb591fb945409
Author: Kal Conley <kal.conley@xxxxxxxxxxx>
Date:   Mon Apr 3 14:03:59 2023 +0200

    selftests: xsk: Deflakify STATS_RX_DROPPED test
    
    [ Upstream commit 68e7322142f5e731af222892d384d311835db0f1 ]
    
    Fix flaky STATS_RX_DROPPED test. The receiver calls getsockopt after
    receiving the last (valid) packet which is not the final packet sent in
    the test (valid and invalid packets are sent in alternating fashion with
    the final packet being invalid). Since the last packet may or may not
    have been dropped already, both outcomes must be allowed.
    
    This issue could also be fixed by making sure the last packet sent is
    valid. This alternative is left as an exercise to the reader (or the
    benevolent maintainers of this file).
    
    This problem was quite visible on certain setups. On one machine this
    failure was observed 50% of the time.
    
    Also, remove a redundant assignment of pkt_stream->nb_pkts. This field
    is already initialized by __pkt_stream_alloc.
    
    Fixes: 27e934bec35b ("selftests: xsk: make stat tests not spin on getsockopt")
    Signed-off-by: Kal Conley <kal.conley@xxxxxxxxxxx>
    Acked-by: Magnus Karlsson <magnus.karlsson@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20230403120400.31018-1-kal.conley@xxxxxxxxxxx
    Signed-off-by: Martin KaFai Lau <martin.lau@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c
index 2290982758961..b74dddf6bbbe5 100644
--- a/tools/testing/selftests/bpf/xskxceiver.c
+++ b/tools/testing/selftests/bpf/xskxceiver.c
@@ -649,7 +649,6 @@ static struct pkt_stream *pkt_stream_generate(struct xsk_umem_info *umem, u32 nb
 	if (!pkt_stream)
 		exit_with_error(ENOMEM);
 
-	pkt_stream->nb_pkts = nb_pkts;
 	for (i = 0; i < nb_pkts; i++) {
 		pkt_set(umem, &pkt_stream->pkts[i], (i % umem->num_frames) * umem->frame_size,
 			pkt_len);
@@ -1142,7 +1141,14 @@ static int validate_rx_dropped(struct ifobject *ifobject)
 	if (err)
 		return TEST_FAILURE;
 
-	if (stats.rx_dropped == ifobject->pkt_stream->nb_pkts / 2)
+	/* The receiver calls getsockopt after receiving the last (valid)
+	 * packet which is not the final packet sent in this test (valid and
+	 * invalid packets are sent in alternating fashion with the final
+	 * packet being invalid). Since the last packet may or may not have
+	 * been dropped already, both outcomes must be allowed.
+	 */
+	if (stats.rx_dropped == ifobject->pkt_stream->nb_pkts / 2 ||
+	    stats.rx_dropped == ifobject->pkt_stream->nb_pkts / 2 - 1)
 		return TEST_PASS;
 
 	return TEST_FAILURE;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux