diff options
-rw-r--r-- | drivers/net/benet/be.h | 2 | ||||
-rw-r--r-- | drivers/net/benet/be_main.c | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index e3a466545d4e..42c7a2bb844f 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -164,6 +164,7 @@ struct be_drvr_stats { | |||
164 | ulong be_tx_jiffies; | 164 | ulong be_tx_jiffies; |
165 | u64 be_tx_bytes; | 165 | u64 be_tx_bytes; |
166 | u64 be_tx_bytes_prev; | 166 | u64 be_tx_bytes_prev; |
167 | u64 be_tx_pkts; | ||
167 | u32 be_tx_rate; | 168 | u32 be_tx_rate; |
168 | 169 | ||
169 | u32 cache_barrier[16]; | 170 | u32 cache_barrier[16]; |
@@ -175,6 +176,7 @@ struct be_drvr_stats { | |||
175 | ulong be_rx_jiffies; | 176 | ulong be_rx_jiffies; |
176 | u64 be_rx_bytes; | 177 | u64 be_rx_bytes; |
177 | u64 be_rx_bytes_prev; | 178 | u64 be_rx_bytes_prev; |
179 | u64 be_rx_pkts; | ||
178 | u32 be_rx_rate; | 180 | u32 be_rx_rate; |
179 | /* number of non ether type II frames dropped where | 181 | /* number of non ether type II frames dropped where |
180 | * frame len > length field of Mac Hdr */ | 182 | * frame len > length field of Mac Hdr */ |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index f66704460876..de0830e14aa5 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -159,13 +159,10 @@ void netdev_stats_update(struct be_adapter *adapter) | |||
159 | struct net_device_stats *dev_stats = &adapter->netdev->stats; | 159 | struct net_device_stats *dev_stats = &adapter->netdev->stats; |
160 | struct be_erx_stats *erx_stats = &hw_stats->erx; | 160 | struct be_erx_stats *erx_stats = &hw_stats->erx; |
161 | 161 | ||
162 | dev_stats->rx_packets = port_stats->rx_total_frames; | 162 | dev_stats->rx_packets = drvr_stats(adapter)->be_rx_pkts; |
163 | dev_stats->tx_packets = port_stats->tx_unicastframes + | 163 | dev_stats->tx_packets = drvr_stats(adapter)->be_tx_pkts; |
164 | port_stats->tx_multicastframes + port_stats->tx_broadcastframes; | 164 | dev_stats->rx_bytes = drvr_stats(adapter)->be_rx_bytes; |
165 | dev_stats->rx_bytes = (u64) port_stats->rx_bytes_msd << 32 | | 165 | dev_stats->tx_bytes = drvr_stats(adapter)->be_tx_bytes; |
166 | (u64) port_stats->rx_bytes_lsd; | ||
167 | dev_stats->tx_bytes = (u64) port_stats->tx_bytes_msd << 32 | | ||
168 | (u64) port_stats->tx_bytes_lsd; | ||
169 | 166 | ||
170 | /* bad pkts received */ | 167 | /* bad pkts received */ |
171 | dev_stats->rx_errors = port_stats->rx_crc_errors + | 168 | dev_stats->rx_errors = port_stats->rx_crc_errors + |
@@ -322,12 +319,13 @@ static void be_tx_rate_update(struct be_adapter *adapter) | |||
322 | } | 319 | } |
323 | 320 | ||
324 | static void be_tx_stats_update(struct be_adapter *adapter, | 321 | static void be_tx_stats_update(struct be_adapter *adapter, |
325 | u32 wrb_cnt, u32 copied, bool stopped) | 322 | u32 wrb_cnt, u32 copied, u32 gso_segs, bool stopped) |
326 | { | 323 | { |
327 | struct be_drvr_stats *stats = drvr_stats(adapter); | 324 | struct be_drvr_stats *stats = drvr_stats(adapter); |
328 | stats->be_tx_reqs++; | 325 | stats->be_tx_reqs++; |
329 | stats->be_tx_wrbs += wrb_cnt; | 326 | stats->be_tx_wrbs += wrb_cnt; |
330 | stats->be_tx_bytes += copied; | 327 | stats->be_tx_bytes += copied; |
328 | stats->be_tx_pkts += (gso_segs ? gso_segs : 1); | ||
331 | if (stopped) | 329 | if (stopped) |
332 | stats->be_tx_stops++; | 330 | stats->be_tx_stops++; |
333 | } | 331 | } |
@@ -472,7 +470,8 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, | |||
472 | 470 | ||
473 | be_txq_notify(adapter, txq->id, wrb_cnt); | 471 | be_txq_notify(adapter, txq->id, wrb_cnt); |
474 | 472 | ||
475 | be_tx_stats_update(adapter, wrb_cnt, copied, stopped); | 473 | be_tx_stats_update(adapter, wrb_cnt, copied, |
474 | skb_shinfo(skb)->gso_segs, stopped); | ||
476 | } else { | 475 | } else { |
477 | txq->head = start; | 476 | txq->head = start; |
478 | dev_kfree_skb_any(skb); | 477 | dev_kfree_skb_any(skb); |
@@ -619,6 +618,7 @@ static void be_rx_stats_update(struct be_adapter *adapter, | |||
619 | stats->be_rx_compl++; | 618 | stats->be_rx_compl++; |
620 | stats->be_rx_frags += numfrags; | 619 | stats->be_rx_frags += numfrags; |
621 | stats->be_rx_bytes += pktsize; | 620 | stats->be_rx_bytes += pktsize; |
621 | stats->be_rx_pkts++; | ||
622 | } | 622 | } |
623 | 623 | ||
624 | static inline bool do_pkt_csum(struct be_eth_rx_compl *rxcp, bool cso) | 624 | static inline bool do_pkt_csum(struct be_eth_rx_compl *rxcp, bool cso) |