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=1796008974; b=xU1bhUNMSWJbwmPPO4AVww3yn2/rxVPBncbAa84JdkIgAGPOLygjsLowXbLbVfE7ovk6 /BQgk+ml/a2lqZkGSWeLeoopGRLFhzBvkwqYkBsGcXSxxVSPrhKFSPysDe8VDtuLIhR2w Zd1m9UFGrGQA+1cwMQqz9InXw17qsMEFrd3ECR20PnLHJSQirBrITRCLCTiuaQ/NelLgl R8vu3BFNEA6qwPnCiTqq1LXi3vSpeDOfb2HSifMZTWVxZEjunAk2JKLApKbTif39IB49T TWxPOzXlGItyRPwBjh+oTjLRSCzORVuTo7TufjjPABd51lbXPbcbYQgD8wW32rjO0Zg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796008974; h=Received:DKIM-Signature:From:To:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding; bh=7CD3plY/LtrlGc2O57gwSNoecm5XEEv3VE+osLijLqM=; b=Tk1PlcnxCwq/1FJaUdwofaLEGjusBuP9XCC4hTGdXIIXuOlmLJ/viOYef5tTnRXGzTBj URUQ63fuNlI3giy5oZEaDkgCVkh1k76Hpx9jJirYhos5CTBSgidl87Qmmar8Jn4oJFGYY Q367TQ0k2/giZPW6JNhhihf97lQEROp7Hc0MwBmzVPOXuWoUWCNCMHfO9Ym8CphUM99Wd kSjS0ALImQCPqC/L0PAr0mNNTkeaiemiyRB1k65A+CAl5YBcY21EN03TO/Fhm4CydoiX4 tDjfl9FrRRXbITYUjkYdc6tnSHmpljpOtmUkWpH1V4K8UhV4YUVqybPk1h1dgmU4M5Q== 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=AuBxyDTK; 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 197E8606A31C for ; Mon, 30 Nov 2026 03:22:54 +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=AuBxyDTK Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EFFF1F00897 for ; Mon, 30 Nov 2026 03:22:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796008973; bh=7CD3plY/LtrlGc2O57gwSNoecm5XEEv3VE+osLijLqM=; h=From:To:Subject:Date; b=AuBxyDTKOEd4AQle6F9AW4JQNBLKvUTbl3k1ajK5YbKUKpXZzIqVURUkAkBLglE4x uTwEfInd3ZWFegqViq0iiAQCSvftKD9jk7BWW6wmkjIN9QJXuf04Hbr4DmHj5yYYLi Tce1GU0lgEo+d5kAXaGgZQfsQxrMOqu/vTET31Zxq8kbcoGLwAY0Z9JBG8+C4c+cb4 ESF+QfWlvczABU2xSEAVEC3jFQIa0ZeYvS/YnKTF3WO/UsWrYJtWkqu0ipgVQKVTHg I/qoVo13R5cWbMxaPBMb2xHNQ2Q/LTkcrFOcscUQefsv1ojnB81iNVxC6HtGSvRKWi 9Ny2onkp1FbFg== From: Geliang Tang To: mptcp@lists.linux.dev Subject: [PATCH mptcp-net v5 0/4] mptcp: fixes for SIOCINQ Date: Mon, 30 Nov 2026 11:22:45 +0800 Message-ID: X-Mailer: git-send-email 2.55.0 X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Geliang Tang v5: - patch 3: check fallback in mptcp_inq_hint v4: - drop patch 1 "handle ack_seq advancing past rcv_data_fin_seq": revert '!before64()' back to '==' in mptcp_pending_data_fin(), the OFO queue edge case is not a real issue - add patch 2 "use SOCK_DONE in mptcp_inq_hint": replace the TCP_CLOSE/RCV_SHUTDOWN check with sock_flag(sk, SOCK_DONE), aligning with tcp_inq_hint() - patch 3: use sock_flag(sk, SOCK_DONE) to add FIN byte instead of checking TCP_CLOSE/RCV_SHUTDOWN and rcv_fastclose, simplifying the condition. - https://patchwork.kernel.org/project/mptcp/cover/cover.1795863454.git.tanggeliang@kylinos.cn/ v3: - patch 3: fix Sashiko AI review comment avoid comparing ack_seq with unset rcv_data_fin_seq (0) check TCP_CLOSE/RCV_SHUTDOWN directly, only call mptcp_data_fin() when rcv_data_fin is true, exclude MP_FASTCLOSE from +1 - https://patchwork.kernel.org/project/mptcp/cover/cover.1795396910.git.tanggeliang@kylinos.cn/ v2: - patch 3: drop mptcp_data_fin_seq(), reuse mptcp_data_fin() - u64 return couldn't distinguish "no DATA_FIN" from "DATA_FIN at seq 0" - mptcp_inq_hint() checks rcv_data_fin/TCP_CLOSE/RCV_SHUTDOWN first - https://patchwork.kernel.org/project/mptcp/cover/cover.1795348666.git.tanggeliang@kylinos.cn/ v1: - https://patchwork.kernel.org/project/mptcp/cover/cover.1795318567.git.tanggeliang@kylinos.cn/ The goal of this series is to make MPTCP's SIOCINQ fully consistent with TCP's: both report the number of readable data bytes, excluding the FIN byte. Patch 1 fixes mptcp_pending_data_fin() to use >= instead of == so that DATA_FIN is processed when ack_seq advances past rcv_data_fin_seq due to OFO queue processing. Patch 2 adds missing smp_wmb/smp_rmb barriers for rcv_data_fin_seq on weakly-ordered architectures. Patch 3 fixes mptcp_inq_hint() INT_MAX overflow on passive TFO by using mptcp_data_avail() instead of ack_seq minus map_seq, and reuses mptcp_data_fin() to guard the FIN byte (+1). Patch 4 adds mptcp_inq() that excludes the FIN byte, matching TCP's tcp_inq() behavior, and switches SIOCINQ to it. Geliang Tang (4): mptcp: add missing memory barriers for rcv_data_fin_seq mptcp: use SOCK_DONE in mptcp_inq_hint mptcp: fix TFO SIOCINQ overflow in mptcp_inq_hint mptcp: add mptcp_inq() for SIOCINQ net/mptcp/options.c | 1 + net/mptcp/protocol.c | 64 +++++++++++++++++++++++++++++--------------- 2 files changed, 43 insertions(+), 22 deletions(-) -- 2.55.0