tcp_metrics: do not create an entry from tcp_init_metrics()
authorEric Dumazet <edumazet@google.com>
Fri, 22 Sep 2023 22:03:55 +0000 (22:03 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 3 Oct 2023 08:05:22 +0000 (10:05 +0200)
commita135798e6e200ecb2f864cecca6d257ba278370c
tree0ca4e1e03b929fab5ad4b9f85642110e0c2ecd02
parent081480014a64a69d901f8ef1ffdd56d6085cf87e
tcp_metrics: do not create an entry from tcp_init_metrics()

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>
net/ipv4/tcp_metrics.c