* [PATCH net-next 0/2] dccp/tcp: Minor fixes for inet_csk_listen_start().
@ 2021-11-22 10:16 Kuniyuki Iwashima
2021-11-22 10:16 ` [PATCH net-next 1/2] dccp/tcp: Remove an unused argument in inet_csk_listen_start() Kuniyuki Iwashima
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Kuniyuki Iwashima @ 2021-11-22 10:16 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Eric Dumazet, Yafang Shao
Cc: Benjamin Herrenschmidt, Kuniyuki Iwashima, Kuniyuki Iwashima,
netdev, dccp
The first patch removes an unused argument, and the second removes a stale
comment.
Kuniyuki Iwashima (2):
dccp/tcp: Remove an unused argument in inet_csk_listen_start().
dccp: Inline dccp_listen_start().
include/net/inet_connection_sock.h | 2 +-
net/dccp/proto.c | 27 ++++++++-----------
net/ipv4/af_inet.c | 2 +-
net/ipv4/inet_connection_sock.c | 2 +-
.../bpf/progs/test_sk_storage_tracing.c | 2 +-
5 files changed, 15 insertions(+), 20 deletions(-)
--
2.30.2
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH net-next 1/2] dccp/tcp: Remove an unused argument in inet_csk_listen_start(). 2021-11-22 10:16 [PATCH net-next 0/2] dccp/tcp: Minor fixes for inet_csk_listen_start() Kuniyuki Iwashima @ 2021-11-22 10:16 ` Kuniyuki Iwashima 2021-11-23 11:11 ` Yafang Shao 2021-11-22 10:16 ` [PATCH net-next 2/2] dccp: Inline dccp_listen_start() Kuniyuki Iwashima ` (2 subsequent siblings) 3 siblings, 1 reply; 6+ messages in thread From: Kuniyuki Iwashima @ 2021-11-22 10:16 UTC (permalink / raw) To: David S. Miller, Jakub Kicinski, Eric Dumazet, Yafang Shao Cc: Benjamin Herrenschmidt, Kuniyuki Iwashima, Kuniyuki Iwashima, netdev, dccp The commit 1295e2cf3065 ("inet: minor optimization for backlog setting in listen(2)") added change so that sk_max_ack_backlog is initialised earlier in inet_dccp_listen() and inet_listen(). Since then, we no longer use backlog in inet_csk_listen_start(), so let's remove it. Fixes: 1295e2cf3065 ("inet: minor optimization for backlog setting in listen(2)") Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp> --- include/net/inet_connection_sock.h | 2 +- net/dccp/proto.c | 6 +++--- net/ipv4/af_inet.c | 2 +- net/ipv4/inet_connection_sock.c | 2 +- tools/testing/selftests/bpf/progs/test_sk_storage_tracing.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index fa6a87246a7b..4ad47d9f9d27 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h @@ -304,7 +304,7 @@ static inline __poll_t inet_csk_listen_poll(const struct sock *sk) (EPOLLIN | EPOLLRDNORM) : 0; } -int inet_csk_listen_start(struct sock *sk, int backlog); +int inet_csk_listen_start(struct sock *sk); void inet_csk_listen_stop(struct sock *sk); void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); diff --git a/net/dccp/proto.c b/net/dccp/proto.c index fc44dadc778b..55b8f958cdd2 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c @@ -238,7 +238,7 @@ void dccp_destroy_sock(struct sock *sk) EXPORT_SYMBOL_GPL(dccp_destroy_sock); -static inline int dccp_listen_start(struct sock *sk, int backlog) +static inline int dccp_listen_start(struct sock *sk) { struct dccp_sock *dp = dccp_sk(sk); @@ -246,7 +246,7 @@ static inline int dccp_listen_start(struct sock *sk, int backlog) /* do not start to listen if feature negotiation setup fails */ if (dccp_feat_finalise_settings(dp)) return -EPROTO; - return inet_csk_listen_start(sk, backlog); + return inet_csk_listen_start(sk); } static inline int dccp_need_reset(int state) @@ -935,7 +935,7 @@ int inet_dccp_listen(struct socket *sock, int backlog) * FIXME: here it probably should be sk->sk_prot->listen_start * see tcp_listen_start */ - err = dccp_listen_start(sk, backlog); + err = dccp_listen_start(sk); if (err) goto out; } diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index c66b0563a267..aa8d15b1e2a4 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -225,7 +225,7 @@ int inet_listen(struct socket *sock, int backlog) tcp_fastopen_init_key_once(sock_net(sk)); } - err = inet_csk_listen_start(sk, backlog); + err = inet_csk_listen_start(sk); if (err) goto out; tcp_call_bpf(sk, BPF_SOCK_OPS_TCP_LISTEN_CB, 0, NULL); diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index f7fea3a7c5e6..23da67a3fc06 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c @@ -1035,7 +1035,7 @@ void inet_csk_prepare_forced_close(struct sock *sk) } EXPORT_SYMBOL(inet_csk_prepare_forced_close); -int inet_csk_listen_start(struct sock *sk, int backlog) +int inet_csk_listen_start(struct sock *sk) { struct inet_connection_sock *icsk = inet_csk(sk); struct inet_sock *inet = inet_sk(sk); diff --git a/tools/testing/selftests/bpf/progs/test_sk_storage_tracing.c b/tools/testing/selftests/bpf/progs/test_sk_storage_tracing.c index 8e94e5c080aa..6dc1f28fc4b6 100644 --- a/tools/testing/selftests/bpf/progs/test_sk_storage_tracing.c +++ b/tools/testing/selftests/bpf/progs/test_sk_storage_tracing.c @@ -68,7 +68,7 @@ static void set_task_info(struct sock *sk) } SEC("fentry/inet_csk_listen_start") -int BPF_PROG(trace_inet_csk_listen_start, struct sock *sk, int backlog) +int BPF_PROG(trace_inet_csk_listen_start, struct sock *sk) { set_task_info(sk); -- 2.30.2 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 1/2] dccp/tcp: Remove an unused argument in inet_csk_listen_start(). 2021-11-22 10:16 ` [PATCH net-next 1/2] dccp/tcp: Remove an unused argument in inet_csk_listen_start() Kuniyuki Iwashima @ 2021-11-23 11:11 ` Yafang Shao 0 siblings, 0 replies; 6+ messages in thread From: Yafang Shao @ 2021-11-23 11:11 UTC (permalink / raw) To: Kuniyuki Iwashima Cc: David S. Miller, Jakub Kicinski, Eric Dumazet, Benjamin Herrenschmidt, Kuniyuki Iwashima, netdev, dccp On Mon, Nov 22, 2021 at 6:17 PM Kuniyuki Iwashima <kuniyu@amazon.co.jp> wrote: > > The commit 1295e2cf3065 ("inet: minor optimization for backlog setting in > listen(2)") added change so that sk_max_ack_backlog is initialised earlier > in inet_dccp_listen() and inet_listen(). Since then, we no longer use > backlog in inet_csk_listen_start(), so let's remove it. > > Fixes: 1295e2cf3065 ("inet: minor optimization for backlog setting in listen(2)") > Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp> Thanks for the fix. Acked-by: Yafang Shao <laoar.shao@gmail.com> > --- > include/net/inet_connection_sock.h | 2 +- > net/dccp/proto.c | 6 +++--- > net/ipv4/af_inet.c | 2 +- > net/ipv4/inet_connection_sock.c | 2 +- > tools/testing/selftests/bpf/progs/test_sk_storage_tracing.c | 2 +- > 5 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h > index fa6a87246a7b..4ad47d9f9d27 100644 > --- a/include/net/inet_connection_sock.h > +++ b/include/net/inet_connection_sock.h > @@ -304,7 +304,7 @@ static inline __poll_t inet_csk_listen_poll(const struct sock *sk) > (EPOLLIN | EPOLLRDNORM) : 0; > } > > -int inet_csk_listen_start(struct sock *sk, int backlog); > +int inet_csk_listen_start(struct sock *sk); > void inet_csk_listen_stop(struct sock *sk); > > void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); > diff --git a/net/dccp/proto.c b/net/dccp/proto.c > index fc44dadc778b..55b8f958cdd2 100644 > --- a/net/dccp/proto.c > +++ b/net/dccp/proto.c > @@ -238,7 +238,7 @@ void dccp_destroy_sock(struct sock *sk) > > EXPORT_SYMBOL_GPL(dccp_destroy_sock); > > -static inline int dccp_listen_start(struct sock *sk, int backlog) > +static inline int dccp_listen_start(struct sock *sk) > { > struct dccp_sock *dp = dccp_sk(sk); > > @@ -246,7 +246,7 @@ static inline int dccp_listen_start(struct sock *sk, int backlog) > /* do not start to listen if feature negotiation setup fails */ > if (dccp_feat_finalise_settings(dp)) > return -EPROTO; > - return inet_csk_listen_start(sk, backlog); > + return inet_csk_listen_start(sk); > } > > static inline int dccp_need_reset(int state) > @@ -935,7 +935,7 @@ int inet_dccp_listen(struct socket *sock, int backlog) > * FIXME: here it probably should be sk->sk_prot->listen_start > * see tcp_listen_start > */ > - err = dccp_listen_start(sk, backlog); > + err = dccp_listen_start(sk); > if (err) > goto out; > } > diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c > index c66b0563a267..aa8d15b1e2a4 100644 > --- a/net/ipv4/af_inet.c > +++ b/net/ipv4/af_inet.c > @@ -225,7 +225,7 @@ int inet_listen(struct socket *sock, int backlog) > tcp_fastopen_init_key_once(sock_net(sk)); > } > > - err = inet_csk_listen_start(sk, backlog); > + err = inet_csk_listen_start(sk); > if (err) > goto out; > tcp_call_bpf(sk, BPF_SOCK_OPS_TCP_LISTEN_CB, 0, NULL); > diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c > index f7fea3a7c5e6..23da67a3fc06 100644 > --- a/net/ipv4/inet_connection_sock.c > +++ b/net/ipv4/inet_connection_sock.c > @@ -1035,7 +1035,7 @@ void inet_csk_prepare_forced_close(struct sock *sk) > } > EXPORT_SYMBOL(inet_csk_prepare_forced_close); > > -int inet_csk_listen_start(struct sock *sk, int backlog) > +int inet_csk_listen_start(struct sock *sk) > { > struct inet_connection_sock *icsk = inet_csk(sk); > struct inet_sock *inet = inet_sk(sk); > diff --git a/tools/testing/selftests/bpf/progs/test_sk_storage_tracing.c b/tools/testing/selftests/bpf/progs/test_sk_storage_tracing.c > index 8e94e5c080aa..6dc1f28fc4b6 100644 > --- a/tools/testing/selftests/bpf/progs/test_sk_storage_tracing.c > +++ b/tools/testing/selftests/bpf/progs/test_sk_storage_tracing.c > @@ -68,7 +68,7 @@ static void set_task_info(struct sock *sk) > } > > SEC("fentry/inet_csk_listen_start") > -int BPF_PROG(trace_inet_csk_listen_start, struct sock *sk, int backlog) > +int BPF_PROG(trace_inet_csk_listen_start, struct sock *sk) > { > set_task_info(sk); > > -- > 2.30.2 > -- Thanks Yafang ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 2/2] dccp: Inline dccp_listen_start(). 2021-11-22 10:16 [PATCH net-next 0/2] dccp/tcp: Minor fixes for inet_csk_listen_start() Kuniyuki Iwashima 2021-11-22 10:16 ` [PATCH net-next 1/2] dccp/tcp: Remove an unused argument in inet_csk_listen_start() Kuniyuki Iwashima @ 2021-11-22 10:16 ` Kuniyuki Iwashima 2021-11-22 17:19 ` [PATCH net-next 0/2] dccp/tcp: Minor fixes for inet_csk_listen_start() Richard Sailer 2021-11-24 4:30 ` patchwork-bot+netdevbpf 3 siblings, 0 replies; 6+ messages in thread From: Kuniyuki Iwashima @ 2021-11-22 10:16 UTC (permalink / raw) To: David S. Miller, Jakub Kicinski, Eric Dumazet, Yafang Shao Cc: Benjamin Herrenschmidt, Kuniyuki Iwashima, Kuniyuki Iwashima, netdev, dccp This patch inlines dccp_listen_start() and removes a stale comment in inet_dccp_listen() so that it looks like inet_listen(). Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp> --- net/dccp/proto.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 55b8f958cdd2..a976b4d29892 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c @@ -238,17 +238,6 @@ void dccp_destroy_sock(struct sock *sk) EXPORT_SYMBOL_GPL(dccp_destroy_sock); -static inline int dccp_listen_start(struct sock *sk) -{ - struct dccp_sock *dp = dccp_sk(sk); - - dp->dccps_role = DCCP_ROLE_LISTEN; - /* do not start to listen if feature negotiation setup fails */ - if (dccp_feat_finalise_settings(dp)) - return -EPROTO; - return inet_csk_listen_start(sk); -} - static inline int dccp_need_reset(int state) { return state != DCCP_CLOSED && state != DCCP_LISTEN && @@ -931,11 +920,17 @@ int inet_dccp_listen(struct socket *sock, int backlog) * we can only allow the backlog to be adjusted. */ if (old_state != DCCP_LISTEN) { - /* - * FIXME: here it probably should be sk->sk_prot->listen_start - * see tcp_listen_start - */ - err = dccp_listen_start(sk); + struct dccp_sock *dp = dccp_sk(sk); + + dp->dccps_role = DCCP_ROLE_LISTEN; + + /* do not start to listen if feature negotiation setup fails */ + if (dccp_feat_finalise_settings(dp)) { + err = -EPROTO; + goto out; + } + + err = inet_csk_listen_start(sk); if (err) goto out; } -- 2.30.2 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 0/2] dccp/tcp: Minor fixes for inet_csk_listen_start(). 2021-11-22 10:16 [PATCH net-next 0/2] dccp/tcp: Minor fixes for inet_csk_listen_start() Kuniyuki Iwashima 2021-11-22 10:16 ` [PATCH net-next 1/2] dccp/tcp: Remove an unused argument in inet_csk_listen_start() Kuniyuki Iwashima 2021-11-22 10:16 ` [PATCH net-next 2/2] dccp: Inline dccp_listen_start() Kuniyuki Iwashima @ 2021-11-22 17:19 ` Richard Sailer 2021-11-24 4:30 ` patchwork-bot+netdevbpf 3 siblings, 0 replies; 6+ messages in thread From: Richard Sailer @ 2021-11-22 17:19 UTC (permalink / raw) To: Kuniyuki Iwashima, David S. Miller, Jakub Kicinski, Eric Dumazet, Yafang Shao Cc: Benjamin Herrenschmidt, Kuniyuki Iwashima, netdev, dccp On 22/11/2021 11:16, Kuniyuki Iwashima wrote: > The first patch removes an unused argument, and the second removes a stale > comment. > Looks fine to me. Reviewed-by: Richard Sailer <richard_siegfried@systemli.org> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 0/2] dccp/tcp: Minor fixes for inet_csk_listen_start(). 2021-11-22 10:16 [PATCH net-next 0/2] dccp/tcp: Minor fixes for inet_csk_listen_start() Kuniyuki Iwashima ` (2 preceding siblings ...) 2021-11-22 17:19 ` [PATCH net-next 0/2] dccp/tcp: Minor fixes for inet_csk_listen_start() Richard Sailer @ 2021-11-24 4:30 ` patchwork-bot+netdevbpf 3 siblings, 0 replies; 6+ messages in thread From: patchwork-bot+netdevbpf @ 2021-11-24 4:30 UTC (permalink / raw) To: Kuniyuki Iwashima Cc: davem, kuba, edumazet, laoar.shao, benh, kuni1840, netdev, dccp Hello: This series was applied to netdev/net-next.git (master) by Jakub Kicinski <kuba@kernel.org>: On Mon, 22 Nov 2021 19:16:20 +0900 you wrote: > The first patch removes an unused argument, and the second removes a stale > comment. > > > Kuniyuki Iwashima (2): > dccp/tcp: Remove an unused argument in inet_csk_listen_start(). > dccp: Inline dccp_listen_start(). > > [...] Here is the summary with links: - [net-next,1/2] dccp/tcp: Remove an unused argument in inet_csk_listen_start(). https://git.kernel.org/netdev/net-next/c/e7049395b1c3 - [net-next,2/2] dccp: Inline dccp_listen_start(). https://git.kernel.org/netdev/net-next/c/b4a8e7493d74 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-11-24 4:30 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2021-11-22 10:16 [PATCH net-next 0/2] dccp/tcp: Minor fixes for inet_csk_listen_start() Kuniyuki Iwashima 2021-11-22 10:16 ` [PATCH net-next 1/2] dccp/tcp: Remove an unused argument in inet_csk_listen_start() Kuniyuki Iwashima 2021-11-23 11:11 ` Yafang Shao 2021-11-22 10:16 ` [PATCH net-next 2/2] dccp: Inline dccp_listen_start() Kuniyuki Iwashima 2021-11-22 17:19 ` [PATCH net-next 0/2] dccp/tcp: Minor fixes for inet_csk_listen_start() Richard Sailer 2021-11-24 4:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).