mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-12 20:35:23 +02:00
tcp: define initial scaling factor value as a macro
[ Upstream commit849ee75a38
] So that other users could access it. Notably MPTCP will use it in the next patch. No functional change intended. Acked-by: Matthieu Baerts <matttbe@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Mat Martineau <martineau@kernel.org> Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-2-v1-4-9dc60939d371@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Stable-dep-of:697a6c8cec
("tcp: increase the default TCP scaling ratio") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a7fba17a05
commit
ca19418abc
|
@ -1460,13 +1460,15 @@ static inline int tcp_space_from_win(const struct sock *sk, int win)
|
||||||
return __tcp_space_from_win(tcp_sk(sk)->scaling_ratio, win);
|
return __tcp_space_from_win(tcp_sk(sk)->scaling_ratio, win);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void tcp_scaling_ratio_init(struct sock *sk)
|
/* Assume a conservative default of 1200 bytes of payload per 4K page.
|
||||||
{
|
|
||||||
/* Assume a conservative default of 1200 bytes of payload per 4K page.
|
|
||||||
* This may be adjusted later in tcp_measure_rcv_mss().
|
* This may be adjusted later in tcp_measure_rcv_mss().
|
||||||
*/
|
*/
|
||||||
tcp_sk(sk)->scaling_ratio = (1200 << TCP_RMEM_TO_WIN_SCALE) /
|
#define TCP_DEFAULT_SCALING_RATIO ((1200 << TCP_RMEM_TO_WIN_SCALE) / \
|
||||||
SKB_TRUESIZE(4096);
|
SKB_TRUESIZE(4096))
|
||||||
|
|
||||||
|
static inline void tcp_scaling_ratio_init(struct sock *sk)
|
||||||
|
{
|
||||||
|
tcp_sk(sk)->scaling_ratio = TCP_DEFAULT_SCALING_RATIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Note: caller must be prepared to deal with negative returns */
|
/* Note: caller must be prepared to deal with negative returns */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user