All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-next v2 0/2] Squash to "implement mptcp read_sock" v9
@ 2025-08-29  9:10 Geliang Tang
  2025-08-29  9:10 ` [PATCH mptcp-next v2 1/2] Squash to "mptcp: implement .read_sock" Geliang Tang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Geliang Tang @ 2025-08-29  9:10 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

v2:
 - a new squash-to patch for "mptcp: implement .read_sock".

Based-on: <cover.1752399660.git.tanggeliang@kylinos.cn>

Geliang Tang (2):
  Squash to "mptcp: implement .read_sock"
  Squash to "selftests: mptcp: connect: cover splice mode"

 net/mptcp/protocol.c                          | 22 ++++++++++++++-----
 .../net/mptcp/mptcp_connect_splice.sh         |  3 ++-
 2 files changed, 19 insertions(+), 6 deletions(-)

-- 
2.48.1


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

* [PATCH mptcp-next v2 1/2] Squash to "mptcp: implement .read_sock"
  2025-08-29  9:10 [PATCH mptcp-next v2 0/2] Squash to "implement mptcp read_sock" v9 Geliang Tang
@ 2025-08-29  9:10 ` Geliang Tang
  2025-08-29  9:10 ` [PATCH mptcp-next v2 2/2] Squash to "selftests: mptcp: connect: cover splice mode" Geliang Tang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Geliang Tang @ 2025-08-29  9:10 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

Add an offset parameter for mptcp_recv_skb and make it more like
tcp_recv_skb.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 net/mptcp/protocol.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 33bf5bc26d36..701295f6ae1b 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -4019,11 +4019,23 @@ static __poll_t mptcp_poll(struct file *file, struct socket *sock,
 	return mask;
 }
 
-static struct sk_buff *mptcp_recv_skb(struct sock *sk)
+static struct sk_buff *mptcp_recv_skb(struct sock *sk, u32 *off)
 {
+	struct sk_buff *skb;
+	u32 offset;
+
 	if (skb_queue_empty(&sk->sk_receive_queue))
 		__mptcp_move_skbs(sk);
-	return skb_peek(&sk->sk_receive_queue);
+
+	while ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) {
+		offset = MPTCP_SKB_CB(skb)->offset;
+		if (offset < skb->len) {
+			*off = offset;
+			return skb;
+		}
+		mptcp_eat_recv_skb(sk, skb);
+	}
+	return NULL;
 }
 
 /*
@@ -4037,11 +4049,11 @@ static int mptcp_read_sock(struct sock *sk, read_descriptor_t *desc,
 	size_t len = sk->sk_rcvbuf;
 	struct sk_buff *skb;
 	int copied = 0;
+	u32 offset;
 
 	if (sk->sk_state == TCP_LISTEN)
 		return -ENOTCONN;
-	while ((skb = mptcp_recv_skb(sk)) != NULL) {
-		u32 offset = MPTCP_SKB_CB(skb)->offset;
+	while ((skb = mptcp_recv_skb(sk, &offset)) != NULL) {
 		u32 data_len = skb->len - offset;
 		u32 size = min_t(size_t, len - copied, data_len);
 		int count;
@@ -4072,7 +4084,7 @@ static int mptcp_read_sock(struct sock *sk, read_descriptor_t *desc,
 	mptcp_rcv_space_adjust(msk, copied);
 
 	if (copied > 0) {
-		mptcp_recv_skb(sk);
+		mptcp_recv_skb(sk, &offset);
 		mptcp_cleanup_rbuf(msk, copied);
 	}
 
-- 
2.48.1


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

* [PATCH mptcp-next v2 2/2] Squash to "selftests: mptcp: connect: cover splice mode"
  2025-08-29  9:10 [PATCH mptcp-next v2 0/2] Squash to "implement mptcp read_sock" v9 Geliang Tang
  2025-08-29  9:10 ` [PATCH mptcp-next v2 1/2] Squash to "mptcp: implement .read_sock" Geliang Tang
@ 2025-08-29  9:10 ` Geliang Tang
  2025-08-29 11:16 ` [PATCH mptcp-next v2 0/2] Squash to "implement mptcp read_sock" v9 MPTCP CI
  2025-09-01 10:22 ` Matthieu Baerts
  3 siblings, 0 replies; 5+ messages in thread
From: Geliang Tang @ 2025-08-29  9:10 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

Update subtest name.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 tools/testing/selftests/net/mptcp/mptcp_connect_splice.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect_splice.sh b/tools/testing/selftests/net/mptcp/mptcp_connect_splice.sh
index 77fe240ecf8c..241254a966c9 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_connect_splice.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_connect_splice.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
 
-"$(dirname "${0}")/mptcp_connect.sh" -m splice "${@}"
+MPTCP_LIB_KSFT_TEST="$(basename "${0}" .sh)" \
+	"$(dirname "${0}")/mptcp_connect.sh" -m splice "${@}"
-- 
2.48.1


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

* Re: [PATCH mptcp-next v2 0/2] Squash to "implement mptcp read_sock" v9
  2025-08-29  9:10 [PATCH mptcp-next v2 0/2] Squash to "implement mptcp read_sock" v9 Geliang Tang
  2025-08-29  9:10 ` [PATCH mptcp-next v2 1/2] Squash to "mptcp: implement .read_sock" Geliang Tang
  2025-08-29  9:10 ` [PATCH mptcp-next v2 2/2] Squash to "selftests: mptcp: connect: cover splice mode" Geliang Tang
@ 2025-08-29 11:16 ` MPTCP CI
  2025-09-01 10:22 ` Matthieu Baerts
  3 siblings, 0 replies; 5+ messages in thread
From: MPTCP CI @ 2025-08-29 11:16 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp

Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Unstable: 1 failed test(s): packetdrill_add_addr 🔴
- KVM Validation: debug: Unstable: 1 failed test(s): packetdrill_add_addr 🔴
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/17320054633

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/d89353d190d4
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=996822


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)

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

* Re: [PATCH mptcp-next v2 0/2] Squash to "implement mptcp read_sock" v9
  2025-08-29  9:10 [PATCH mptcp-next v2 0/2] Squash to "implement mptcp read_sock" v9 Geliang Tang
                   ` (2 preceding siblings ...)
  2025-08-29 11:16 ` [PATCH mptcp-next v2 0/2] Squash to "implement mptcp read_sock" v9 MPTCP CI
@ 2025-09-01 10:22 ` Matthieu Baerts
  3 siblings, 0 replies; 5+ messages in thread
From: Matthieu Baerts @ 2025-09-01 10:22 UTC (permalink / raw)
  To: Geliang Tang, mptcp; +Cc: Geliang Tang

Hi Geliang,

On 29/08/2025 11:10, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> v2:
>  - a new squash-to patch for "mptcp: implement .read_sock".

When the series is a few days old, and has not been reviewed yet, I
think it is easier if you send a new version instead of squash-to patches.

I think such squash-to patches are good when patches have already been
applied, or when you realised you forgot something minor just after
having send a series with a few patches. (For the latter, it might be
interesting to use '--in-reply-to $PREVIOUS_COVER_LETTER'.)

When the v10 will be posted, I can check with Paolo if he is planning to
continue the review of this series.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


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

end of thread, other threads:[~2025-09-01 10:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-29  9:10 [PATCH mptcp-next v2 0/2] Squash to "implement mptcp read_sock" v9 Geliang Tang
2025-08-29  9:10 ` [PATCH mptcp-next v2 1/2] Squash to "mptcp: implement .read_sock" Geliang Tang
2025-08-29  9:10 ` [PATCH mptcp-next v2 2/2] Squash to "selftests: mptcp: connect: cover splice mode" Geliang Tang
2025-08-29 11:16 ` [PATCH mptcp-next v2 0/2] Squash to "implement mptcp read_sock" v9 MPTCP CI
2025-09-01 10:22 ` Matthieu Baerts

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.