All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mptcp: using TOKEN_MAX_RETRIES instead of magic number
@ 2021-04-21  9:03 Jianguo Wu
  2021-04-21 11:55 ` Matthieu Baerts
  0 siblings, 1 reply; 2+ messages in thread
From: Jianguo Wu @ 2021-04-21  9:03 UTC (permalink / raw)
  To: mptcp; +Cc: Matthieu Baerts

From: Jianguo Wu <wujianguo@chinatelecom.cn>

We have macro TOKEN_MAX_RETRIES for the number of token generate retries,
so using TOKEN_MAX_RETRIES in subflow_check_req(),
and rename TOKEN_MAX_RETRIES to MPTCP_TOKEN_MAX_RETRIES.

Fixes: 535fb8152f31 ("mptcp: token: move retry to caller")
Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn>
---
 net/mptcp/protocol.h | 2 ++
 net/mptcp/subflow.c  | 2 +-
 net/mptcp/token.c    | 3 +--
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index abd8e31..d90f45d 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -627,6 +627,8 @@ static inline void mptcp_write_space(struct sock *sk)

 void mptcp_destroy_common(struct mptcp_sock *msk);

+#define MPTCP_TOKEN_MAX_RETRIES	4
+
 void __init mptcp_token_init(void);
 static inline void mptcp_token_init_request(struct request_sock *req)
 {
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 325ea7e..43aee6b 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -162,7 +162,7 @@ static int subflow_check_req(struct request_sock *req,
 	}

 	if (mp_opt.mp_capable && listener->request_mptcp) {
-		int err, retries = 4;
+		int err, retries = MPTCP_TOKEN_MAX_RETRIES;

 		subflow_req->ssn_offset = TCP_SKB_CB(skb)->seq;
 again:
diff --git a/net/mptcp/token.c b/net/mptcp/token.c
index 72a24e6..a98e554 100644
--- a/net/mptcp/token.c
+++ b/net/mptcp/token.c
@@ -33,7 +33,6 @@
 #include <net/mptcp.h>
 #include "protocol.h"

-#define TOKEN_MAX_RETRIES	4
 #define TOKEN_MAX_CHAIN_LEN	4

 struct token_bucket {
@@ -153,7 +152,7 @@ int mptcp_token_new_connect(struct sock *sk)
 {
 	struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
 	struct mptcp_sock *msk = mptcp_sk(subflow->conn);
-	int retries = TOKEN_MAX_RETRIES;
+	int retries = MPTCP_TOKEN_MAX_RETRIES;
 	struct token_bucket *bucket;

 again:
-- 
1.8.3.1


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

* Re: [PATCH v2] mptcp: using TOKEN_MAX_RETRIES instead of magic number
  2021-04-21  9:03 [PATCH v2] mptcp: using TOKEN_MAX_RETRIES instead of magic number Jianguo Wu
@ 2021-04-21 11:55 ` Matthieu Baerts
  0 siblings, 0 replies; 2+ messages in thread
From: Matthieu Baerts @ 2021-04-21 11:55 UTC (permalink / raw)
  To: Jianguo Wu, mptcp

Hi Jianguo,

On 21/04/2021 11:03, Jianguo Wu wrote:
> From: Jianguo Wu <wujianguo@chinatelecom.cn>
> 
> We have macro TOKEN_MAX_RETRIES for the number of token generate retries,
> so using TOKEN_MAX_RETRIES in subflow_check_req(),
> and rename TOKEN_MAX_RETRIES to MPTCP_TOKEN_MAX_RETRIES.

Thank you for the new version!

It is now in our tree (fix for net) with my RvB tag:

- 72339413f908: mptcp: using TOKEN_MAX_RETRIES instead of magic number
- Results: 5938ef1e7b42..5eaa9f1d555d

Builds and tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20210421T115449
https://github.com/multipath-tcp/mptcp_net-next/actions/workflows/build-validation.yml?query=branch:export/20210421T115449

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

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

end of thread, other threads:[~2021-04-21 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21  9:03 [PATCH v2] mptcp: using TOKEN_MAX_RETRIES instead of magic number Jianguo Wu
2021-04-21 11:55 ` 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.