From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2F7B35F8AF; Wed, 3 Dec 2025 16:33:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764779603; cv=none; b=E6zsc0zPz6XWkX01cF6ZbLnObFhOlhX9zK/36ETauazbvMRKxRLwB8uqn7CPcmDPghIY7XklK5Ks8DFN1k/8G/0SMR7fIYmS4iFsBKynYy9HWFvVnIblbFg5ygLbWz9PS/xQQr3hM66pMpwmZaGgTS+8hVfhjz1sVJKACTRh9vg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764779603; c=relaxed/simple; bh=WE9FdAkWfUHbjz+jcA9UG10k9xXj+sCvh5xVGFUzD3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ReOQbJsSJgQ7sLasDbnWjvfe9Nx8LkGABuCgyYkbVpbNa+SNGe6li6jPWQb4FvlS1gTv9XzTJvvE73wqRdu2JE1sxfaWVJ05rsECAOZ1XLuMCTpwt3VhwbwsEWCS2je1O5022Lssdsum2JU8jNtmLdXRFwjb1gM3MP624sRR494= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LQMXVOiC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="LQMXVOiC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53B01C4CEF5; Wed, 3 Dec 2025 16:33:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764779602; bh=WE9FdAkWfUHbjz+jcA9UG10k9xXj+sCvh5xVGFUzD3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LQMXVOiCY5dPstK8RzuYKsu/esPha+piwSkBhJbsRbw+eZK8GMsjgYtthhUv1dr9o gzrKaZWprZ0nz+Hunwho0VECg1NjpsNoIdN//0LF8+hePN6YoadWoDOQb7axrPvseS /RZoeDqGg8mZ+W+kZkMB6aqBHt9nkx8bzJPLlkNI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Willem de Bruijn , Anubhav Singh , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 306/568] selftests/net: fix out-of-order delivery of FIN in gro:tcp test Date: Wed, 3 Dec 2025 16:25:08 +0100 Message-ID: <20251203152451.916884206@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251203152440.645416925@linuxfoundation.org> References: <20251203152440.645416925@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Anubhav Singh [ Upstream commit 02d064de05b1fcca769391fa82d205bed8bb9bf0 ] Due to the gro_sender sending data packets and FIN packets in very quick succession, these are received almost simultaneously by the gro_receiver. FIN packets are sometimes processed before the data packets leading to intermittent (~1/100) test failures. This change adds a delay of 100ms before sending FIN packets in gro:tcp test to avoid the out-of-order delivery. The same mitigation already exists for the gro:ip test. Fixes: 7d1575014a63 ("selftests/net: GRO coalesce test") Reviewed-by: Willem de Bruijn Signed-off-by: Anubhav Singh Link: https://patch.msgid.link/20251030062818.1562228-1-anubhavsinggh@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- tools/testing/selftests/net/gro.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/net/gro.c b/tools/testing/selftests/net/gro.c index 30024d0ed3739..ad7b07084ca24 100644 --- a/tools/testing/selftests/net/gro.c +++ b/tools/testing/selftests/net/gro.c @@ -802,6 +802,7 @@ static void check_recv_pkts(int fd, int *correct_payload, static void gro_sender(void) { + const int fin_delay_us = 100 * 1000; static char fin_pkt[MAX_HDR_LEN]; struct sockaddr_ll daddr = {}; int txfd = -1; @@ -845,15 +846,22 @@ static void gro_sender(void) write_packet(txfd, fin_pkt, total_hdr_len, &daddr); } else if (strcmp(testname, "tcp") == 0) { send_changed_checksum(txfd, &daddr); + /* Adding sleep before sending FIN so that it is not + * received prior to other packets. + */ + usleep(fin_delay_us); write_packet(txfd, fin_pkt, total_hdr_len, &daddr); send_changed_seq(txfd, &daddr); + usleep(fin_delay_us); write_packet(txfd, fin_pkt, total_hdr_len, &daddr); send_changed_ts(txfd, &daddr); + usleep(fin_delay_us); write_packet(txfd, fin_pkt, total_hdr_len, &daddr); send_diff_opt(txfd, &daddr); + usleep(fin_delay_us); write_packet(txfd, fin_pkt, total_hdr_len, &daddr); } else if (strcmp(testname, "ip") == 0) { send_changed_ECN(txfd, &daddr); -- 2.51.0