Skip to contentSkip to conversation

Adding SO_PEEK_OFF for TCPv6

PATCH Superseded [email protected] 3 participants 8 messages Aug 26, 2024 – Aug 28, 2024

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Adding SO_PEEK_OFF for TCPv6

From: Jon Maloy <[email protected]>

Adding SO_PEEK_OFF for TCPv6 and selftest for it.

Jon Maloy (2):
tcp: add SO_PEEK_OFF socket option tor TCPv6
selftests: add selftest for tcp SO_PEEK_OFF support

 net/ipv6/af_inet6.c                           |   1 +
 tools/testing/selftests/net/Makefile          |   1 +
 tools/testing/selftests/net/tcp_so_peek_off.c | 184 ++++++++++++++++++
 3 files changed, 186 insertions(+)
 create mode 100644 tools/testing/selftests/net/tcp_so_peek_off.c
Signature · 1 line
2.45.2
#1 lore raw

PATCH v2 1/2 tcp: add SO_PEEK_OFF socket option tor TCPv6

From: Jon Maloy <[email protected]>

When we added the SO_PEEK_OFF socket option to TCP we forgot to add it even for TCP on IPv6.

We do that here.

Fixes 05ea491641d3 ("tcp: add support for SO_PEEK_OFF socket option")
---
 net/ipv6/af_inet6.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv6/af_inet6.c +1 -0
index 90d2c7e3f5e9..ba69b86f1c7d 100644
@@ -708,6 +708,7 @@ const struct proto_ops inet6_stream_ops = {
 	.splice_eof	   = inet_splice_eof,
 	.sendmsg_locked    = tcp_sendmsg_locked,
 	.splice_read	   = tcp_splice_read,
+	.set_peek_off      = sk_set_peek_off,
 	.read_sock	   = tcp_read_sock,
 	.read_skb	   = tcp_read_skb,
 	.peek_len	   = tcp_peek_len,
Signature · 1 line
2.45.2
Reviewed-by on v2 1/2
#2 lore raw

Re: [net-next, v2 1/2] tcp: add SO_PEEK_OFF socket option tor TCPv6

Quoted 6 lines · On Tue, Aug 27, 2024 at 3:49 AM <[email protected]> wrote:

From: Jon Maloy <[email protected]>

When we added the SO_PEEK_OFF socket option to TCP we forgot to add it even for TCP on IPv6.

Quoted 8 lines

We do that here.

Fixes 05ea491641d3 ("tcp: add support for SO_PEEK_OFF socket option")
#3 lore raw

PATCH v2 2/2 selftests: add selftest for tcp SO_PEEK_OFF support

In reply to [email protected]

From: Jon Maloy <[email protected]>

We add a selftest to check that the new feature added in commit 05ea491641d3 ("tcp: add support for SO_PEEK_OFF socket option") works correctly.

---
v2: Made correction based ob Jason Xing's comment.

---
 tools/testing/selftests/net/Makefile          |   1 +
 tools/testing/selftests/net/tcp_so_peek_off.c | 184 ++++++++++++++++++
 2 files changed, 185 insertions(+)
 create mode 100644 tools/testing/selftests/net/tcp_so_peek_off.c
tools/testing/selftests/net/Makefile +1 -0
index 8eaffd7a641c..1179e3261bef 100644
@@ -80,6 +80,7 @@ TEST_PROGS += io_uring_zerocopy_tx.sh
 TEST_GEN_FILES += bind_bhash
 TEST_GEN_PROGS += sk_bind_sendto_listen
 TEST_GEN_PROGS += sk_connect_zero_addr
+TEST_GEN_PROGS += tcp_so_peek_off
 TEST_PROGS += test_ingress_egress_chaining.sh
 TEST_GEN_PROGS += so_incoming_cpu
 TEST_PROGS += sctp_vrf.sh
tools/testing/selftests/net/tcp_so_peek_off.c new file +184 -0

184 lines not on this page · raw message

Signature · 1 line
2.45.2
Reviewed-by on v2 2/2
#4 lore raw

Re: [net-next, v2 2/2] selftests: add selftest for tcp SO_PEEK_OFF support

Quoted 10 lines · On Tue, Aug 27, 2024 at 3:50 AM <[email protected]> wrote:

From: Jon Maloy <[email protected]>

We add a selftest to check that the new feature added in commit 05ea491641d3 ("tcp: add support for SO_PEEK_OFF socket option") works correctly.

Thanks!

maintainer
#5 lore raw

Re: [net-next, v2 2/2] selftests: add selftest for tcp SO_PEEK_OFF support

In reply to [email protected]

Review

Quoted 2 lines · On Mon, 26 Aug 2024 15:49:32 -0400 [email protected] wrote:
(quoted diff) +2 -0
+}
+

nit: extra new line at the end here, git warns when applying

BTW did someone point out v6 is missing on the list? If so could we add a Link: to that thread?

Signature · 1 line
pw-bot: cr
author
#6 lore raw

Re: [net-next, v2 2/2] selftests: add selftest for tcp SO_PEEK_OFF support

Quoted 3 lines · Jakub Kicinski

Review

Quoted 2 lines · On Mon, 26 Aug 2024 15:49:32 -0400 [email protected] wrote:
(quoted diff) +2 -0
+}
+

Does this require a re-posting?

Quoted 4 lines

nit: extra new line at the end here, git warns when applying

BTW did someone point out v6 is missing on the list? If so could we add a Link: to that thread?

I don't understand this question. v6 of what?

///jon

maintainer
#7 lore raw

Re: [net-next, v2 2/2] selftests: add selftest for tcp SO_PEEK_OFF support

Quoted 5 lines · On Wed, 28 Aug 2024 12:24:48 -0400 Jon Maloy wrote:
Quoted 3 lines · Jakub Kicinski

Review

Quoted 2 lines · On Mon, 26 Aug 2024 15:49:32 -0400 [email protected] wrote:
(quoted diff) +2 -0
+}
+  

Does this require a re-posting?

Yes, as indicated by patchwork status of the series.

Quoted 6 lines
Quoted 4 lines

nit: extra new line at the end here, git warns when applying

BTW did someone point out v6 is missing on the list? If so could we add a Link: to that thread?

I don't understand this question. v6 of what?

The Internet Protocol? :)

Rephrased:

Did someone point out on the mailing list that the support for .set_peek_off is missing for TCPv6? If so could you add a Link:
tag pointing to that thread?