diff options
author | Sathya Perla <sathyap@serverengines.com> | 2009-06-09 22:21:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-11 05:47:16 -0400 |
commit | 6811086899f2740c08d0ade26f8b9d705708e0cc (patch) | |
tree | 2dacb7018e7db2d710ad8e4203f202d46afee150 /drivers/net/benet/be_main.c | |
parent | b305be78a044c5f6a9d146229a280d08db0c630a (diff) |
be2net: fix netdev stats rx_errors and rx_dropped
Fix netdev stat rx_errors to cover length related errors and checksum errors and rx_dropped to the pkts dropped due to lack of buffers
Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r-- | drivers/net/benet/be_main.c | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 69046a109ac3..6487eb4bad10 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -168,6 +168,7 @@ static void netdev_stats_update(struct be_adapter *adapter) | |||
168 | struct be_port_rxf_stats *port_stats = | 168 | struct be_port_rxf_stats *port_stats = |
169 | &rxf_stats->port[adapter->port_num]; | 169 | &rxf_stats->port[adapter->port_num]; |
170 | struct net_device_stats *dev_stats = &adapter->stats.net_stats; | 170 | struct net_device_stats *dev_stats = &adapter->stats.net_stats; |
171 | struct be_erx_stats *erx_stats = &hw_stats->erx; | ||
171 | 172 | ||
172 | dev_stats->rx_packets = port_stats->rx_total_frames; | 173 | dev_stats->rx_packets = port_stats->rx_total_frames; |
173 | dev_stats->tx_packets = port_stats->tx_unicastframes + | 174 | dev_stats->tx_packets = port_stats->tx_unicastframes + |
@@ -181,29 +182,33 @@ static void netdev_stats_update(struct be_adapter *adapter) | |||
181 | dev_stats->rx_errors = port_stats->rx_crc_errors + | 182 | dev_stats->rx_errors = port_stats->rx_crc_errors + |
182 | port_stats->rx_alignment_symbol_errors + | 183 | port_stats->rx_alignment_symbol_errors + |
183 | port_stats->rx_in_range_errors + | 184 | port_stats->rx_in_range_errors + |
184 | port_stats->rx_out_range_errors + port_stats->rx_frame_too_long; | 185 | port_stats->rx_out_range_errors + |
185 | 186 | port_stats->rx_frame_too_long + | |
186 | /* packet transmit problems */ | 187 | port_stats->rx_dropped_too_small + |
187 | dev_stats->tx_errors = 0; | 188 | port_stats->rx_dropped_too_short + |
188 | 189 | port_stats->rx_dropped_header_too_small + | |
189 | /* no space in linux buffers */ | 190 | port_stats->rx_dropped_tcp_length + |
190 | dev_stats->rx_dropped = 0; | 191 | port_stats->rx_dropped_runt + |
191 | 192 | port_stats->rx_tcp_checksum_errs + | |
192 | /* no space available in linux */ | 193 | port_stats->rx_ip_checksum_errs + |
193 | dev_stats->tx_dropped = 0; | 194 | port_stats->rx_udp_checksum_errs; |
194 | 195 | ||
195 | dev_stats->multicast = port_stats->tx_multicastframes; | 196 | /* no space in linux buffers: best possible approximation */ |
196 | dev_stats->collisions = 0; | 197 | dev_stats->rx_dropped = erx_stats->rx_drops_no_fragments[0]; |
197 | 198 | ||
198 | /* detailed rx errors */ | 199 | /* detailed rx errors */ |
199 | dev_stats->rx_length_errors = port_stats->rx_in_range_errors + | 200 | dev_stats->rx_length_errors = port_stats->rx_in_range_errors + |
200 | port_stats->rx_out_range_errors + port_stats->rx_frame_too_long; | 201 | port_stats->rx_out_range_errors + |
202 | port_stats->rx_frame_too_long; | ||
203 | |||
201 | /* receive ring buffer overflow */ | 204 | /* receive ring buffer overflow */ |
202 | dev_stats->rx_over_errors = 0; | 205 | dev_stats->rx_over_errors = 0; |
206 | |||
203 | dev_stats->rx_crc_errors = port_stats->rx_crc_errors; | 207 | dev_stats->rx_crc_errors = port_stats->rx_crc_errors; |
204 | 208 | ||
205 | /* frame alignment errors */ | 209 | /* frame alignment errors */ |
206 | dev_stats->rx_frame_errors = port_stats->rx_alignment_symbol_errors; | 210 | dev_stats->rx_frame_errors = port_stats->rx_alignment_symbol_errors; |
211 | |||
207 | /* receiver fifo overrun */ | 212 | /* receiver fifo overrun */ |
208 | /* drops_no_pbuf is no per i/f, it's per BE card */ | 213 | /* drops_no_pbuf is no per i/f, it's per BE card */ |
209 | dev_stats->rx_fifo_errors = port_stats->rx_fifo_overflow + | 214 | dev_stats->rx_fifo_errors = port_stats->rx_fifo_overflow + |
@@ -211,6 +216,16 @@ static void netdev_stats_update(struct be_adapter *adapter) | |||
211 | rxf_stats->rx_drops_no_pbuf; | 216 | rxf_stats->rx_drops_no_pbuf; |
212 | /* receiver missed packetd */ | 217 | /* receiver missed packetd */ |
213 | dev_stats->rx_missed_errors = 0; | 218 | dev_stats->rx_missed_errors = 0; |
219 | |||
220 | /* packet transmit problems */ | ||
221 | dev_stats->tx_errors = 0; | ||
222 | |||
223 | /* no space available in linux */ | ||
224 | dev_stats->tx_dropped = 0; | ||
225 | |||
226 | dev_stats->multicast = port_stats->tx_multicastframes; | ||
227 | dev_stats->collisions = 0; | ||
228 | |||
214 | /* detailed tx_errors */ | 229 | /* detailed tx_errors */ |
215 | dev_stats->tx_aborted_errors = 0; | 230 | dev_stats->tx_aborted_errors = 0; |
216 | dev_stats->tx_carrier_errors = 0; | 231 | dev_stats->tx_carrier_errors = 0; |