Commit 06827b34 authored by Mat Martineau's avatar Mat Martineau Committed by David S. Miller

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: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 067a0b3d
...@@ -868,15 +868,18 @@ void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb, ...@@ -868,15 +868,18 @@ void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb,
if (mp_opt.use_ack) if (mp_opt.use_ack)
update_una(msk, &mp_opt); update_una(msk, &mp_opt);
/* Zero-length packets, like bare ACKs carrying a DATA_FIN, are /* Zero-data-length packets are dropped by the caller and not
* dropped by the caller and not propagated to the MPTCP layer. * propagated to the MPTCP layer, so the skb extension does not
* Copy the DATA_FIN information now. * need to be allocated or populated. DATA_FIN information, if
* present, needs to be updated here before the skb is freed.
*/ */
if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq) { if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq) {
if (mp_opt.data_fin && mp_opt.data_len == 1 && if (mp_opt.data_fin && mp_opt.data_len == 1 &&
mptcp_update_rcv_data_fin(msk, mp_opt.data_seq) && mptcp_update_rcv_data_fin(msk, mp_opt.data_seq) &&
schedule_work(&msk->work)) schedule_work(&msk->work))
sock_hold(subflow->conn); sock_hold(subflow->conn);
return;
} }
mpext = skb_ext_add(skb, SKB_EXT_MPTCP); mpext = skb_ext_add(skb, SKB_EXT_MPTCP);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment