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 6CAC926E706; Tue, 11 Nov 2025 01:44:05 +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=1762825445; cv=none; b=NnV9c3e3nyp3aUvv6GUXCrkdbeKH9QfNGxMok5DCdt0RJYPSGQVv9/Q9+BK1dsEjwouIdIxw1NrESD4WbTQHwtDw9XtlLzDZscjImcofBX59bWWs3rRyPnORDN2g1Lpj7oEXkvsi5X/6e8chVfsAzTrSJ4nkgYisHiTTBTVJ27o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762825445; c=relaxed/simple; bh=4qL9G59g2+wIipH3C1Asz6yEEBQBRENGqJO7GGdHvBo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DCV2PPZcgt97Sh6YN9dg3M82uMci+3R9GfdK8y9O5juqvpSQ4Iy1NtClIEtvCPKi/5BXa5wVryfSIRPk6LDCLL6zSkA7+gjjRUlxn+5F+WhKEGR4EGVu8m9YfyDvHx0gKXjXkXMILu/jGgcd+gY+IV7hqFBFGxMAJmvTwWFibEU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uP7uGGJO; 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="uP7uGGJO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 081D6C116B1; Tue, 11 Nov 2025 01:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1762825445; bh=4qL9G59g2+wIipH3C1Asz6yEEBQBRENGqJO7GGdHvBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uP7uGGJOpZG4TMbwHGmFPB+wz8ZSjFNulql7S4JHbfVDvawod1QP1Yjw7MqgkCBnJ YFD7YEYsW3MHljScvtvmiMieqYABjdVx/2vHFnBzaXzKKSvMnjxFLCv9/jjxTuiFf/ XyiaGXrIzjEJvCMu+RSoH2CEWm9izx+jabonRhF0= 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.17 761/849] selftests/net: fix out-of-order delivery of FIN in gro:tcp test Date: Tue, 11 Nov 2025 09:45:31 +0900 Message-ID: <20251111004554.832110740@linuxfoundation.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251111004536.460310036@linuxfoundation.org> References: <20251111004536.460310036@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.17-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 d5824eadea109..209ec60052f5b 100644 --- a/tools/testing/selftests/net/gro.c +++ b/tools/testing/selftests/net/gro.c @@ -969,6 +969,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; @@ -1012,15 +1013,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