All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: Remove redundant calls of sk_tx_queue_clear().
@ 2021-01-27 12:50 Kuniyuki Iwashima
  2021-01-27 13:29 ` Kuniyuki Iwashima
  2021-01-27 14:54 ` Eric Dumazet
  0 siblings, 2 replies; 10+ messages in thread
From: Kuniyuki Iwashima @ 2021-01-27 12:50 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Eric Dumazet
  Cc: Amit Shah, Kuniyuki Iwashima, Kuniyuki Iwashima, netdev,
	linux-kernel, Tariq Toukan, Boris Pismenny

The commit 41b14fb8724d ("net: Do not clear the sock TX queue in
sk_set_socket()") removes sk_tx_queue_clear() from sk_set_socket() and adds
it instead in sk_alloc() and sk_clone_lock() to fix an issue introduced in
the commit e022f0b4a03f ("net: Introduce sk_tx_queue_mapping"). However,
the original commit had already put sk_tx_queue_clear() in sk_prot_alloc():
the callee of sk_alloc() and sk_clone_lock(). Thus sk_tx_queue_clear() is
called twice in each path currently.

This patch removes the redundant calls of sk_tx_queue_clear() in sk_alloc()
and sk_clone_lock().

Fixes: 41b14fb8724d ("net: Do not clear the sock TX queue in sk_set_socket()")
CC: Tariq Toukan <tariqt@mellanox.com>
CC: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Reviewed-by: Amit Shah <aams@amazon.de>
---
 net/core/sock.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index bbcd4b97eddd..5c665ee14159 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1759,7 +1759,6 @@ struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
 		cgroup_sk_alloc(&sk->sk_cgrp_data);
 		sock_update_classid(&sk->sk_cgrp_data);
 		sock_update_netprioidx(&sk->sk_cgrp_data);
-		sk_tx_queue_clear(sk);
 	}
 
 	return sk;
@@ -1983,7 +1982,6 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)
 		 */
 		sk_refcnt_debug_inc(newsk);
 		sk_set_socket(newsk, NULL);
-		sk_tx_queue_clear(newsk);
 		RCU_INIT_POINTER(newsk->sk_wq, NULL);
 
 		if (newsk->sk_prot->sockets_allocated)
-- 
2.17.2 (Apple Git-113)


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-01-27 18:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27 12:50 [PATCH net] net: Remove redundant calls of sk_tx_queue_clear() Kuniyuki Iwashima
2021-01-27 13:29 ` Kuniyuki Iwashima
2021-01-27 14:54 ` Eric Dumazet
2021-01-27 16:52   ` Kuniyuki Iwashima
2021-01-27 17:05     ` Eric Dumazet
2021-01-27 17:31       ` Kuniyuki Iwashima
2021-01-27 17:34         ` Eric Dumazet
2021-01-27 17:56           ` Kuniyuki Iwashima
2021-01-27 18:07             ` Eric Dumazet
2021-01-27 18:20               ` Kuniyuki Iwashima

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.