MPTCP Linux Development
 help / color / mirror / Atom feed
* [PATCH mptcp-next 0/2] convert helpers for win and space
@ 2024-05-11  8:37 Geliang Tang
  2024-05-11  8:37 ` [PATCH mptcp-next 1/2] mptcp: use mptcp_win_from_space helper Geliang Tang
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Geliang Tang @ 2024-05-11  8:37 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

Paired with mptcp_win_from_space(), added an mptcp_space_from_win() helper,
use them in mptcp_rcv_space_adjust() and mptcp_set_rcvlowat().

Geliang Tang (2):
  mptcp: use mptcp_win_from_space helper
  mptcp: add mptcp_space_from_win helper

 net/mptcp/protocol.c | 4 ++--
 net/mptcp/protocol.h | 5 +++++
 net/mptcp/sockopt.c  | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

-- 
2.43.0


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

* [PATCH mptcp-next 1/2] mptcp: use mptcp_win_from_space helper
  2024-05-11  8:37 [PATCH mptcp-next 0/2] convert helpers for win and space Geliang Tang
@ 2024-05-11  8:37 ` Geliang Tang
  2024-05-11  8:37 ` [PATCH mptcp-next 2/2] mptcp: add mptcp_space_from_win helper Geliang Tang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Geliang Tang @ 2024-05-11  8:37 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

The MPTCP dedicated win_from_space helper mptcp_win_from_space() is defined
in protocol.h, use it in mptcp_rcv_space_adjust() instead of using the TCP
one. Here scaling_ratio is the same as msk->scaling_ratio.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 net/mptcp/protocol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 579031c60937..04dda32ccbef 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2046,7 +2046,7 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
 		if (rcvbuf > sk->sk_rcvbuf) {
 			u32 window_clamp;
 
-			window_clamp = __tcp_win_from_space(scaling_ratio, rcvbuf);
+			window_clamp = mptcp_win_from_space(sk, rcvbuf);
 			WRITE_ONCE(sk->sk_rcvbuf, rcvbuf);
 
 			/* Make subflows follow along.  If we do not do this, we
-- 
2.43.0


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

* [PATCH mptcp-next 2/2] mptcp: add mptcp_space_from_win helper
  2024-05-11  8:37 [PATCH mptcp-next 0/2] convert helpers for win and space Geliang Tang
  2024-05-11  8:37 ` [PATCH mptcp-next 1/2] mptcp: use mptcp_win_from_space helper Geliang Tang
@ 2024-05-11  8:37 ` Geliang Tang
  2024-05-11  9:27 ` [PATCH mptcp-next 0/2] convert helpers for win and space MPTCP CI
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Geliang Tang @ 2024-05-11  8:37 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

As a wrapper of __tcp_space_from_win(), this patch adds a MPTCP dedicated
space_from_win helper mptcp_space_from_win() in protocol.h to paired with
mptcp_win_from_space().

Use it instead of __tcp_space_from_win() in both mptcp_rcv_space_adjust()
and mptcp_set_rcvlowat().

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 net/mptcp/protocol.c | 2 +-
 net/mptcp/protocol.h | 5 +++++
 net/mptcp/sockopt.c  | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 04dda32ccbef..8b0a5b74a3b1 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2040,7 +2040,7 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
 		do_div(grow, msk->rcvq_space.space);
 		rcvwin += (grow << 1);
 
-		rcvbuf = min_t(u64, __tcp_space_from_win(scaling_ratio, rcvwin),
+		rcvbuf = min_t(u64, mptcp_space_from_win(sk, rcvwin),
 			       READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2]));
 
 		if (rcvbuf > sk->sk_rcvbuf) {
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index b5fb26ece2b8..19d60b6d5b45 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -386,6 +386,11 @@ static inline int mptcp_win_from_space(const struct sock *sk, int space)
 	return __tcp_win_from_space(mptcp_sk(sk)->scaling_ratio, space);
 }
 
+static inline int mptcp_space_from_win(const struct sock *sk, int win)
+{
+	return __tcp_space_from_win(mptcp_sk(sk)->scaling_ratio, win);
+}
+
 static inline int __mptcp_space(const struct sock *sk)
 {
 	return mptcp_win_from_space(sk, READ_ONCE(sk->sk_rcvbuf) - __mptcp_rmem(sk));
diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
index 7265b6733f5a..00e06c698415 100644
--- a/net/mptcp/sockopt.c
+++ b/net/mptcp/sockopt.c
@@ -1581,7 +1581,7 @@ int mptcp_set_rcvlowat(struct sock *sk, int val)
 	if (sk->sk_userlocks & SOCK_RCVBUF_LOCK)
 		return 0;
 
-	space = __tcp_space_from_win(mptcp_sk(sk)->scaling_ratio, val);
+	space = mptcp_space_from_win(sk, val);
 	if (space <= sk->sk_rcvbuf)
 		return 0;
 
-- 
2.43.0


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

* Re: [PATCH mptcp-next 0/2] convert helpers for win and space
  2024-05-11  8:37 [PATCH mptcp-next 0/2] convert helpers for win and space Geliang Tang
  2024-05-11  8:37 ` [PATCH mptcp-next 1/2] mptcp: use mptcp_win_from_space helper Geliang Tang
  2024-05-11  8:37 ` [PATCH mptcp-next 2/2] mptcp: add mptcp_space_from_win helper Geliang Tang
@ 2024-05-11  9:27 ` MPTCP CI
  2024-05-14 15:37 ` Mat Martineau
  2024-05-15 16:33 ` Matthieu Baerts
  4 siblings, 0 replies; 6+ messages in thread
From: MPTCP CI @ 2024-05-11  9:27 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: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/9042513520

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


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] 6+ messages in thread

* Re: [PATCH mptcp-next 0/2] convert helpers for win and space
  2024-05-11  8:37 [PATCH mptcp-next 0/2] convert helpers for win and space Geliang Tang
                   ` (2 preceding siblings ...)
  2024-05-11  9:27 ` [PATCH mptcp-next 0/2] convert helpers for win and space MPTCP CI
@ 2024-05-14 15:37 ` Mat Martineau
  2024-05-15 16:33 ` Matthieu Baerts
  4 siblings, 0 replies; 6+ messages in thread
From: Mat Martineau @ 2024-05-14 15:37 UTC (permalink / raw)
  To: Geliang Tang; +Cc: mptcp, Geliang Tang

On Sat, 11 May 2024, Geliang Tang wrote:

> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> Paired with mptcp_win_from_space(), added an mptcp_space_from_win() helper,
> use them in mptcp_rcv_space_adjust() and mptcp_set_rcvlowat().
>
> Geliang Tang (2):
>  mptcp: use mptcp_win_from_space helper
>  mptcp: add mptcp_space_from_win helper
>
> net/mptcp/protocol.c | 4 ++--
> net/mptcp/protocol.h | 5 +++++
> net/mptcp/sockopt.c  | 2 +-
> 3 files changed, 8 insertions(+), 3 deletions(-)
>

Series LGTM, thanks Geliang!


Reviewed-by: Mat Martineau <martineau@kernel.org>

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

* Re: [PATCH mptcp-next 0/2] convert helpers for win and space
  2024-05-11  8:37 [PATCH mptcp-next 0/2] convert helpers for win and space Geliang Tang
                   ` (3 preceding siblings ...)
  2024-05-14 15:37 ` Mat Martineau
@ 2024-05-15 16:33 ` Matthieu Baerts
  4 siblings, 0 replies; 6+ messages in thread
From: Matthieu Baerts @ 2024-05-15 16:33 UTC (permalink / raw)
  To: Geliang Tang, mptcp; +Cc: Geliang Tang

Hi Geliang, Mat,

On 11/05/2024 10:37, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> Paired with mptcp_win_from_space(), added an mptcp_space_from_win() helper,
> use them in mptcp_rcv_space_adjust() and mptcp_set_rcvlowat().
Thank you for the patches and the reviews!

Now in our tree (feat. for net-next):

New patches for t/upstream:
- 1b4da355e261: mptcp: use mptcp_win_from_space helper
- 9562c14a05f0: mptcp: add mptcp_space_from_win helper
- Results: c30047008247..767563eb7a1b (export)

Tests are now in progress:

- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/85fd224def76881f192ebfbd8c066f59984eb7d4/checks

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


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

end of thread, other threads:[~2024-05-15 16:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-11  8:37 [PATCH mptcp-next 0/2] convert helpers for win and space Geliang Tang
2024-05-11  8:37 ` [PATCH mptcp-next 1/2] mptcp: use mptcp_win_from_space helper Geliang Tang
2024-05-11  8:37 ` [PATCH mptcp-next 2/2] mptcp: add mptcp_space_from_win helper Geliang Tang
2024-05-11  9:27 ` [PATCH mptcp-next 0/2] convert helpers for win and space MPTCP CI
2024-05-14 15:37 ` Mat Martineau
2024-05-15 16:33 ` Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox