[RFC PATCH 6/6] mptcp: unclone skbs before coalescing them, when needed

Paolo Abeni posted 6 patches 1 month, 3 weeks ago
There is a newer version of this series
[RFC PATCH 6/6] mptcp: unclone skbs before coalescing them, when needed
Posted by Paolo Abeni 1 month, 3 weeks ago
The self-test can trigger skb coalescing on clones skb, as the
forward path uses only veth devices. That in turn prevents coalescing
making memory pressure scenario more extreme.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
Possibly we could obtain the same effect with some netem magic, would
be better.
---
 net/mptcp/protocol.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 8ddd4bb5172e..42af9f9e935d 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -162,6 +162,7 @@ static bool __mptcp_try_coalesce(struct sock *sk, struct sk_buff *to,
 	if (unlikely(MPTCP_SKB_CB(to)->cant_coalesce) ||
 	    MPTCP_SKB_CB(from)->offset ||
 	    ((to->len + from->len) > max(U16_MAX, (limit >> 3))) ||
+	    (skb_cloned(to) && skb_unclone(to, GFP_ATOMIC)) ||
 	    !skb_try_coalesce(to, from, fragstolen, delta))
 		return false;
 
-- 
2.53.0