Commit a135798e authored by Eric Dumazet's avatar Eric Dumazet Committed by Paolo Abeni
Browse files

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: 51c5d0c4 ("tcp: Maintain dynamic metrics in local cache.")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 08148001
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;