kern/75122: [PATCH] Incorrect inflight bandwidth calculation on first packet

Dan Nelson dnelson at allantgroup.com
Wed Dec 22 14:24:55 PST 2004


In the last episode (Dec 21), Uwe Doering said:
> Uwe Doering wrote:
> >Dan Nelson wrote:
> >>In the last episode (Dec 18), Uwe Doering said:
> >>>Dan Nelson wrote:
> >>>
> >>>>Updated patch including Matt's recommended fix:
> >>>>
> >>>>+    /*
> >>>>+     * Sanity check, plus ignore pure window update acks.
> >>>>+     */
> >>>>+    if ((int)(ack_seq - tp->t_bw_rtseq) <= 0)
> >>>>+        return;
>
> On second thought, checking for less than zero (by means of the 'int' 
> cast) might have its merits.  This may be a protection against 
> out-of-order ACKs, which could in fact be valid, but calculating a byte 
> count from an ACK for an earlier packet when we've already processed a 
> later ACK would be bogus.

I am pretty sure only useful acks get to this point.  I've changed that
bit of code to just be

+       /*
+        * Ignore pure window update acks.
+        */
+       if (ack_seq == tp->t_bw_rtseq)
+               return;

and added another check for negative sequences that increments a sysctl
counter.  So far netstat -s has counted 567 out-of-order packets but my
counter is still at 0.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-bugs mailing list