summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-09-22 22:03:55 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-20 11:51:53 +0100
commit14a7e73b28eb6dc8c39b9fe7a971090d62cebb49 (patch)
tree520c64921ae53d2ae39ae586c90e068f39045836 /net
parent52ec0669f457fd4c4b597bb9b0e1a4c4f18a45ab (diff)
downloadlinux-stable-14a7e73b28eb6dc8c39b9fe7a971090d62cebb49.tar.gz
linux-stable-14a7e73b28eb6dc8c39b9fe7a971090d62cebb49.tar.bz2
linux-stable-14a7e73b28eb6dc8c39b9fe7a971090d62cebb49.zip
tcp_metrics: do not create an entry from tcp_init_metrics()
[ Upstream commit a135798e6e200ecb2f864cecca6d257ba278370c ] tcp_init_metrics() only wants to get metrics if they were previously stored in the cache. Creating an entry is adding useless costs, especially when tcp_no_metrics_save is set. Fixes: 51c5d0c4b169 ("tcp: Maintain dynamic metrics in local cache.") Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: David Ahern <dsahern@kernel.org> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp_metrics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index 5a08dc46a113..a7364ff8b558 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
@@ -478,7 +478,7 @@ void tcp_init_metrics(struct sock *sk)
goto reset;
rcu_read_lock();
- tm = tcp_get_metrics(sk, dst, true);
+ tm = tcp_get_metrics(sk, dst, false);
if (!tm) {
rcu_read_unlock();
goto reset;