Page MenuHomeFreeBSD

loopback: Account for packet drops
ClosedPublic

Authored by gallatin on Sat, Apr 11, 9:13 PM.
Tags
None
Referenced Files
F153145398: D56356.diff
Sun, Apr 19, 11:25 AM
F153124365: D56356.id175523.diff
Sun, Apr 19, 8:11 AM
F153123752: D56356.id175305.diff
Sun, Apr 19, 8:05 AM
F153122834: D56356.diff
Sun, Apr 19, 7:55 AM
Unknown Object (File)
Sat, Apr 18, 9:41 AM
Unknown Object (File)
Sat, Apr 18, 9:41 AM
Unknown Object (File)
Sat, Apr 18, 7:49 AM
Unknown Object (File)
Fri, Apr 17, 11:29 AM
Subscribers

Details

Summary

When transferring data via loopback, packets can actually be dropped. This was a surprise to me, as netstat -ndI lo0 always shows all drop counters as zero. It was only after I went on a hunt for dropped packets that I realized loopback uses netisr queuing, and can experience drops when the netisr queue is full. This can be seen in netstat -Q, but its really hard to know to look there.

So this patch checks the return status of netisr_queue(), and increments input drop counters (rather than input byte/packet counters) when queuing the packet fails. This makes loopback interfaces more "normal" in terms of reporting packet loss.

Test Plan

Run a heavy network workload on lo0 that drops packets and verify that netstat -nI lo0 shows drops:

# netstat -nI lo0
Name    Mtu Network              Address                Ipkts    Ierrs    Idrop      Opkts    Oerrs     Coll
lo0   16384 <Link#1>             lo0               1017309842        0  1950066 1019259908        0        0
<....>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

gallatin edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Sun, Apr 12, 7:55 AM

Whoa. This also needs to be merged to all stable/X.

This revision was automatically updated to reflect the committed changes.