From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796508254; b=fomTWhAeA/5epKfrWEXm1u2rcO2iIkzt2zK+pzMYB5LiZYBkdNimG5NAMZVfmWeaugdz 6cMN91R0AjjcO6wLHixr9rWwKfQ9FZ/KkLKKPTNlSfipwTinIRmLnyz1uqu6gO1qS9dOn 6JqbmT7wUIF2jI1vteiSzg0d3pTovNR/pFfPZAP6JA/TMRYmZCXBjXx9R3qVaYYR0OXdZ hFMqu1NN/Z17yD7a3+/vR+/s7wC3RVZ4zTdblappANVL479N/ep2qbEdzPLd09lMDoLiP 8iIPMEibbMSCp8V8y64bCh/O8a82mrhXllRIj8gPF2QvGTVjnDnH5yAwQB4yn5QuReg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796508254; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=I/DFuWPHA8gUUObizJ61VOJKtKaWgf/Y1u0yIniB5Tg=; b=zHnGonxaxABu51xAUqnT3GyxtLjXG/HhX/bBMMWKneVzqEePWViI7/B7Tdzj4uUGDtVb LMuxj4DCFnX/Dd/HJ09CpjrA8x0+RpuUbOr94nLAXfOvyZhFIlLCQsqzsn03I16VrkMFg Jc9W6MyDDbOvcmQctlesBhTjFIih2UXLLnpa1rKFGnPOskeQ1WKrdFO2wYJesS+5/9WWe YrUsRWqlm/ARCh5vRpkz2927tjY0feo8milypeK7hvenh2Az0ncV7SNLXhA9If/yotNIs +zX9dtC13Mo50s/GdofBjL2GdAf67+x64wpdZ3otRotfv8VsTfJ1AmSHiCrLSemHJgw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="c3Hjkew/"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D679606A31F; Sat, 5 Dec 2026 22:04:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=c3Hjkew/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9A5B1F00A18; Sat, 5 Dec 2026 22:04:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796508253; bh=I/DFuWPHA8gUUObizJ61VOJKtKaWgf/Y1u0yIniB5Tg=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=c3Hjkew/BsUknaaHGbkrfA+cpJT9vZLJ7ZHqPPaJnmXf0z/7jBiZdFI7x/FdV/xit 85M8yDD51Ujy8XqmQjBCCmyAekuRxNJmRvratR17R0eJJ+4S4hxEHmu+nRTIQGgsBc ZNENotOgvdwRm7hfS0g0sR+HrYiVjNmAOl347KEcqrFDsiVXENCaBxFcNMvAtlg6DS vfKUsAfwAvsYONRQxOzrHDLJCf1muoajsMqCYsMWTOS2VX0EztKFHvH16Jn1BOilBD O+h8LwXLr5OSVwxo/vOQiFiflIc8wkFTaVyDdD2Xcpi82vmI6t2PzvzDbIuaQeCwN7 EHmEmQJVLpnMA== Subject: Re: [PATCH net-next 07/10] selftests: mptcp: sockopt: pass total bytes to do_getsockopts From: netdev-bot+sashiko@kernel.org To: matttbe@kernel.org Cc: martineau@kernel.org, geliang@kernel.org, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, liyonglong@chinatelecom.cn, shuah@kernel.org, fw@strlen.de, netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kselftest@vger.kernel.org Date: Sat, 05 Dec 2026 22:04:12 +0000 Message-ID: <179650825234.3148.5484969470030148952@kernel.org> In-Reply-To: <20261204-net-next-mptcp-misc-feat-7-5-v1-7-1449de51adae@kernel.org> References: <20261204-net-next-mptcp-misc-feat-7-5-v1-7-1449de51adae@kernel.org> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 0 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] The patch is only a partial fix. -- selftests: mptcp: sockopt: pass total bytes to do_getsockopts After its read loop, connect_one_server() passed the return value of the last read() to do_getsockopts() instead of the accumulated byte count. This patch passes the total, so a partial final read() no longer trips the write_seq assert in the MPTCP_INFO checks. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/638 > diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c > index b6e58d936ebe5..7b4ccbe10ae18 100644 > --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c > +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c > @@ -627,7 +627,7 @@ static void connect_one_server(int fd, int pipefd) > if (s.tcpi_rcv_delta) > assert(s.tcpi_rcv_delta <= total); > > - do_getsockopts(&s, fd, ret, ret); > + do_getsockopts(&s, fd, total, total); [Severity: Medium] The client side looks right now. Does the server side of the same echo test have the same partial read problem? The commit message says read() on a stream socket can return a partial chunk. The peer function, process_one_client(), still does one read and treats its result as the whole client payload, which is 128 to 4094 bytes sent with a single write(): tools/testing/selftests/net/mptcp/mptcp_sockopt.c:process_one_client() { ... ret = read(fd, buf, sizeof(buf)); if (ret < 0) die_perror("read"); assert(s.mptcpi_rcv_delta <= (uint64_t)ret); if (s.tcpi_rcv_delta) assert(s.tcpi_rcv_delta == (uint64_t)ret); ret2 = write(fd, buf, ret); ... /* wait for hangup */ ret3 = read(fd, buf, 1); if (ret3 != 0) xerror("expected EOF, got %lu", ret3); do_getsockopts(&s, fd, ret, ret2); ... } If this first read() comes back short, the server echoes only ret bytes. The client is still blocked in its loop waiting for len bytes, and the rest of its payload is still in the server's receive queue. Wouldn't the "wait for hangup" read() then return 1 rather than 0, so that the "expected EOF" xerror() fires? The partial ret is also used as the full received byte count in the tcpi_rcv_delta assert and in do_getsockopts(&s, fd, ret, ret2). It is used again in the mptcpi_rcv_delta != ret + 1 check and the mptcpi_bytes_received and mptcpi_bytes_acked checks. That is the same wrong byte count this patch fixes on the client. Once the server exits, the client loop in connect_one_server() would see EOF with total < len and fail too. Since the client fix only holds when the server's single read() got the whole payload, should process_one_client() also loop until it has read the full payload, as connect_one_server() does? None of the later patches in the series, including "selftests: mptcp: sockopt: drop unreachable FIN accounting", appear to touch process_one_client(). > > if (eof) > total += 1; /* sequence advances due to FIN */ -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204-net-next-mptcp-misc-feat-7-5-v1-0-1449de51adae%40kernel.org