Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'mptcp-misc-cleanups'

Matthieu Baerts says:

====================
mptcp: misc. cleanups

Here is a small collection of miscellaneous cleanups:

- Patch 1 uses an MPTCP helper, instead of a TCP one, to do the same
thing.

- Patch 2 adds a similar MPTCP helper, instead of using a TCP one
directly.

- Patch 3 uses more appropriated terms in comments.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
====================

Link: https://lore.kernel.org/r/20240605-upstream-net-next-20240604-misc-cleanup-v1-0-ae2e35c3ecc5@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+11 -6
+4 -4
net/mptcp/protocol.c
··· 2040 2040 do_div(grow, msk->rcvq_space.space); 2041 2041 rcvwin += (grow << 1); 2042 2042 2043 - rcvbuf = min_t(u64, __tcp_space_from_win(scaling_ratio, rcvwin), 2043 + rcvbuf = min_t(u64, mptcp_space_from_win(sk, rcvwin), 2044 2044 READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2])); 2045 2045 2046 2046 if (rcvbuf > sk->sk_rcvbuf) { 2047 2047 u32 window_clamp; 2048 2048 2049 - window_clamp = __tcp_win_from_space(scaling_ratio, rcvbuf); 2049 + window_clamp = mptcp_win_from_space(sk, rcvbuf); 2050 2050 WRITE_ONCE(sk->sk_rcvbuf, rcvbuf); 2051 2051 2052 2052 /* Make subflows follow along. If we do not do this, we ··· 2202 2202 if (skb_queue_empty(&msk->receive_queue) && __mptcp_move_skbs(msk)) 2203 2203 continue; 2204 2204 2205 - /* only the master socket status is relevant here. The exit 2205 + /* only the MPTCP socket status is relevant here. The exit 2206 2206 * conditions mirror closely tcp_recvmsg() 2207 2207 */ 2208 2208 if (copied >= target) ··· 3521 3521 static int mptcp_hash(struct sock *sk) 3522 3522 { 3523 3523 /* should never be called, 3524 - * we hash the TCP subflows not the master socket 3524 + * we hash the TCP subflows not the MPTCP socket 3525 3525 */ 3526 3526 WARN_ON_ONCE(1); 3527 3527 return 0;
+5
net/mptcp/protocol.h
··· 386 386 return __tcp_win_from_space(mptcp_sk(sk)->scaling_ratio, space); 387 387 } 388 388 389 + static inline int mptcp_space_from_win(const struct sock *sk, int win) 390 + { 391 + return __tcp_space_from_win(mptcp_sk(sk)->scaling_ratio, win); 392 + } 393 + 389 394 static inline int __mptcp_space(const struct sock *sk) 390 395 { 391 396 return mptcp_win_from_space(sk, READ_ONCE(sk->sk_rcvbuf) - __mptcp_rmem(sk));
+1 -1
net/mptcp/sockopt.c
··· 1579 1579 if (sk->sk_userlocks & SOCK_RCVBUF_LOCK) 1580 1580 return 0; 1581 1581 1582 - space = __tcp_space_from_win(mptcp_sk(sk)->scaling_ratio, val); 1582 + space = mptcp_space_from_win(sk, val); 1583 1583 if (space <= sk->sk_rcvbuf) 1584 1584 return 0; 1585 1585
+1 -1
net/mptcp/subflow.c
··· 1719 1719 mptcp_sockopt_sync_locked(mptcp_sk(sk), sf->sk); 1720 1720 release_sock(sf->sk); 1721 1721 1722 - /* the newly created socket really belongs to the owning MPTCP master 1722 + /* the newly created socket really belongs to the owning MPTCP 1723 1723 * socket, even if for additional subflows the allocation is performed 1724 1724 * by a kernel workqueue. Adjust inode references, so that the 1725 1725 * procfs/diag interfaces really show this one belonging to the correct