提交 7f9c33e5 编写于 作者: I Ilpo Järvinen 提交者: Herbert Xu

[TCP] MTUprobe: Cleanup send queue check (no need to loop)

The original code has striking complexity to perform a query
which can be reduced to a very simple compare.

FIN seqno may be included to write_seq but it should not make
any significant difference here compared to skb->len which was
used previously. One won't end up there with SYN still queued.

Use of write_seq check guarantees that there's a valid skb in
send_head so I removed the extra check.
Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Acked-by: NJohn Heffner <jheffner@psc.edu>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 91cc17c0
...@@ -1321,12 +1321,7 @@ static int tcp_mtu_probe(struct sock *sk) ...@@ -1321,12 +1321,7 @@ static int tcp_mtu_probe(struct sock *sk)
} }
/* Have enough data in the send queue to probe? */ /* Have enough data in the send queue to probe? */
len = 0; if (tp->write_seq - tp->snd_nxt < size_needed)
if ((skb = tcp_send_head(sk)) == NULL)
return -1;
while ((len += skb->len) < size_needed && !tcp_skb_is_last(sk, skb))
skb = tcp_write_queue_next(sk, skb);
if (len < size_needed)
return -1; return -1;
if (tp->snd_wnd < size_needed) if (tp->snd_wnd < size_needed)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册