From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <gbayer@linux.ibm.com>
Cc: <alibuda@linux.alibaba.com>, <davem@davemloft.net>,
<edumazet@google.com>, <guwen@linux.alibaba.com>,
<jaka@linux.ibm.com>, <kuba@kernel.org>, <kuni1840@gmail.com>,
<kuniyu@amazon.com>, <linux-s390@vger.kernel.org>,
<martineau@kernel.org>, <matttbe@kernel.org>,
<mptcp@lists.linux.dev>, <netdev@vger.kernel.org>,
<pabeni@redhat.com>, <tonylu@linux.alibaba.com>,
<wenjia@linux.ibm.com>
Subject: Re: [PATCH v1 net-next] net: Deprecate SO_DEBUG and reclaim SOCK_DBG bit.
Date: Wed, 14 Feb 2024 11:29:20 -0800 [thread overview]
Message-ID: <20240214192920.1333-1-kuniyu@amazon.com> (raw)
In-Reply-To: <7e387643370020483fb53f2c1e9dfd2b9ba28818.camel@linux.ibm.com>
From: Gerd Bayer <gbayer@linux.ibm.com>
Date: Wed, 14 Feb 2024 09:14:33 +0100
> On Tue, 2024-02-13 at 14:31 -0800, Kuniyuki Iwashima wrote:
>
> Hi Kuniyuki,
>
> I'm adding the newly appointed SMC maintainers to chime in.
>
> > Recently, commit 8e5443d2b866 ("net: remove SOCK_DEBUG leftovers")
> > removed the last users of SOCK_DEBUG(), and commit b1dffcf0da22
> > ("net:
> > remove SOCK_DEBUG macro") removed the macro.
> >
> > Now is the time to deprecate the oldest socket option.
> >
> > Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
> > ---
> > include/net/sock.h | 1 -
> > net/core/sock.c | 6 +++---
> > net/mptcp/sockopt.c | 4 +---
> > net/smc/af_smc.c | 5 ++---
> > 4 files changed, 6 insertions(+), 10 deletions(-)
> >
> > diff --git a/net/core/sock.c b/net/core/sock.c
> > index 88bf810394a5..0a58dc861908 100644
> > --- a/net/core/sock.c
> > +++ b/net/core/sock.c
> > @@ -1194,10 +1194,9 @@ int sk_setsockopt(struct sock *sk, int level,
> > int optname,
> >
> > switch (optname) {
> > case SO_DEBUG:
> > + /* deprecated, but kept for compatibility. */
> Not 100% sure about the language - but isn't the DEBUG feature
> *removed* rather than just *deprecated*?
SO_DEBUG is still here, and the user won't get -ENOPROTOOPT.
That's why I wrote deprecated, no strong preference though.
>
> > if (val && !sockopt_capable(CAP_NET_ADMIN))
> > ret = -EACCES;
> > - else
> > - sock_valbool_flag(sk, SOCK_DBG, valbool);
> > break;
> > case SO_REUSEADDR:
> > sk->sk_reuse = (valbool ? SK_CAN_REUSE :
> > SK_NO_REUSE);
> > @@ -1619,7 +1618,8 @@ int sk_getsockopt(struct sock *sk, int level,
> > int optname,
> >
> > switch (optname) {
> > case SO_DEBUG:
> > - v.val = sock_flag(sk, SOCK_DBG);
> > + /* deprecated. */
> Same here.
>
> > + v.val = 0;
> > break;
> >
> > case SO_DONTROUTE:
> > diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
> > index da37e4541a5d..f6d90eef3d7c 100644
> > --- a/net/mptcp/sockopt.c
> > +++ b/net/mptcp/sockopt.c
> > @@ -81,7 +81,7 @@ static void mptcp_sol_socket_sync_intval(struct
> > mptcp_sock *msk, int optname, in
> >
> > switch (optname) {
> > case SO_DEBUG:
> > - sock_valbool_flag(ssk, SOCK_DBG, !!val);
> > + /* deprecated. */
> and here.
>
> > break;
> > case SO_KEEPALIVE:
> > if (ssk->sk_prot->keepalive)
> > @@ -1458,8 +1458,6 @@ static void sync_socket_options(struct
> > mptcp_sock *msk, struct sock *ssk)
> > sk_dst_reset(ssk);
> > }
> >
> > - sock_valbool_flag(ssk, SOCK_DBG, sock_flag(sk, SOCK_DBG));
> > -
> > if (inet_csk(sk)->icsk_ca_ops != inet_csk(ssk)->icsk_ca_ops)
> > tcp_set_congestion_control(ssk, msk->ca_name, false,
> > true);
> > __tcp_sock_set_cork(ssk, !!msk->cork);
> > diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
> > index 66763c74ab76..062e16a2766a 100644
> > --- a/net/smc/af_smc.c
> > +++ b/net/smc/af_smc.c
> > @@ -445,7 +445,6 @@ static int smc_bind(struct socket *sock, struct
> > sockaddr *uaddr,
> > (1UL << SOCK_LINGER) | \
> > (1UL << SOCK_BROADCAST) | \
> > (1UL << SOCK_TIMESTAMP) | \
> > - (1UL << SOCK_DBG) | \
> > (1UL << SOCK_RCVTSTAMP) | \
> > (1UL << SOCK_RCVTSTAMPNS) | \
> > (1UL << SOCK_LOCALROUTE) | \
> > @@ -511,8 +510,8 @@ static void smc_copy_sock_settings_to_clc(struct
> > smc_sock *smc)
> >
> > #define SK_FLAGS_CLC_TO_SMC ((1UL << SOCK_URGINLINE) | \
> > (1UL << SOCK_KEEPOPEN) | \
> > - (1UL << SOCK_LINGER) | \
> > - (1UL << SOCK_DBG))
> > + (1UL << SOCK_LINGER))
> > +
> > /* copy only settings and flags relevant for smc from clc to smc
> > socket */
> > static void smc_copy_sock_settings_to_smc(struct smc_sock *smc)
> > {
> The SMC changes look good to me, so feel free to add my
> Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com>
Thanks!
next prev parent reply other threads:[~2024-02-14 19:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 22:31 [PATCH v1 net-next] net: Deprecate SO_DEBUG and reclaim SOCK_DBG bit Kuniyuki Iwashima
2024-02-14 8:14 ` Gerd Bayer
2024-02-14 19:29 ` Kuniyuki Iwashima [this message]
2024-02-14 9:32 ` Matthieu Baerts
2024-02-14 19:35 ` Kuniyuki Iwashima
2024-02-15 19:57 ` Neal Cardwell
2024-02-15 20:16 ` Kuniyuki Iwashima
2024-02-16 0:04 ` Neal Cardwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240214192920.1333-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=alibuda@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gbayer@linux.ibm.com \
--cc=guwen@linux.alibaba.com \
--cc=jaka@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=linux-s390@vger.kernel.org \
--cc=martineau@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tonylu@linux.alibaba.com \
--cc=wenjia@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).