Skip to contentSkip to conversation

net: Deprecate SO_DEBUG and reclaim SOCK_DBG bit.

PATCH Superseded Kuniyuki Iwashima 5 participants 12 messages Feb 13, 2024 – Feb 16, 2024

Subsystems (6)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: Deprecate SO_DEBUG and reclaim SOCK_DBG bit.

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.

---
 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(-)
include/net/sock.h +0 -1
index a9d99a9c583f..e20d55a36f9c 100644
@@ -909,7 +909,6 @@ enum sock_flags {
 	SOCK_TIMESTAMP,
 	SOCK_ZAPPED,
 	SOCK_USE_WRITE_QUEUE, /* whether to call sk->sk_write_space in sock_wfree */
-	SOCK_DBG, /* %SO_DEBUG setting */
 	SOCK_RCVTSTAMP, /* %SO_TIMESTAMP setting */
 	SOCK_RCVTSTAMPNS, /* %SO_TIMESTAMPNS setting */
 	SOCK_LOCALROUTE, /* route locally only, %SO_DONTROUTE setting */
net/core/sock.c +3 -3
index 88bf810394a5..0a58dc861908 100644
@@ -1194,10 +1194,9 @@ int sk_setsockopt(struct sock *sk, int level, int optname,
 
 	switch (optname) {
 	case SO_DEBUG:
+		/* deprecated, but kept for compatibility. */
 		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. */
+		v.val = 0;
 		break;
 
 	case SO_DONTROUTE:
net/mptcp/sockopt.c +1 -3
index da37e4541a5d..f6d90eef3d7c 100644
@@ -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. */
 			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);
net/smc/af_smc.c +2 -3
index 66763c74ab76..062e16a2766a 100644
@@ -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)
 {
Signature · 1 line
2.30.2
#1 lore raw

Re: net: Deprecate SO_DEBUG and reclaim SOCK_DBG bit.: Tests Results

Hi Kuniyuki,

Thank you for your modifications, that's great!

Our CI (GitHub Action) did some validations and here is its report:

- KVM Validation: normal:
- Success! ✅:
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/7893771323

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/b82e0568acae

If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker

Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

#2 lore raw

Re: net: Deprecate SO_DEBUG and reclaim SOCK_DBG bit.: Tests Results

In reply to Kuniyuki Iwashima

Hi Kuniyuki,

Thank you for your modifications, that's great!

Our CI (Cirrus) did some validations with a debug kernel and here is its report:

- KVM Validation: debug (except selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/5969355108777984
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5969355108777984/summary/summary.txt

- KVM Validation: debug (only selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/5471411028885504
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5471411028885504/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/b82e0568acae

If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker

Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

Reviewed-by on v1 1/1
#3 lore raw
In reply to Kuniyuki Iwashima

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.

Quoted 21 lines

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.

---
 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(-)
net/core/sock.c +0 -0
index 88bf810394a5..0a58dc861908 100644
@@ -1194,10 +1194,9 @@ int sk_setsockopt(struct sock *sk, int level,
 int optname,
Quoted 4 lines


        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*?

Quoted 10 lines

                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);

net/core/sock.c +0 -0
@@ -1619,7 +1618,8 @@ int sk_getsockopt(struct sock *sk, int level,
 int optname,
Quoted 5 lines


        switch (optname) {
        case SO_DEBUG:
-               v.val = sock_flag(sk, SOCK_DBG);
+               /* deprecated. */

Same here.

Quoted 9 lines

+               v.val = 0;
                break;

        case SO_DONTROUTE:

net/mptcp/sockopt.c +0 -0
index da37e4541a5d..f6d90eef3d7c 100644
@@ -81,7 +81,7 @@ static void mptcp_sol_socket_sync_intval(struct
Quoted 6 lines

mptcp_sock *msk, int optname, in

                switch (optname) {
                case SO_DEBUG:
-                       sock_valbool_flag(ssk, SOCK_DBG, !!val); +                       /* deprecated. */

and here.

Quoted 32 lines

                        break;
                case SO_KEEPALIVE:
                        if (ssk->sk_prot->keepalive)

net/mptcp/sockopt.c +0 -0
@@ -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);

net/smc/af_smc.c +0 -1
index 66763c74ab76..062e16a2766a 100644
@@ -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) | \

net/smc/af_smc.c +0 -0
@@ -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) | \

Quoted 8 lines

-                            (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

#5 lore raw

Re: net: Deprecate SO_DEBUG and reclaim SOCK_DBG bit.: Tests Results

In reply to Kuniyuki Iwashima

Hi Kuniyuki,

Thank you for your modifications, that's great!

Our CI (GitHub Action) did some validations and here is its report:

- KVM Validation: normal:
- Success! ✅:
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/7898465398

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/fbdc306e8139

If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker

Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

#6 lore raw

Re: net: Deprecate SO_DEBUG and reclaim SOCK_DBG bit.: Tests Results

In reply to Kuniyuki Iwashima

Hi Kuniyuki,

Thank you for your modifications, that's great!

Our CI (Cirrus) did some validations with a debug kernel and here is its report:

- KVM Validation: debug (except selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/4629533685448704
- Summary: https://api.cirrus-ci.com/v1/artifact/task/4629533685448704/summary/summary.txt

- KVM Validation: debug (only selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/5755433592291328
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5755433592291328/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/fbdc306e8139

If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker

Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

maintainer
#7 lore raw
In reply to Kuniyuki Iwashima

Hi Kuniyuki,

Quoted 5 lines · Kuniyuki Iwashima

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.

Thank you for looking at this!

My review here below is only about the modifications related to MPTCP.

(...)

net/mptcp/sockopt.c static void mptcp_sol_socket_sync_intval(struct mptcp_sock *msk, int optname, in · line 84

Quoted 10 lines
net/mptcp/sockopt.c +1 -1
index da37e4541a5d..f6d90eef3d7c 100644
@@ -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. */

If it is now a NOOP, maybe better to:

- remove SO_DEBUG from mptcp_sol_socket_sync_intval() and mptcp_setsockopt_sol_socket_int()

- move it just above the "return 0" in mptcp_setsockopt_sol_socket()
with the "deprecated" (or "removed") comment

By doing that, we avoid a lock, plus going through the list of subflows for nothing.

WDYT?

net/mptcp/sockopt.c static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk) · line 1463

Quoted 12 lines
net/mptcp/sockopt.c +0 -2
 			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);

The rest looks good to me.

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.
#4 lore raw
In reply to Gerd Bayer

From: Gerd Bayer <[email protected]>
Date: Wed, 14 Feb 2024 09:14:33 +0100

Quoted 28 lines · Kuniyuki Iwashima

Hi Kuniyuki,

I'm adding the newly appointed SMC maintainers to chime in.

Quoted 22 lines

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.

---
 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(-)
net/core/sock.c +0 -0
index 88bf810394a5..0a58dc861908 100644
@@ -1194,10 +1194,9 @@ int sk_setsockopt(struct sock *sk, int level,
 int optname,
 
Quoted 5 lines

net/core/sock.c int sk_setsockopt(struct sock *sk, int level, int optname, · line 1197

Quoted 3 lines
net/core/sock.c +1 -0
        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.

Quoted 76 lines
Quoted 10 lines
net/core/sock.c +0 -2
                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);

net/core/sock.c int sk_getsockopt(struct sock *sk, int level, · line 1622

Quoted 6 lines
net/core/sock.c +1 -1
@@ -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.

Quoted 13 lines
net/core/sock.c +1 -0
+               v.val = 0;
                break;
 

case SO_DONTROUTE:

net/mptcp/sockopt.c +0 -0
index da37e4541a5d..f6d90eef3d7c 100644
@@ -81,7 +81,7 @@ static void mptcp_sol_socket_sync_intval(struct

mptcp_sock *msk, int optname, in

                switch (optname) {
                case SO_DEBUG:

net/mptcp/sockopt.c static void mptcp_sol_socket_sync_intval(struct mptcp_sock *msk, int optname, in · line 84

Quoted 2 lines
net/mptcp/sockopt.c +1 -1
-                       sock_valbool_flag(ssk, SOCK_DBG, !!val);
+                       /* deprecated. */

and here.

Quoted 37 lines
                        break;
                case SO_KEEPALIVE:
                        if (ssk->sk_prot->keepalive)
net/mptcp/sockopt.c +0 -2
@@ -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);
net/smc/af_smc.c +0 -1
index 66763c74ab76..062e16a2766a 100644
@@ -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) | \
net/smc/af_smc.c +2 -2
@@ -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
Quoted 3 lines

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

Quoted 1 line

Thanks!

#8 lore raw
In reply to Matthieu Baerts

From: Matthieu Baerts <[email protected]>
Date: Wed, 14 Feb 2024 10:32:58 +0100

Quoted 31 lines

Hi Kuniyuki,

Quoted 5 lines · Kuniyuki Iwashima

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.

Thank you for looking at this!

My review here below is only about the modifications related to MPTCP.

(...)

net/mptcp/sockopt.c static void mptcp_sol_socket_sync_intval(struct mptcp_sock *msk, int optname, in · line 84

Quoted 10 lines
net/mptcp/sockopt.c +1 -1
index da37e4541a5d..f6d90eef3d7c 100644
@@ -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. */

If it is now a NOOP, maybe better to:

- remove SO_DEBUG from mptcp_sol_socket_sync_intval() and mptcp_setsockopt_sol_socket_int()

Quoted 7 lines

- move it just above the "return 0" in mptcp_setsockopt_sol_socket()
with the "deprecated" (or "removed") comment

By doing that, we avoid a lock, plus going through the list of subflows for nothing.

WDYT?

Sounds good!

And I can apply the similar change to the general setsockopt() not to take lock_sock().

Quoted 8 lines
Quoted 8 lines
net/mptcp/sockopt.c +0 -0
 			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);
 	}
 
Quoted 7 lines

net/mptcp/sockopt.c static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk) · line 1463

Quoted 5 lines
net/mptcp/sockopt.c +0 -2
-	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);

The rest looks good to me.

Thanks!

#9 lore raw
In reply to Kuniyuki Iwashima
Quoted 9 lines · Kuniyuki Iwashima

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.

---

I would like to kindly implore you to please not remove the functionality of the SO_DEBUG socket option. This socket option is a key mechanism that the Google TCP team uses for automated testing of Linux TCP, including BBR congestion control.

Widely used tools like netperf allow users to enable the SO_DEBUG socket option via the command line (-g in netperf). Then debugging code in the kernel can use the SOCK_DBG bit to decide whether to take special actions, such as logging debug information, which can be used to generate graphs or assertions about correct internal behavior. For example, the transperf network testing tool that our team open-sourced
- https://github.com/google/transperf - uses the netperf -g/SO_DEBUG mechanism to trigger debug logging that we use for testing, troubleshooting, analysis, and development.

The SO_DEBUG mechanism is nice in that it works well no matter what policy an application or benchmarking tool uses for choosing other attributes (like port numbers) that could conceivably be used to point out connections that should receive debug treatment. For example, most benchmarking or production workloads will effectively end up with random port numbers, which makes port numbers hard to use for triggering debug treatment.

This mechanism is very simple and battle-tested, it works well, and IMHO it would be a tragedy to remove it. It would cause our team meaningful headaches to replace it. Please keep the SO_DEBUG socket option functionality as-is. :-)

Thanks for your consideration on this!

Best regards,
neal

#10 lore raw

From: Neal Cardwell <[email protected]>
Date: Thu, 15 Feb 2024 12:57:35 -0700

Quoted 34 lines · Kuniyuki Iwashima
Quoted 9 lines

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.

---

I would like to kindly implore you to please not remove the functionality of the SO_DEBUG socket option. This socket option is a key mechanism that the Google TCP team uses for automated testing of Linux TCP, including BBR congestion control.

Widely used tools like netperf allow users to enable the SO_DEBUG socket option via the command line (-g in netperf). Then debugging code in the kernel can use the SOCK_DBG bit to decide whether to take special actions, such as logging debug information, which can be used to generate graphs or assertions about correct internal behavior. For example, the transperf network testing tool that our team open-sourced
- https://github.com/google/transperf - uses the netperf -g/SO_DEBUG mechanism to trigger debug logging that we use for testing, troubleshooting, analysis, and development.

The SO_DEBUG mechanism is nice in that it works well no matter what policy an application or benchmarking tool uses for choosing other attributes (like port numbers) that could conceivably be used to point out connections that should receive debug treatment. For example, most benchmarking or production workloads will effectively end up with random port numbers, which makes port numbers hard to use for triggering debug treatment.

Quoted 6 lines

This mechanism is very simple and battle-tested, it works well, and IMHO it would be a tragedy to remove it. It would cause our team meaningful headaches to replace it. Please keep the SO_DEBUG socket option functionality as-is. :-)

Thanks for your consideration on this!

Oh that's an interesting use case! I didn't think of out-of-tree uses. Sure, I'll drop the patch.

Thanks!

#11 lore raw
Quoted 42 lines · Kuniyuki Iwashima

From: Neal Cardwell <[email protected]>
Date: Thu, 15 Feb 2024 12:57:35 -0700

Quoted 39 lines · Kuniyuki Iwashima
Quoted 9 lines

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.

---

I would like to kindly implore you to please not remove the functionality of the SO_DEBUG socket option. This socket option is a key mechanism that the Google TCP team uses for automated testing of Linux TCP, including BBR congestion control.

Widely used tools like netperf allow users to enable the SO_DEBUG socket option via the command line (-g in netperf). Then debugging code in the kernel can use the SOCK_DBG bit to decide whether to take special actions, such as logging debug information, which can be used to generate graphs or assertions about correct internal behavior. For example, the transperf network testing tool that our team open-sourced
- https://github.com/google/transperf - uses the netperf -g/SO_DEBUG mechanism to trigger debug logging that we use for testing, troubleshooting, analysis, and development.

The SO_DEBUG mechanism is nice in that it works well no matter what policy an application or benchmarking tool uses for choosing other attributes (like port numbers) that could conceivably be used to point out connections that should receive debug treatment. For example, most benchmarking or production workloads will effectively end up with random port numbers, which makes port numbers hard to use for triggering debug treatment.

This mechanism is very simple and battle-tested, it works well, and IMHO it would be a tragedy to remove it. It would cause our team meaningful headaches to replace it. Please keep the SO_DEBUG socket option functionality as-is. :-)

Quoted 7 lines
Quoted 1 line

Thanks for your consideration on this!

Oh that's an interesting use case! I didn't think of out-of-tree uses. Sure, I'll drop the patch.

Thanks!

Great! Thank you!

neal