Skip to contentSkip to conversation

Squash-to: "tcp, ulp: Add clone operation to tcp_ulp_ops"

PATCH In review Mat Martineau 3 participants 3 messages Jan 8, 2020 – Jan 9, 2020

Subsystems (3)
lore
Share & tools
lore

Mat Martineau

author
#0 lore raw

PATCH 1/1 Squash-to: "tcp, ulp: Add clone operation to tcp_ulp_ops"

Make change suggested in upstream review - move and rename ulp clone helper to make it inline-friendly.

Commit message addition:

"""
v6 -> v7:
- move and rename ulp clone helper to make it inline-friendly
"""

Signed-off-by Mat Martineau <mathew.j.martineau(a)linux.intel.com>
---
 include/net/tcp.h               |  2 --
 net/ipv4/inet_connection_sock.c | 14 +++++++++++++-
 net/ipv4/tcp_ulp.c              | 12 ------------
 3 files changed, 13 insertions(+), 15 deletions(-)
include/net/tcp.h +0 -2
index 853537e330f8..5e4133d09b9d 100644
@@ -2183,8 +2183,6 @@ int tcp_set_ulp(struct sock *sk, const char *name);
 void tcp_get_available_ulp(char *buf, size_t len);
 void tcp_cleanup_ulp(struct sock *sk);
 void tcp_update_ulp(struct sock *sk, struct proto *p);
-void tcp_clone_ulp(const struct request_sock *req,
-		   struct sock *newsk, const gfp_t priority);
 
 #define MODULE_ALIAS_TCP_ULP(name)				\
 	__MODULE_INFO(alias, alias_userspace, name);		\
net/ipv4/inet_connection_sock.c +13 -1
index bf53a722923a..6a691fd04398 100644
@@ -770,6 +770,18 @@ void inet_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req,
 }
 EXPORT_SYMBOL_GPL(inet_csk_reqsk_queue_hash_add);
 
+static void inet_clone_ulp(const struct request_sock *req, struct sock *newsk,
+			   const gfp_t priority)
+{
+	struct inet_connection_sock *icsk = inet_csk(newsk);
+
+	if (!icsk->icsk_ulp_ops)
+		return;
+
+	if (icsk->icsk_ulp_ops->clone)
+		icsk->icsk_ulp_ops->clone(req, newsk, priority);
+}
+
 /**
  *	inet_csk_clone_lock - clone an inet socket, and lock its clone
  *	@sk: the socket to clone
@@ -810,7 +822,7 @@ struct sock *inet_csk_clone_lock(const struct sock *sk,
 		/* Deinitialize accept_queue to trap illegal accesses. */
 		memset(&newicsk->icsk_accept_queue, 0, sizeof(newicsk->icsk_accept_queue));
 
-		tcp_clone_ulp(req, newsk, priority);
+		inet_clone_ulp(req, newsk, priority);
 
 		security_inet_csk_clone(newsk, req);
 	}
net/ipv4/tcp_ulp.c +0 -12
index e7a2589d69ee..12ab5db2b71c 100644
@@ -130,18 +130,6 @@ void tcp_cleanup_ulp(struct sock *sk)
 	icsk->icsk_ulp_ops = NULL;
 }
 
-void tcp_clone_ulp(const struct request_sock *req, struct sock *newsk,
-		   const gfp_t priority)
-{
-	struct inet_connection_sock *icsk = inet_csk(newsk);
-
-	if (!icsk->icsk_ulp_ops)
-		return;
-
-	if (icsk->icsk_ulp_ops->clone)
-		icsk->icsk_ulp_ops->clone(req, newsk, priority);
-}
-
 static int __tcp_set_ulp(struct sock *sk, const struct tcp_ulp_ops *ulp_ops)
 {
 	struct inet_connection_sock *icsk = inet_csk(sk);
Signature · 1 line
2.24.1
#1 lore raw
Quoted 75 lines · Mat Martineau

Make change suggested in upstream review - move and rename ulp clone helper to make it inline-friendly.

Commit message addition:

"""
v6 -> v7:
- move and rename ulp clone helper to make it inline-friendly
"""

Signed-off-by Mat Martineau <mathew.j.martineau(a)linux.intel.com>
---
 include/net/tcp.h               |  2 --
 net/ipv4/inet_connection_sock.c | 14 +++++++++++++-
 net/ipv4/tcp_ulp.c              | 12 ------------
 3 files changed, 13 insertions(+), 15 deletions(-)
include/net/tcp.h +0 -2
index 853537e330f8..5e4133d09b9d 100644
@@ -2183,8 +2183,6 @@ int tcp_set_ulp(struct sock *sk, const char *name);
 void tcp_get_available_ulp(char *buf, size_t len);
 void tcp_cleanup_ulp(struct sock *sk);
 void tcp_update_ulp(struct sock *sk, struct proto *p);
-void tcp_clone_ulp(const struct request_sock *req,
-		   struct sock *newsk, const gfp_t priority);
 
 #define MODULE_ALIAS_TCP_ULP(name)				\
 	__MODULE_INFO(alias, alias_userspace, name);		\
net/ipv4/inet_connection_sock.c +13 -1
index bf53a722923a..6a691fd04398 100644
@@ -770,6 +770,18 @@ void inet_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req,
 }
 EXPORT_SYMBOL_GPL(inet_csk_reqsk_queue_hash_add);
 
+static void inet_clone_ulp(const struct request_sock *req, struct sock *newsk,
+			   const gfp_t priority)
+{
+	struct inet_connection_sock *icsk = inet_csk(newsk);
+
+	if (!icsk->icsk_ulp_ops)
+		return;
+
+	if (icsk->icsk_ulp_ops->clone)
+		icsk->icsk_ulp_ops->clone(req, newsk, priority);
+}
+
 /**
  *	inet_csk_clone_lock - clone an inet socket, and lock its clone
  *	@sk: the socket to clone
@@ -810,7 +822,7 @@ struct sock *inet_csk_clone_lock(const struct sock *sk,
 		/* Deinitialize accept_queue to trap illegal accesses. */
 		memset(&newicsk->icsk_accept_queue, 0, sizeof(newicsk->icsk_accept_queue));
 
-		tcp_clone_ulp(req, newsk, priority);
+		inet_clone_ulp(req, newsk, priority);
 
 		security_inet_csk_clone(newsk, req);
 	}
net/ipv4/tcp_ulp.c +0 -5
index e7a2589d69ee..12ab5db2b71c 100644
@@ -130,18 +130,6 @@ void tcp_cleanup_ulp(struct sock *sk)
 	icsk->icsk_ulp_ops = NULL;
 }
 
-void tcp_clone_ulp(const struct request_sock *req, struct sock *newsk,
-		   const gfp_t priority)
-{
-	struct inet_connection_sock *icsk = inet_csk(newsk);
-

net/ipv4/tcp_ulp.c void tcp_cleanup_ulp(struct sock *sk) · line 135

Quoted 10 lines
net/ipv4/tcp_ulp.c +0 -7
-	if (!icsk->icsk_ulp_ops)
-		return;
-
-	if (icsk->icsk_ulp_ops->clone)
-		icsk->icsk_ulp_ops->clone(req, newsk, priority);
-}
-
 static int __tcp_set_ulp(struct sock *sk, const struct tcp_ulp_ops *ulp_ops)
 {
 	struct inet_connection_sock *icsk = inet_csk(sk);

LGTM, thanks!

Paolo

#2 lore raw

Hi Mat, Paolo,

Quoted 80 lines · Paolo Abeni
Quoted 79 lines · Mat Martineau

Make change suggested in upstream review - move and rename ulp clone helper to make it inline-friendly.

Commit message addition:

"""
v6 -> v7:
- move and rename ulp clone helper to make it inline-friendly
"""

Signed-off-by Mat Martineau <mathew.j.martineau(a)linux.intel.com>
---
  include/net/tcp.h               |  2 --
  net/ipv4/inet_connection_sock.c | 14 +++++++++++++-
  net/ipv4/tcp_ulp.c              | 12 ------------
  3 files changed, 13 insertions(+), 15 deletions(-)
include/net/tcp.h +0 -2
index 853537e330f8..5e4133d09b9d 100644
@@ -2183,8 +2183,6 @@ int tcp_set_ulp(struct sock *sk, const char *name);
  void tcp_get_available_ulp(char *buf, size_t len);
  void tcp_cleanup_ulp(struct sock *sk);
  void tcp_update_ulp(struct sock *sk, struct proto *p);
-void tcp_clone_ulp(const struct request_sock *req,
-		   struct sock *newsk, const gfp_t priority);
 
  #define MODULE_ALIAS_TCP_ULP(name)				\
  	__MODULE_INFO(alias, alias_userspace, name);		\
net/ipv4/inet_connection_sock.c +13 -1
index bf53a722923a..6a691fd04398 100644
@@ -770,6 +770,18 @@ void inet_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req,
  }
  EXPORT_SYMBOL_GPL(inet_csk_reqsk_queue_hash_add);
 
+static void inet_clone_ulp(const struct request_sock *req, struct sock *newsk,
+			   const gfp_t priority)
+{
+	struct inet_connection_sock *icsk = inet_csk(newsk);
+
+	if (!icsk->icsk_ulp_ops)
+		return;
+
+	if (icsk->icsk_ulp_ops->clone)
+		icsk->icsk_ulp_ops->clone(req, newsk, priority);
+}
+
  /**
   *	inet_csk_clone_lock - clone an inet socket, and lock its clone
   *	@sk: the socket to clone
@@ -810,7 +822,7 @@ struct sock *inet_csk_clone_lock(const struct sock *sk,
  		/* Deinitialize accept_queue to trap illegal accesses. */
  		memset(&newicsk->icsk_accept_queue, 0, sizeof(newicsk->icsk_accept_queue));
 
-		tcp_clone_ulp(req, newsk, priority);
+		inet_clone_ulp(req, newsk, priority);
 
  		security_inet_csk_clone(newsk, req);
  	}
net/ipv4/tcp_ulp.c +0 -9
index e7a2589d69ee..12ab5db2b71c 100644
@@ -130,18 +130,6 @@ void tcp_cleanup_ulp(struct sock *sk)
  	icsk->icsk_ulp_ops = NULL;
  }
 
-void tcp_clone_ulp(const struct request_sock *req, struct sock *newsk,
-		   const gfp_t priority)
-{
-	struct inet_connection_sock *icsk = inet_csk(newsk);
-
-	if (!icsk->icsk_ulp_ops)
-		return;
-
-	if (icsk->icsk_ulp_ops->clone)
Quoted 8 lines

net/ipv4/tcp_ulp.c void tcp_cleanup_ulp(struct sock *sk) · line 135

Quoted 6 lines
net/ipv4/tcp_ulp.c +0 -3
-		icsk->icsk_ulp_ops->clone(req, newsk, priority);
-}
-
  static int __tcp_set_ulp(struct sock *sk, const struct tcp_ulp_ops *ulp_ops)
  {
  	struct inet_connection_sock *icsk = inet_csk(sk);

LGTM, thanks!

Thank you for the patch and the review!

- 7504dfc9d9a8: "squashed" in "tcp, ulp: Add clone operation to tcp_ulp_ops"
- 34e94b7f4d61: tg:msg: add changelog (v7)
- 04e0ad69c167..11cb91b0f172: 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