Skip to contentSkip to conversation

Rename lookup_token() to __token_lookup

PATCH In review Peter Krystad 3 participants 9 messages Aug 7, 2019 – Aug 13, 2019

Subsystems (2)
lore
Share & tools
lore

Peter Krystad

author
#0 lore raw

cover Rename lookup_token() to __token_lookup

Already split for squashing

Peter Krystad (3):
Rename lookup_token() to __token_lookup
Rename lookup_token() to __token_lookup
Rename lookup_token() to __token_lookup

 net/mptcp/token.c | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)
Signature · 1 line
2.17.2
author
#1 lore raw

PATCH 1/3 Rename lookup_token() to __token_lookup

Naming better aligns with token_lookup_get().

squashto: Add handling of incoming MP_JOIN requests

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>
---
 net/mptcp/token.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)
net/mptcp/token.c +14 -12
index b54f617d4c26..df7a35aa580e 100644
@@ -54,7 +54,7 @@ static bool find_token(u32 token)
 	return used;
 }
 
-static struct sock *lookup_token(u32 token)
+static struct sock *__token_lookup(u32 token)
 {
 	void *conn;
 
@@ -221,7 +221,7 @@ int token_join_request(struct request_sock *req, const struct sk_buff *skb)
 
 	pr_debug("subflow_req=%p, token=%u", subflow_req, subflow_req->token);
 	spin_lock_bh(&token_tree_lock);
-	conn = lookup_token(subflow_req->token);
+	conn = __token_lookup(subflow_req->token);
 	if (conn)
 		sock_hold(conn);
 	spin_unlock_bh(&token_tree_lock);
@@ -259,7 +259,7 @@ int token_join_valid(struct request_sock *req,
 
 	pr_debug("subflow_req=%p, token=%u", subflow_req, subflow_req->token);
 	spin_lock_bh(&token_tree_lock);
-	conn = lookup_token(subflow_req->token);
+	conn = __token_lookup(subflow_req->token);
 	if (conn)
 		sock_hold(conn);
 	spin_unlock_bh(&token_tree_lock);
@@ -337,15 +337,17 @@ int token_new_join(struct sock *sk)
 	struct sock *conn;
 
 	spin_lock_bh(&token_tree_lock);
-	conn = lookup_token(subflow->token);
-	if (conn) {
+	conn = __token_lookup(subflow->token);
+	if (conn)
 		sock_hold(conn);
-		spin_unlock_bh(&token_tree_lock);
-		subflow->conn = conn;
-		return 0;
-	}
 	spin_unlock_bh(&token_tree_lock);
-	return -1;
+
+	if (!conn)
+		return -1;
+
+	subflow->conn = conn;
+
+	return 0;
 }
 
 struct sock *token_lookup_get(u32 token)
@@ -356,8 +358,8 @@ struct sock *token_lookup_get(u32 token)
 	conn = lookup_token(token);
 	if (conn)
 		sock_hold(conn);
-
 	spin_unlock_bh(&token_tree_lock);
+
 	return conn;
 }
 
@@ -376,7 +378,7 @@ void token_release(u32 token)
 
 	pr_debug("token=%u", token);
 	spin_lock_bh(&token_tree_lock);
-	conn = lookup_token(token);
+	conn = __token_lookup(token);
 	if (conn)
 		sock_put(conn);
 	spin_unlock_bh(&token_tree_lock);
Signature · 1 line
2.17.2
#2 lore raw

Hi Peter, Mat,

Quoted 3 lines · Peter Krystad

Naming better aligns with token_lookup_get().

squashto: Add handling of incoming MP_JOIN requests

Thank you for the patch and the review!

I had to split this in two parts:
- 65afe9b86a32: part 1: "squashed" in "mptcp: Add handling of incoming MP_JOIN requests"
- 049f8ef19750: part 2: "squashed" in "mptcp: Implement path manager interface commands"

Cheers,
Matt

Signature · 5 lines
Matthieu Baerts | R&D Engineer
matthieu.baerts(a)tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium
author
#3 lore raw

PATCH 2/3 Rename lookup_token() to __token_lookup

In reply to Peter Krystad

Naming better aligns with token_lookup_get().

squashto: Add handling of outgoing MP_JOIN requests

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>
---
 net/mptcp/token.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mptcp/token.c +1 -1
index df7a35aa580e..b5b233859c09 100644
@@ -300,7 +300,7 @@ void token_new_subflow(struct sock *sk)
 	pr_debug("subflow=%p", subflow);
 
 	spin_lock_bh(&token_tree_lock);
-	conn = lookup_token(subflow->token);
+	conn = __token_lookup(subflow->token);
 	if (conn)
 		sock_hold(conn);
 	spin_unlock_bh(&token_tree_lock);
Signature · 1 line
2.17.2
#4 lore raw

Hi Peter, Mat,

Quoted 3 lines · Peter Krystad

Naming better aligns with token_lookup_get().

squashto: Add handling of outgoing MP_JOIN requests

Thank you for the patch and the review:
- a5cadc03188d: "squashed" in "mptcp: Add handling of outgoing MP_JOIN requests"

Cheers,
Matt

Signature · 5 lines
Matthieu Baerts | R&D Engineer
matthieu.baerts(a)tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium
author
#5 lore raw

PATCH 3/3 Rename lookup_token() to __token_lookup

In reply to Peter Krystad

Naming better aligns with token_lookup_get().

squashto: Implement path manager interface commands

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>
---
 net/mptcp/token.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mptcp/token.c +1 -1
index b5b233859c09..9bdd9b97724c 100644
@@ -355,7 +355,7 @@ struct sock *token_lookup_get(u32 token)
 	struct sock *conn;
 
 	spin_lock_bh(&token_tree_lock);
-	conn = lookup_token(token);
+	conn = __token_lookup(token);
 	if (conn)
 		sock_hold(conn);
 	spin_unlock_bh(&token_tree_lock);
Signature · 1 line
2.17.2
#6 lore raw

Hi Peter, Mat,

Quoted 3 lines · Peter Krystad

Naming better aligns with token_lookup_get().

squashto: Implement path manager interface commands

Thank you for the patch and the review!

- 1bc9c00029e9: "squashed" in "mptcp: Implement path manager interface commands"

Cheers,
Matt

Signature · 5 lines
Matthieu Baerts | R&D Engineer
matthieu.baerts(a)tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium
#7 lore raw
In reply to Peter Krystad
Quoted 13 lines · Peter Krystad

Already split for squashing

Peter Krystad (3):
Rename lookup_token() to __token_lookup
Rename lookup_token() to __token_lookup
Rename lookup_token() to __token_lookup

net/mptcp/token.c | 30 ++++++++++++++++--------------

1 file changed, 16 insertions(+), 14 deletions(-)
Signature · 1 line
2.17.2

Patch set looks good to me.

--
Mat Martineau
Intel

#8 lore raw

Hi Peter, Mat,

Quoted 9 lines · Mat Martineau
Quoted 7 lines · Peter Krystad

Already split for squashing

Peter Krystad (3):
 Rename lookup_token() to __token_lookup
 Rename lookup_token() to __token_lookup
 Rename lookup_token() to __token_lookup

Quoted 8 lines
Quoted 6 lines

net/mptcp/token.c | 30 ++++++++++++++++--------------

1 file changed, 16 insertions(+), 14 deletions(-)

--
2.17.2

Patch set looks good to me.

Thank you for the patches and the review.

Everything is now in the repo:
- 2038a22e9690..6e195bff312b: result

Tests are still OK.

Cheers,
Matt

Signature · 5 lines
Matthieu Baerts | R&D Engineer
matthieu.baerts(a)tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium