]> git.baikalelectronics.ru Git - kernel.git/commit
loopback: packet drops accounting
authorEric Dumazet <dada1@cosmosbay.com>
Fri, 17 Apr 2009 22:03:10 +0000 (22:03 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Apr 2009 09:25:26 +0000 (02:25 -0700)
commit402bde22b67a6b4de3803d7b1a11e8df206435df
treeae09d5928a764f5cb58eb217ec0d910e5d332474
parent3bfc6feb01394f7aa10f85c7df05490d567f827d
loopback: packet drops accounting

We can in some situations drop packets in netif_rx()

loopback driver does not report these (unlikely) drops to its stats,
and incorrectly change packets/bytes counts.

After this patch applied, "ifconfig lo" can reports these drops as in :

# ifconfig lo
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:692562900 errors:3228 dropped:3228 overruns:0 frame:0
          TX packets:692562900 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2865674174 (2.6 GiB)  TX bytes:2865674174 (2.6 GiB)

I initialy chose to reflect those errors only in tx_dropped/tx_errors, but David
convinced me that it was really RX errors, as loopback_xmit() really starts
a RX process. (calling eth_type_trans() for example, that itself pulls the ethernet header)

These errors are accounted in rx_dropped/rx_errors.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/loopback.c