Skip to content

Commit 06827b3

Browse files
mjmartineaudavem330
authored andcommitted
mptcp: Skip unnecessary skb extension allocation for bare acks
Bare TCP ack skbs are freed right after MPTCP sees them, so the work to allocate, zero, and populate the MPTCP skb extension is wasted. Detect these skbs and do not add skb extensions to them. Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 067a0b3 commit 06827b3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

net/mptcp/options.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -868,15 +868,18 @@ void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb,
868868
if (mp_opt.use_ack)
869869
update_una(msk, &mp_opt);
870870

871-
/* Zero-length packets, like bare ACKs carrying a DATA_FIN, are
872-
* dropped by the caller and not propagated to the MPTCP layer.
873-
* Copy the DATA_FIN information now.
871+
/* Zero-data-length packets are dropped by the caller and not
872+
* propagated to the MPTCP layer, so the skb extension does not
873+
* need to be allocated or populated. DATA_FIN information, if
874+
* present, needs to be updated here before the skb is freed.
874875
*/
875876
if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq) {
876877
if (mp_opt.data_fin && mp_opt.data_len == 1 &&
877878
mptcp_update_rcv_data_fin(msk, mp_opt.data_seq) &&
878879
schedule_work(&msk->work))
879880
sock_hold(subflow->conn);
881+
882+
return;
880883
}
881884

882885
mpext = skb_ext_add(skb, SKB_EXT_MPTCP);

0 commit comments

Comments
 (0)