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 3B8746FB4 for ; Fri, 13 Oct 2023 10:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gD00SOk8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45EACC433C8; Fri, 13 Oct 2023 10:46:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697193971; bh=UYyJCa2kgnkomPAqDm21fjQi8CwJkLy1dnHfgGoER8U=; h=Date:Subject:To:References:From:In-Reply-To:From; b=gD00SOk8hYXV+JZTTA0nfC0+o/pq573lukTh3Y2pfqknyug2btNtZJBBycWLi5fBj GZiFOmFZ6D17dfhFvoA/ZhRgynlLi8073GZigdeDEUTf43tL0lmvQoIJ7SDwq15UJT OL6iLU4iqWrgvvLt7hosoPaL5JuuvkvHDzP1X0bzuQldcJ2gklP8fpZJBa+cQnZzKW zRe150XjkeF4NQB0iUaK8hJ5kCvi987BOStmPTpwvpctcUVm8lUl8j7zo4R3khisE0 9Rb0D2+Odhn12wGPP1As0GBLIYyjr/1i7ilG98lj8Bt06Q+f2l4MLAcFdSUlxt3I0d pndFgGxvH6UZw== Message-ID: Date: Fri, 13 Oct 2023 12:46:07 +0200 Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH mptcp-next v16 3/8] Squash to "mptcp: add mptcpi_subflows_total counter" Content-Language: en-GB, fr-BE To: Paolo Abeni , Geliang Tang , mptcp@lists.linux.dev References: <4f136ef2b23fb55e2e42397f1e07e74b355d5f61.1697175899.git.geliang.tang@suse.com> From: Matthieu Baerts Autocrypt: addr=matttbe@kernel.org; keydata= xsFNBFXj+ekBEADxVr99p2guPcqHFeI/JcFxls6KibzyZD5TQTyfuYlzEp7C7A9swoK5iCvf YBNdx5Xl74NLSgx6y/1NiMQGuKeu+2BmtnkiGxBNanfXcnl4L4Lzz+iXBvvbtCbynnnqDDqU c7SPFMpMesgpcu1xFt0F6bcxE+0ojRtSCZ5HDElKlHJNYtD1uwY4UYVGWUGCF/+cY1YLmtfb WdNb/SFo+Mp0HItfBC12qtDIXYvbfNUGVnA5jXeWMEyYhSNktLnpDL2gBUCsdbkov5VjiOX7 CRTkX0UgNWRjyFZwThaZADEvAOo12M5uSBk7h07yJ97gqvBtcx45IsJwfUJE4hy8qZqsA62A nTRflBvp647IXAiCcwWsEgE5AXKwA3aL6dcpVR17JXJ6nwHHnslVi8WesiqzUI9sbO/hXeXw TDSB+YhErbNOxvHqCzZEnGAAFf6ges26fRVyuU119AzO40sjdLV0l6LE7GshddyazWZf0iac nEhX9NKxGnuhMu5SXmo2poIQttJuYAvTVUNwQVEx/0yY5xmiuyqvXa+XT7NKJkOZSiAPlNt6 VffjgOP62S7M9wDShUghN3F7CPOrrRsOHWO/l6I/qJdUMW+MHSFYPfYiFXoLUZyPvNVCYSgs 3oQaFhHapq1f345XBtfG3fOYp1K2wTXd4ThFraTLl8PHxCn4ywARAQABzSRNYXR0aGlldSBC YWVydHMgPG1hdHR0YmVAa2VybmVsLm9yZz7CwY4EEwEIADgWIQToy4X3aHcFem4n93r2t4JP QmmgcwUCZR5+DwIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRD2t4JPQmmgc+ixEACj 5QmhXP+mWcO9HZjmHonVDjcn0nfdqPSVNFDrSycFg12WfrshKy79emnCcJC9I1R/DOR1rjx2 vFPmObgGE+mmUzmF3H/FykitLLzVX7FAAbPyBRFuVYR54RJKIpV9R+u+mGYVTvNXrP0bSZkD 6yCP2IOhXC+nm5j+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PwyV8133+fIR2L81R1L1q3swaEuh95vWj6iskxeNWSTyFAVKYYVskGV+OT tB71P1XCnb6AJCW9cKpC25+zxQqD2Zy0dK3u2RuKErajKBa/YWzuSaKAOkneFxG3LJIvHl7i qPF+JDCjB5sAEQEAAcLBXwQYAQIACQUCVeP56QIbDAAKCRD2t4JPQmmgc5VnD/9YgbCrHR1F bMbm7td54UrYvZV/i7m3dIQNXK2e+Cbv5PXf19ce3XluaE+wA8D+vnIW5mbAAiojt3Mb6p0W JS3QzbObzHNgAp3zy/L4lXwc6WW5vnpWAzqXFHP8D9PTpqvBALbXqL06smP47JqbyQxjXf7D 2rrPeIqbYmVY9da1KzMOVf3gReazYa89zZSdVkMojfWsbq05zwYU+SCWS3NiyF6QghbWvoxb FwX1i/0xRwJiX9NNbRj1huVKQuS4W7rbWA87TrVQPXUAdkyd7FRYICNW+0gddysIwPoaKrLf x3Ba6Rpx0JznbrVOtXlihjl4KV8mtOPjYDY9u+8x412xXnlGl6AC4HLu2F3ECkamY4G6Uxej X+E6vW6Xe4n7H+rEX5UFgPRdYkS1TA/X3nMen9bouxNsvIJv7C6adZmMHqu/2azX7S7Ivrxx ySzOw9GxjoVTuzWMKWpDGP8n71IFeOot8JuPZtJ8omz+DZel+WCNZMVdVNLPOd5frqOvmpz0 VhFAlNTjU1Vy0CnuxX3AM51J8dpdNyG0S8rADh6C8AKCDOfUstpq28/6oTaQv7QZdge0JY6d glzGKnCi/zsmp2+1w559frz4+IC7j/igvJGX4KDDKUs0mlld8J2u2sBXv7CGxdzQoHazlzVb Fe7fduHbABmYz9cefQpO7wDE/Q== Organization: Tessares In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Paolo, On 13/10/2023 12:32, Paolo Abeni wrote: > Hi, > > On Fri, 2023-10-13 at 13:46 +0800, Geliang Tang wrote: >> Update __mptcp_has_initial_subflow(). >> >> Signed-off-by: Geliang Tang >> --- >> net/mptcp/protocol.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h >> index 6508179e94a6..1fb4ac3727c4 100644 >> --- a/net/mptcp/protocol.h >> +++ b/net/mptcp/protocol.h >> @@ -1081,7 +1081,7 @@ static inline bool __mptcp_has_initial_subflow(const struct mptcp_sock *msk) >> { >> struct sock *ssk = READ_ONCE(msk->first); >> >> - return ssk && inet_sk_state_load(ssk) != TCP_CLOSE; >> + return ssk && inet_sk_state_load(ssk) == TCP_ESTABLISHED; > > I think the above is not correct, __mptcp_has_initial_subflow() will > return false before connect completes and/or for listener sockets. Please note that __mptcp_has_initial_subflow() is there just to count the number of subflows. It is being used with 'msk->pm.subflows' and it is supposed to have the same "behaviour". Then I don't think we should increment the subflow counter for listener sockets, no? > You can list explicitly add the valid states with something alike: > > (1 << inet_sk_state_load(ssk)) & (TCPF_ESTABLISHED | > TCPF_SYN_SENT | TCPF_SYN_RECV | TCPF_LISTEN | TCPF_CLOSE_WAIT) > > I'm unsure if we should include CLOSE_WAIT here: the remote has shut > down, but this end can still send data... Maybe better, no? As long as the behaviour is similar to the one with 'msk->pm.subflows'. > Side important note: you are too fast :) There are a lot of in-flight > patches, and it's difficult to follow each series consistently. I > suggest to focus on a small subset - possibly on a single series at the > time. > > e.g. The first 2 patches in this series are IMHO ready to be merged > [*]. If Mat could apply them, you could follow-up with the remaining > bits of this series. Sure, I can do that. Regarding patch 1/8, do you think we should send that to "-net"? The patch looks OK to me but on the other hand, it is not a big issue to reset the initial subflow (but not ideal) if we fear regressions due to this patch. WDYT? > [*] modulo some expansion to the changelog of patch 1, but that could > happen even after merging IMHO. Indeed. But we might forget :) So if you have any suggestions, do not hesitate to share them :-) Cheers, Matt -- Tessares | Belgium | Hybrid Access Solutions www.tessares.net