FreeBSD Bugzilla – Attachment 81218 Details for
Bug 116335
[tcp] Excessive TCP window updates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch-1.diff
patch-1.diff (text/plain), 2.68 KB, created by
Andre Oppermann
on 2010-08-16 22:27:15 UTC
(
hide
)
Description:
patch-1.diff
Filename:
MIME Type:
Creator:
Andre Oppermann
Created:
2010-08-16 22:27:15 UTC
Size:
2.68 KB
patch
obsolete
>Index: tcp_output.c >=================================================================== >--- tcp_output.c (revision 211396) >+++ tcp_output.c (working copy) >@@ -543,29 +543,53 @@ > } > > /* >- * Compare available window to amount of window >- * known to peer (as advertised window less >- * next expected input). If the difference is at least two >- * max size segments, or at least 50% of the maximum possible >- * window, then want to send a window update to peer. >- * Skip this if the connection is in T/TCP half-open state. >- * Don't send pure window updates when the peer has closed >- * the connection and won't ever send more data. >+ * Sending of standalone window updates. >+ * >+ * Window updates important when we close our window >+ * due to a full socket buffer and are opening it again >+ * after the application reads data from it. Once the >+ * window has opened again and the remote end starts to >+ * send again the ACK clock takes over and provides the >+ * most current window information. >+ * >+ * We must avoid to the silly window syndrome whereas >+ * every read from the receive buffer, no matter how >+ * small, causes a window update to be sent. We also >+ * should avoid sending a flurry of window updates when >+ * the socket buffer had queued a lot of data and the >+ * application is doing small reads. >+ * >+ * Don't send an independent window update if a delayed >+ * ACK is pending (it will get piggy-backed on it) or the >+ * remote side already has done a half-close and won't send >+ * more data. Skip this if the connection is in T/TCP >+ * half-open state. > */ > if (recwin > 0 && !(tp->t_flags & TF_NEEDSYN) && >+ !(tp->t_flags & TF_DELACK) && > !TCPS_HAVERCVDFIN(tp->t_state)) { > /* > * "adv" is the amount we can increase the window, > * taking into account that we are limited by > * TCP_MAXWIN << tp->rcv_scale. > */ >- long adv = min(recwin, (long)TCP_MAXWIN << tp->rcv_scale) - >- (tp->rcv_adv - tp->rcv_nxt); >+ u_int adv = min(recwin, ((u_int)TCP_MAXWIN << tp->rcv_scale) - >+ (tp->rcv_adv - tp->rcv_nxt)); > >- if (adv >= (long) (2 * tp->t_maxseg)) >+ /* >+ * Send an update when we can increase by more than >+ * 1/4th of the socket buffer capacity. >+ * When the buffer is getting full or is very small >+ * be more aggressive and send an update whenever >+ * we can increase by two mss sized segments. >+ * In all other situations the ACK's to new incoming >+ * data will carry further increases. >+ */ >+ if (adv >= 2 * tp->t_maxseg && >+ (adv >= so->so_rcv.sb_hiwat / 4 || >+ recwin <= so->so_rcv.sb_hiwat / 8 || >+ so->so_rcv.sb_hiwat <= 8 * tp->t_maxopd)) > goto send; >- if (2 * adv >= (long) so->so_rcv.sb_hiwat) >- goto send; > } > > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 116335
: 81218