Skip to content

Commit 4687f3f

Browse files
david decotignydavem330
authored andcommitted
forcedeth: remove unneeded stats updates
Function ndo_get_stats() updates most of the stats from hardware registers, making the manual updates un-needed. This change removes these manual updates. Main exception is rx_missed_errors which needs manual update. Another exception is rx_packets, still updated manually in this commit to make sure this patch doesn't change behavior of driver. This will be addressed by a future patch. Signed-off-by: David Decotigny <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2a4e7a0 commit 4687f3f

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

drivers/net/ethernet/nvidia/forcedeth.c

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,16 +2374,8 @@ static int nv_tx_done(struct net_device *dev, int limit)
23742374
if (np->desc_ver == DESC_VER_1) {
23752375
if (flags & NV_TX_LASTPACKET) {
23762376
if (flags & NV_TX_ERROR) {
2377-
if (flags & NV_TX_UNDERFLOW)
2378-
dev->stats.tx_fifo_errors++;
2379-
if (flags & NV_TX_CARRIERLOST)
2380-
dev->stats.tx_carrier_errors++;
23812377
if ((flags & NV_TX_RETRYERROR) && !(flags & NV_TX_RETRYCOUNT_MASK))
23822378
nv_legacybackoff_reseed(dev);
2383-
dev->stats.tx_errors++;
2384-
} else {
2385-
dev->stats.tx_packets++;
2386-
dev->stats.tx_bytes += np->get_tx_ctx->skb->len;
23872379
}
23882380
dev_kfree_skb_any(np->get_tx_ctx->skb);
23892381
np->get_tx_ctx->skb = NULL;
@@ -2392,16 +2384,8 @@ static int nv_tx_done(struct net_device *dev, int limit)
23922384
} else {
23932385
if (flags & NV_TX2_LASTPACKET) {
23942386
if (flags & NV_TX2_ERROR) {
2395-
if (flags & NV_TX2_UNDERFLOW)
2396-
dev->stats.tx_fifo_errors++;
2397-
if (flags & NV_TX2_CARRIERLOST)
2398-
dev->stats.tx_carrier_errors++;
23992387
if ((flags & NV_TX2_RETRYERROR) && !(flags & NV_TX2_RETRYCOUNT_MASK))
24002388
nv_legacybackoff_reseed(dev);
2401-
dev->stats.tx_errors++;
2402-
} else {
2403-
dev->stats.tx_packets++;
2404-
dev->stats.tx_bytes += np->get_tx_ctx->skb->len;
24052389
}
24062390
dev_kfree_skb_any(np->get_tx_ctx->skb);
24072391
np->get_tx_ctx->skb = NULL;
@@ -2434,9 +2418,7 @@ static int nv_tx_done_optimized(struct net_device *dev, int limit)
24342418
nv_unmap_txskb(np, np->get_tx_ctx);
24352419

24362420
if (flags & NV_TX2_LASTPACKET) {
2437-
if (!(flags & NV_TX2_ERROR))
2438-
dev->stats.tx_packets++;
2439-
else {
2421+
if (flags & NV_TX2_ERROR) {
24402422
if ((flags & NV_TX2_RETRYERROR) && !(flags & NV_TX2_RETRYCOUNT_MASK)) {
24412423
if (np->driver_data & DEV_HAS_GEAR_MODE)
24422424
nv_gear_backoff_reseed(dev);
@@ -2636,7 +2618,6 @@ static int nv_rx_process(struct net_device *dev, int limit)
26362618
if ((flags & NV_RX_ERROR_MASK) == NV_RX_ERROR4) {
26372619
len = nv_getlen(dev, skb->data, len);
26382620
if (len < 0) {
2639-
dev->stats.rx_errors++;
26402621
dev_kfree_skb(skb);
26412622
goto next_pkt;
26422623
}
@@ -2650,11 +2631,6 @@ static int nv_rx_process(struct net_device *dev, int limit)
26502631
else {
26512632
if (flags & NV_RX_MISSEDFRAME)
26522633
dev->stats.rx_missed_errors++;
2653-
if (flags & NV_RX_CRCERR)
2654-
dev->stats.rx_crc_errors++;
2655-
if (flags & NV_RX_OVERFLOW)
2656-
dev->stats.rx_over_errors++;
2657-
dev->stats.rx_errors++;
26582634
dev_kfree_skb(skb);
26592635
goto next_pkt;
26602636
}
@@ -2670,7 +2646,6 @@ static int nv_rx_process(struct net_device *dev, int limit)
26702646
if ((flags & NV_RX2_ERROR_MASK) == NV_RX2_ERROR4) {
26712647
len = nv_getlen(dev, skb->data, len);
26722648
if (len < 0) {
2673-
dev->stats.rx_errors++;
26742649
dev_kfree_skb(skb);
26752650
goto next_pkt;
26762651
}
@@ -2682,11 +2657,6 @@ static int nv_rx_process(struct net_device *dev, int limit)
26822657
}
26832658
/* the rest are hard errors */
26842659
else {
2685-
if (flags & NV_RX2_CRCERR)
2686-
dev->stats.rx_crc_errors++;
2687-
if (flags & NV_RX2_OVERFLOW)
2688-
dev->stats.rx_over_errors++;
2689-
dev->stats.rx_errors++;
26902660
dev_kfree_skb(skb);
26912661
goto next_pkt;
26922662
}
@@ -2704,7 +2674,6 @@ static int nv_rx_process(struct net_device *dev, int limit)
27042674
skb->protocol = eth_type_trans(skb, dev);
27052675
napi_gro_receive(&np->napi, skb);
27062676
dev->stats.rx_packets++;
2707-
dev->stats.rx_bytes += len;
27082677
next_pkt:
27092678
if (unlikely(np->get_rx.orig++ == np->last_rx.orig))
27102679
np->get_rx.orig = np->first_rx.orig;
@@ -2787,9 +2756,7 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
27872756
__vlan_hwaccel_put_tag(skb, vid);
27882757
}
27892758
napi_gro_receive(&np->napi, skb);
2790-
27912759
dev->stats.rx_packets++;
2792-
dev->stats.rx_bytes += len;
27932760
} else {
27942761
dev_kfree_skb(skb);
27952762
}

0 commit comments

Comments
 (0)