On 04.11.2012 13:29, Fabian Keil wrote:
Andre Oppermann <[email protected]> wrote:

thank you for the bug report.  Please try the attached patch
which should fix the issue you observed.

Thanks for the patch, Andre.

It seems to make the transfers 100% reliably again,
but they are frequently very slow:

fk@r500 ~ $i=1; while curl -o /dev/zero 'http://127.0.0.1:81/90k-file'; do echo 
$i; ((i=$i+1)); done
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
100 90000  100 90000    0     0   8670      0  0:00:10  0:00:10 --:--:--  2057
1
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
100 90000  100 90000    0     0   8821      0  0:00:10  0:00:10 --:--:--  2057
2
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
100 90000  100 90000    0     0   8821      0  0:00:10  0:00:10 --:--:--  2057
3
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
100 90000  100 90000    0     0  33.0M      0 --:--:-- --:--:-- --:--:-- 42.9M
4
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
100 90000  100 90000    0     0  32.5M      0 --:--:-- --:--:-- --:--:-- 85.8M

Looks like this is caused by occasional 5 second pauses
between packets after the client's TCP window update:

Fabian, Manfred,

The patch I sent was not correct.  Please try this new attached patch
instead.

--
Andre

Index: netinet/tcp_output.c
===================================================================
--- netinet/tcp_output.c        (revision 242577)
+++ netinet/tcp_output.c        (working copy)
@@ -228,7 +228,7 @@
        tso = 0;
        mtu = 0;
        off = tp->snd_nxt - tp->snd_una;
-       sendwin = min(tp->snd_wnd, tp->snd_cwnd);
+       sendwin = ulmax(ulmin(tp->snd_wnd - off, tp->snd_cwnd), 0);

        flags = tcp_outflags[tp->t_state];
        /*
@@ -249,7 +249,7 @@
            (p = tcp_sack_output(tp, &sack_bytes_rxmt))) {
                long cwin;

-               cwin = min(tp->snd_wnd, tp->snd_cwnd) - sack_bytes_rxmt;
+               cwin = ulmin(tp->snd_wnd - off, tp->snd_cwnd) - sack_bytes_rxmt;
                if (cwin < 0)
                        cwin = 0;
                /* Do not retransmit SACK segments beyond snd_recover */
@@ -355,7 +355,7 @@
                         * sending new data, having retransmitted all the
                         * data possible in the scoreboard.
                         */
-                       len = ((long)ulmin(so->so_snd.sb_cc, tp->snd_wnd)
+                       len = ((long)ulmin(so->so_snd.sb_cc, tp->snd_wnd - off)
                               - off);
                        /*
                         * Don't remove this (len > 0) check !
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[email protected]"

Reply via email to