Skip to contentSkip to conversation

mptcp: tx refactor update

PATCH In review Paolo Abeni 3 participants 6 messages Sep 21, 2021 – Sep 23, 2021

Subsystems (3)
lore
Share & tools
lore

Paolo Abeni

author maintainer
#0 lore raw

v2 cover mptcp: tx refactor update

This are updates to the tx refactor patches as asked by Eric. Note that patch 3/3 should replace completely the existing 'Partially revert "tcp: factor out tcp_build_frag()"' patch. I opted for this solution as the git repo mangling looked easier this way; @matttbe: please tell me if other options are preferred instead.

Additionally patch "chtls: rename skb_entail() to chtls_skb_entail()" should be dropped.

v1 -> v2:
- drop unintended chunk in patch 3/3 [mat]

---
 include/net/tcp.h | 2 +-
 net/ipv4/tcp.c    | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.26.3
author maintainer
#1 lore raw

PATCH v2 1/3 Squash-to: "tcp: expose the tcp_mark_push() and skb_entail() helpers"

Also change the commit title and message to:

"""
tcp: expose the tcp_mark_push() and tcp_skb_entail() helpers

the tcp_skb_entail() helper actually skb_entail(), renamed to provide proper scope.

The two helper will be used by the next patch.

RFC -> v1:
- rename skb_entail to tcp_skb_entail (Eric)

"""

---
 include/net/tcp.h | 2 +-
 net/ipv4/tcp.c    | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
include/net/tcp.h +1 -1
index dc52ea8adfc7..4a96f6e0f6f8 100644
@@ -581,7 +581,7 @@ __u32 cookie_v6_init_sequence(const struct sk_buff *skb, __u16 *mss);
 #endif
 /* tcp_output.c */
 
-void skb_entail(struct sock *sk, struct sk_buff *skb);
+void tcp_skb_entail(struct sock *sk, struct sk_buff *skb);
 void tcp_mark_push(struct tcp_sock *tp, struct sk_buff *skb);
 void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
 			       int nonagle);
net/ipv4/tcp.c +3 -3
index 7a3e632b0048..c592454625e1 100644
@@ -658,7 +658,7 @@ static inline bool forced_push(const struct tcp_sock *tp)
 	return after(tp->write_seq, tp->pushed_seq + (tp->max_window >> 1));
 }
 
-void skb_entail(struct sock *sk, struct sk_buff *skb)
+void tcp_skb_entail(struct sock *sk, struct sk_buff *skb)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
 	struct tcp_skb_cb *tcb = TCP_SKB_CB(skb);
@@ -985,7 +985,7 @@ struct sk_buff *tcp_build_frag(struct sock *sk, int size_goal, int flags,
 #ifdef CONFIG_TLS_DEVICE
 		skb->decrypted = !!(flags & MSG_SENDPAGE_DECRYPTED);
 #endif
-		skb_entail(sk, skb);
+		tcp_skb_entail(sk, skb);
 		copy = size_goal;
 	}
 
@@ -1314,7 +1314,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
 			process_backlog++;
 			skb->ip_summed = CHECKSUM_PARTIAL;
 
-			skb_entail(sk, skb);
+			tcp_skb_entail(sk, skb);
 			copy = size_goal;
 
 			/* All packets are restored as if they have
Signature · 1 line
2.26.3
author maintainer
#2 lore raw

PATCH v2 2/3 Squash-to: "mptcp: stop relying on tcp_tx_skb_cache"

In reply to Paolo Abeni

fix build after helper rename

---
 net/mptcp/protocol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mptcp/protocol.c +1 -1
index 48e0e3a945e4..87ee409d68ab 100644
@@ -1240,7 +1240,7 @@ static struct sk_buff *__mptcp_alloc_tx_skb(struct sock *sk, struct sock *ssk, g
 		return NULL;
 
 	if (likely(sk_wmem_schedule(ssk, skb->truesize))) {
-		skb_entail(ssk, skb);
+		tcp_skb_entail(ssk, skb);
 		return skb;
 	}
 	kfree_skb(skb);
Signature · 1 line
2.26.3
author maintainer
#3 lore raw

PATCH v2 3/3 tcp: make tcp_build_frag() static

In reply to Paolo Abeni

After the previous patch the mentioned helper is used only inside its compilation unit: let's make it static.

RFC -> v1:
- preserve the tcp_build_frag() helper (Eric)

---
Note:
this should _replace_:
"""
Partially revert "tcp: factor out tcp_build_frag()" """

I did not opted for a squash to patch, as it would still require conflicts resolution after the previous squash-to patch. @matttbe: please let me know if you prefer otherwise.

---
 include/net/tcp.h | 2 --
 net/ipv4/tcp.c    | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)
include/net/tcp.h +0 -2
index 4a96f6e0f6f8..673c3b01e287 100644
@@ -330,8 +330,6 @@ int tcp_sendpage(struct sock *sk, struct page *page, int offset, size_t size,
 		 int flags);
 int tcp_sendpage_locked(struct sock *sk, struct page *page, int offset,
 			size_t size, int flags);
-struct sk_buff *tcp_build_frag(struct sock *sk, int size_goal, int flags,
-			       struct page *page, int offset, size_t *size);
 ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,
 		 size_t size, int flags);
 int tcp_send_mss(struct sock *sk, int *size_goal, int flags);
net/ipv4/tcp.c +2 -2
index c592454625e1..29cb7bf9dc1c 100644
@@ -963,8 +963,8 @@ void tcp_remove_empty_skb(struct sock *sk, struct sk_buff *skb)
 	}
 }
 
-struct sk_buff *tcp_build_frag(struct sock *sk, int size_goal, int flags,
-			       struct page *page, int offset, size_t *size)
+static struct sk_buff *tcp_build_frag(struct sock *sk, int size_goal, int flags,
+				      struct page *page, int offset, size_t *size)
 {
 	struct sk_buff *skb = tcp_write_queue_tail(sk);
 	struct tcp_sock *tp = tcp_sk(sk);
Signature · 1 line
2.26.3
#4 lore raw
In reply to Paolo Abeni
Quoted 10 lines · Paolo Abeni

This are updates to the tx refactor patches as asked by Eric. Note that patch 3/3 should replace completely the existing 'Partially revert "tcp: factor out tcp_build_frag()"' patch. I opted for this solution as the git repo mangling looked easier this way; @matttbe: please tell me if other options are preferred instead.

Additionally patch "chtls: rename skb_entail() to chtls_skb_entail()" should be dropped.

Quoted 7 lines

v1 -> v2:
- drop unintended chunk in patch 3/3 [mat]
---
include/net/tcp.h | 2 +-
net/ipv4/tcp.c | 6 +++---

2 files changed, 4 insertions(+), 4 deletions(-)

Thanks for the v2, these are ready to apply.

--
Mat Martineau
Intel

#5 lore raw
In reply to Paolo Abeni

Hi Paolo, Mat,

Quoted 10 lines · Paolo Abeni

This are updates to the tx refactor patches as asked by Eric. Note that patch 3/3 should replace completely the existing 'Partially revert "tcp: factor out tcp_build_frag()"' patch. I opted for this solution as the git repo mangling looked easier this way; @matttbe: please tell me if other options are preferred instead.

Additionally patch "chtls: rename skb_entail() to chtls_skb_entail()" should be dropped.

Quoted 6 lines

v1 -> v2:
- drop unintended chunk in patch 3/3 [mat]

---
 include/net/tcp.h | 2 +-
 net/ipv4/tcp.c    | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Thank you for the patches and the reviews!

I just reverted the original series (5 patches) and sync with net-next (4+1 patches are already there).

Builds and tests are now in progress:

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

Cheers,
Matt

Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net