Hey- REcently observed a problem wherein, if a BMC or other IPMI device is attached to a NIC, multicast frames can be consumed by the aformentioned device without ever being seen by the driver. Since multicast frames are counted in the hardware and the total frame counter is counted in the driver napi routine, its possible to have a condition in which the number of received multicast frames exceeds the total number of frames. This patch re-aligns those values on receive, so that the total frame count is always at least as large as the received frame count. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> e1000_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 59579b1..66afee8 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -3761,6 +3761,8 @@ e1000_update_stats(struct e1000_adapter *adapter) /* Fill out the OS statistics structure */ adapter->net_stats.multicast = adapter->stats.mprc; adapter->net_stats.collisions = adapter->stats.colc; + if (adapter->net_stats.rx_packets < adapter->net_stats.multicast) + adapter->net_stats.rx_packets = adapter->net_stats.multicast; /* Rx Errors */ @@ -4347,6 +4349,8 @@ next_desc: adapter->alloc_rx_buf(adapter, rx_ring, cleaned_count); adapter->total_rx_packets += total_rx_packets; + if (adapter->total_rx_packets < adapter->net_stats.multicast) + adapter->total_rx_packets = adapter->net_stats.multicast; adapter->total_rx_bytes += total_rx_bytes; adapter->net_stats.rx_bytes += total_rx_bytes; adapter->net_stats.rx_packets += total_rx_packets; @@ -4536,6 +4540,8 @@ next_desc: adapter->alloc_rx_buf(adapter, rx_ring, cleaned_count); adapter->total_rx_packets += total_rx_packets; + if (adapter->total_rx_packets < adapter->net_stats.multicast) + adapter->total_rx_packets = adapter->net_stats.multicast; adapter->total_rx_bytes += total_rx_bytes; adapter->net_stats.rx_bytes += total_rx_bytes; adapter->net_stats.rx_packets += total_rx_packets; -- /**************************************************** * Neil Horman <nhorman@tuxdriver.com> * Software Engineer, Red Hat ****************************************************/ -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| hooanon05 | [PATCH 67/67] merge aufs |
| Greg Kroah-Hartman | [PATCH 008/196] Chinese: add translation of volatile-considered-harmful.txt |
| monstr | [PATCH 33/52] [microblaze] bug headers files |
| Oliver Pinter | Re: x86: 4kstacks default |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| David Miller | [GIT]: Networking |
| Natalie Protasevich | [BUG] New Kernel Bugs |
