Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255940
b: refs/heads/master
c: 6e53391
h: refs/heads/master
v: v3
  • Loading branch information
Sathya Perla authored and David S. Miller committed Jun 27, 2011
1 parent cb8714d commit 847096c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c6af9c406ceb3434281cf230938453931dcbab75
refs/heads/master: 6e53391cb4f9491182e7fbd280966ebe2aca07dc
29 changes: 17 additions & 12 deletions trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,33 +428,38 @@ void netdev_stats_update(struct be_adapter *adapter)
struct net_device_stats *dev_stats = &adapter->netdev->stats;
struct be_rx_obj *rxo;
struct be_tx_obj *txo;
unsigned long pkts = 0, bytes = 0, mcast = 0, drops = 0;
int i;

memset(dev_stats, 0, sizeof(*dev_stats));
for_all_rx_queues(adapter, rxo, i) {
dev_stats->rx_packets += rx_stats(rxo)->rx_pkts;
dev_stats->rx_bytes += rx_stats(rxo)->rx_bytes;
dev_stats->multicast += rx_stats(rxo)->rx_mcast_pkts;
pkts += rx_stats(rxo)->rx_pkts;
bytes += rx_stats(rxo)->rx_bytes;
mcast += rx_stats(rxo)->rx_mcast_pkts;
/* no space in linux buffers: best possible approximation */
if (adapter->generation == BE_GEN3) {
if (!(lancer_chip(adapter))) {
struct be_erx_stats_v1 *erx_stats =
struct be_erx_stats_v1 *erx =
be_erx_stats_from_cmd(adapter);
dev_stats->rx_dropped +=
erx_stats->rx_drops_no_fragments[rxo->q.id];
drops += erx->rx_drops_no_fragments[rxo->q.id];
}
} else {
struct be_erx_stats_v0 *erx_stats =
struct be_erx_stats_v0 *erx =
be_erx_stats_from_cmd(adapter);
dev_stats->rx_dropped +=
erx_stats->rx_drops_no_fragments[rxo->q.id];
drops += erx->rx_drops_no_fragments[rxo->q.id];
}
}
dev_stats->rx_packets = pkts;
dev_stats->rx_bytes = bytes;
dev_stats->multicast = mcast;
dev_stats->rx_dropped = drops;

pkts = bytes = 0;
for_all_tx_queues(adapter, txo, i) {
dev_stats->tx_packets += tx_stats(txo)->be_tx_pkts;
dev_stats->tx_bytes += tx_stats(txo)->be_tx_bytes;
pkts += tx_stats(txo)->be_tx_pkts;
bytes += tx_stats(txo)->be_tx_bytes;
}
dev_stats->tx_packets = pkts;
dev_stats->tx_bytes = bytes;

/* bad pkts received */
dev_stats->rx_errors = drvs->rx_crc_errors +
Expand Down

0 comments on commit 847096c

Please sign in to comment.