[PATCH mptcp-next] mptcp: use msk_owned_by_me helper

Geliang Tang posted 1 patch 1 year, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20221209045925.20408-1-geliang.tang@suse.com
Maintainers: Mat Martineau <mathew.j.martineau@linux.intel.com>, Matthieu Baerts <matthieu.baerts@tessares.net>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
net/mptcp/protocol.c | 9 ++++-----
net/mptcp/sockopt.c  | 2 +-
2 files changed, 5 insertions(+), 6 deletions(-)
[PATCH mptcp-next] mptcp: use msk_owned_by_me helper
Posted by Geliang Tang 1 year, 4 months ago
The helper msk_owned_by_me() is defined in protocol.h, so use it instead
of sock_owned_by_me().

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 net/mptcp/protocol.c | 9 ++++-----
 net/mptcp/sockopt.c  | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 6d03bdcda33e..c8d5fa039b71 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -923,9 +923,8 @@ static void mptcp_check_for_eof(struct mptcp_sock *msk)
 static struct sock *mptcp_subflow_recv_lookup(const struct mptcp_sock *msk)
 {
 	struct mptcp_subflow_context *subflow;
-	struct sock *sk = (struct sock *)msk;
 
-	sock_owned_by_me(sk);
+	msk_owned_by_me(msk);
 
 	mptcp_for_each_subflow(msk, subflow) {
 		if (READ_ONCE(subflow->data_avail))
@@ -1408,7 +1407,7 @@ static struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk)
 	u64 linger_time;
 	long tout = 0;
 
-	sock_owned_by_me(sk);
+	msk_owned_by_me(msk);
 
 	if (__mptcp_check_fallback(msk)) {
 		if (!msk->first)
@@ -1896,7 +1895,7 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
 	u32 time, advmss = 1;
 	u64 rtt_us, mstamp;
 
-	sock_owned_by_me(sk);
+	msk_owned_by_me(msk);
 
 	if (copied <= 0)
 		return;
@@ -2223,7 +2222,7 @@ static struct sock *mptcp_subflow_get_retrans(struct mptcp_sock *msk)
 	struct mptcp_subflow_context *subflow;
 	int min_stale_count = INT_MAX;
 
-	sock_owned_by_me((const struct sock *)msk);
+	msk_owned_by_me(msk);
 
 	if (__mptcp_check_fallback(msk))
 		return NULL;
diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
index d4b1e6ec1b36..582ed93bcc8a 100644
--- a/net/mptcp/sockopt.c
+++ b/net/mptcp/sockopt.c
@@ -18,7 +18,7 @@
 
 static struct sock *__mptcp_tcp_fallback(struct mptcp_sock *msk)
 {
-	sock_owned_by_me((const struct sock *)msk);
+	msk_owned_by_me(msk);
 
 	if (likely(!__mptcp_check_fallback(msk)))
 		return NULL;
-- 
2.35.3
Re: [PATCH mptcp-next] mptcp: use msk_owned_by_me helper
Posted by Matthieu Baerts 1 year, 4 months ago
Hi Geliang, Mat,

On 09/12/2022 05:59, Geliang Tang wrote:
> The helper msk_owned_by_me() is defined in protocol.h, so use it instead
> of sock_owned_by_me().

Thank you for the patch and the review!

Now in our tree (feat. for net-next) with Mat's RvB tag:

New patches for t/upstream:
- 27e993d2b4f0: mptcp: use msk_owned_by_me helper
- Results: 8ef79d8e4dfb..3f302724c1a3 (export)

Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20221214T173523

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
Re: mptcp: use msk_owned_by_me helper: Tests Results
Posted by MPTCP CI 1 year, 4 months ago
Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: Script error! ❓:
  - :
  - Task: https://cirrus-ci.com/task/5326783529091072
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5326783529091072/summary/summary.txt

- KVM Validation: Script error! ❓:
  - :
  - Task: https://cirrus-ci.com/task/6452683435933696
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6452683435933696/summary/summary.txt

- KVM Validation: Script error! ❓:
  - :
  - Task: https://cirrus-ci.com/task/5045308552380416
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5045308552380416/summary/summary.txt

- KVM Validation: Script error! ❓:
  - :
  - Task: https://cirrus-ci.com/task/6171208459223040
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6171208459223040/summary/summary.txt

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


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 (Tessares)
Re: [PATCH mptcp-next] mptcp: use msk_owned_by_me helper
Posted by Mat Martineau 1 year, 4 months ago
On Fri, 9 Dec 2022, Geliang Tang wrote:

> The helper msk_owned_by_me() is defined in protocol.h, so use it instead
> of sock_owned_by_me().
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>

Thanks Geliang, looks good:

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>

> ---
> net/mptcp/protocol.c | 9 ++++-----
> net/mptcp/sockopt.c  | 2 +-
> 2 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 6d03bdcda33e..c8d5fa039b71 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -923,9 +923,8 @@ static void mptcp_check_for_eof(struct mptcp_sock *msk)
> static struct sock *mptcp_subflow_recv_lookup(const struct mptcp_sock *msk)
> {
> 	struct mptcp_subflow_context *subflow;
> -	struct sock *sk = (struct sock *)msk;
>
> -	sock_owned_by_me(sk);
> +	msk_owned_by_me(msk);
>
> 	mptcp_for_each_subflow(msk, subflow) {
> 		if (READ_ONCE(subflow->data_avail))
> @@ -1408,7 +1407,7 @@ static struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk)
> 	u64 linger_time;
> 	long tout = 0;
>
> -	sock_owned_by_me(sk);
> +	msk_owned_by_me(msk);
>
> 	if (__mptcp_check_fallback(msk)) {
> 		if (!msk->first)
> @@ -1896,7 +1895,7 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
> 	u32 time, advmss = 1;
> 	u64 rtt_us, mstamp;
>
> -	sock_owned_by_me(sk);
> +	msk_owned_by_me(msk);
>
> 	if (copied <= 0)
> 		return;
> @@ -2223,7 +2222,7 @@ static struct sock *mptcp_subflow_get_retrans(struct mptcp_sock *msk)
> 	struct mptcp_subflow_context *subflow;
> 	int min_stale_count = INT_MAX;
>
> -	sock_owned_by_me((const struct sock *)msk);
> +	msk_owned_by_me(msk);
>
> 	if (__mptcp_check_fallback(msk))
> 		return NULL;
> diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
> index d4b1e6ec1b36..582ed93bcc8a 100644
> --- a/net/mptcp/sockopt.c
> +++ b/net/mptcp/sockopt.c
> @@ -18,7 +18,7 @@
>
> static struct sock *__mptcp_tcp_fallback(struct mptcp_sock *msk)
> {
> -	sock_owned_by_me((const struct sock *)msk);
> +	msk_owned_by_me(msk);
>
> 	if (likely(!__mptcp_check_fallback(msk)))
> 		return NULL;
> -- 
> 2.35.3
>
>
>

--
Mat Martineau
Intel
Re: mptcp: use msk_owned_by_me helper: Tests Results
Posted by MPTCP CI 1 year, 4 months ago
Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

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

- KVM Validation: normal (only selftest_mptcp_join):
  - Unstable: 1 failed test(s): selftest_mptcp_join 🔴:
  - Task: https://cirrus-ci.com/task/6691844930142208
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6691844930142208/summary/summary.txt

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

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

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


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