aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip/interrupt.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-09-02 23:52:43 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-03 12:44:51 -0400
commit1a18abaa87c4c68a13c2ffcace39a078605b980a (patch)
tree3ac7ed4d7ef48ae8d3095f60272eb5681596d982 /drivers/net/tulip/interrupt.c
parentae8abfa00efb8ec550f772cbd1e1854977d06212 (diff)
tulip: use integrated netdev stats
struct tulip_private is a bit large (order-1 allocation even on 32bit arch), try to shrink it, remove its net_device_stats field. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tulip/interrupt.c')
-rw-r--r--drivers/net/tulip/interrupt.c77
1 files changed, 44 insertions, 33 deletions
diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c
index 1faf7a4d7202..0013642903ee 100644
--- a/drivers/net/tulip/interrupt.c
+++ b/drivers/net/tulip/interrupt.c
@@ -180,21 +180,24 @@ int tulip_poll(struct napi_struct *napi, int budget)
180 dev_warn(&dev->dev, 180 dev_warn(&dev->dev,
181 "Oversized Ethernet frame spanned multiple buffers, status %08x!\n", 181 "Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
182 status); 182 status);
183 tp->stats.rx_length_errors++; 183 dev->stats.rx_length_errors++;
184 } 184 }
185 } else { 185 } else {
186 /* There was a fatal error. */ 186 /* There was a fatal error. */
187 if (tulip_debug > 2) 187 if (tulip_debug > 2)
188 printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n", 188 printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n",
189 dev->name, status); 189 dev->name, status);
190 tp->stats.rx_errors++; /* end of a packet.*/ 190 dev->stats.rx_errors++; /* end of a packet.*/
191 if (pkt_len > 1518 || 191 if (pkt_len > 1518 ||
192 (status & RxDescRunt)) 192 (status & RxDescRunt))
193 tp->stats.rx_length_errors++; 193 dev->stats.rx_length_errors++;
194 194
195 if (status & 0x0004) tp->stats.rx_frame_errors++; 195 if (status & 0x0004)
196 if (status & 0x0002) tp->stats.rx_crc_errors++; 196 dev->stats.rx_frame_errors++;
197 if (status & 0x0001) tp->stats.rx_fifo_errors++; 197 if (status & 0x0002)
198 dev->stats.rx_crc_errors++;
199 if (status & 0x0001)
200 dev->stats.rx_fifo_errors++;
198 } 201 }
199 } else { 202 } else {
200 struct sk_buff *skb; 203 struct sk_buff *skb;
@@ -244,8 +247,8 @@ int tulip_poll(struct napi_struct *napi, int budget)
244 247
245 netif_receive_skb(skb); 248 netif_receive_skb(skb);
246 249
247 tp->stats.rx_packets++; 250 dev->stats.rx_packets++;
248 tp->stats.rx_bytes += pkt_len; 251 dev->stats.rx_bytes += pkt_len;
249 } 252 }
250#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION 253#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION
251 received++; 254 received++;
@@ -404,20 +407,23 @@ static int tulip_rx(struct net_device *dev)
404 dev_warn(&dev->dev, 407 dev_warn(&dev->dev,
405 "Oversized Ethernet frame spanned multiple buffers, status %08x!\n", 408 "Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
406 status); 409 status);
407 tp->stats.rx_length_errors++; 410 dev->stats.rx_length_errors++;
408 } 411 }
409 } else { 412 } else {
410 /* There was a fatal error. */ 413 /* There was a fatal error. */
411 if (tulip_debug > 2) 414 if (tulip_debug > 2)
412 printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n", 415 printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n",
413 dev->name, status); 416 dev->name, status);
414 tp->stats.rx_errors++; /* end of a packet.*/ 417 dev->stats.rx_errors++; /* end of a packet.*/
415 if (pkt_len > 1518 || 418 if (pkt_len > 1518 ||
416 (status & RxDescRunt)) 419 (status & RxDescRunt))
417 tp->stats.rx_length_errors++; 420 dev->stats.rx_length_errors++;
418 if (status & 0x0004) tp->stats.rx_frame_errors++; 421 if (status & 0x0004)
419 if (status & 0x0002) tp->stats.rx_crc_errors++; 422 dev->stats.rx_frame_errors++;
420 if (status & 0x0001) tp->stats.rx_fifo_errors++; 423 if (status & 0x0002)
424 dev->stats.rx_crc_errors++;
425 if (status & 0x0001)
426 dev->stats.rx_fifo_errors++;
421 } 427 }
422 } else { 428 } else {
423 struct sk_buff *skb; 429 struct sk_buff *skb;
@@ -467,8 +473,8 @@ static int tulip_rx(struct net_device *dev)
467 473
468 netif_rx(skb); 474 netif_rx(skb);
469 475
470 tp->stats.rx_packets++; 476 dev->stats.rx_packets++;
471 tp->stats.rx_bytes += pkt_len; 477 dev->stats.rx_bytes += pkt_len;
472 } 478 }
473 received++; 479 received++;
474 entry = (++tp->cur_rx) % RX_RING_SIZE; 480 entry = (++tp->cur_rx) % RX_RING_SIZE;
@@ -602,18 +608,22 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
602 printk(KERN_DEBUG "%s: Transmit error, Tx status %08x\n", 608 printk(KERN_DEBUG "%s: Transmit error, Tx status %08x\n",
603 dev->name, status); 609 dev->name, status);
604#endif 610#endif
605 tp->stats.tx_errors++; 611 dev->stats.tx_errors++;
606 if (status & 0x4104) tp->stats.tx_aborted_errors++; 612 if (status & 0x4104)
607 if (status & 0x0C00) tp->stats.tx_carrier_errors++; 613 dev->stats.tx_aborted_errors++;
608 if (status & 0x0200) tp->stats.tx_window_errors++; 614 if (status & 0x0C00)
609 if (status & 0x0002) tp->stats.tx_fifo_errors++; 615 dev->stats.tx_carrier_errors++;
616 if (status & 0x0200)
617 dev->stats.tx_window_errors++;
618 if (status & 0x0002)
619 dev->stats.tx_fifo_errors++;
610 if ((status & 0x0080) && tp->full_duplex == 0) 620 if ((status & 0x0080) && tp->full_duplex == 0)
611 tp->stats.tx_heartbeat_errors++; 621 dev->stats.tx_heartbeat_errors++;
612 } else { 622 } else {
613 tp->stats.tx_bytes += 623 dev->stats.tx_bytes +=
614 tp->tx_buffers[entry].skb->len; 624 tp->tx_buffers[entry].skb->len;
615 tp->stats.collisions += (status >> 3) & 15; 625 dev->stats.collisions += (status >> 3) & 15;
616 tp->stats.tx_packets++; 626 dev->stats.tx_packets++;
617 } 627 }
618 628
619 pci_unmap_single(tp->pdev, tp->tx_buffers[entry].mapping, 629 pci_unmap_single(tp->pdev, tp->tx_buffers[entry].mapping,
@@ -655,7 +665,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
655 if (csr5 & AbnormalIntr) { /* Abnormal error summary bit. */ 665 if (csr5 & AbnormalIntr) { /* Abnormal error summary bit. */
656 if (csr5 == 0xffffffff) 666 if (csr5 == 0xffffffff)
657 break; 667 break;
658 if (csr5 & TxJabber) tp->stats.tx_errors++; 668 if (csr5 & TxJabber)
669 dev->stats.tx_errors++;
659 if (csr5 & TxFIFOUnderflow) { 670 if (csr5 & TxFIFOUnderflow) {
660 if ((tp->csr6 & 0xC000) != 0xC000) 671 if ((tp->csr6 & 0xC000) != 0xC000)
661 tp->csr6 += 0x4000; /* Bump up the Tx threshold */ 672 tp->csr6 += 0x4000; /* Bump up the Tx threshold */
@@ -672,8 +683,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
672 } 683 }
673 } 684 }
674 if (csr5 & RxDied) { /* Missed a Rx frame. */ 685 if (csr5 & RxDied) { /* Missed a Rx frame. */
675 tp->stats.rx_missed_errors += ioread32(ioaddr + CSR8) & 0xffff; 686 dev->stats.rx_missed_errors += ioread32(ioaddr + CSR8) & 0xffff;
676 tp->stats.rx_errors++; 687 dev->stats.rx_errors++;
677 tulip_start_rxtx(tp); 688 tulip_start_rxtx(tp);
678 } 689 }
679 /* 690 /*
@@ -789,7 +800,7 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
789#endif /* CONFIG_TULIP_NAPI */ 800#endif /* CONFIG_TULIP_NAPI */
790 801
791 if ((missed = ioread32(ioaddr + CSR8) & 0x1ffff)) { 802 if ((missed = ioread32(ioaddr + CSR8) & 0x1ffff)) {
792 tp->stats.rx_dropped += missed & 0x10000 ? 0x10000 : missed; 803 dev->stats.rx_dropped += missed & 0x10000 ? 0x10000 : missed;
793 } 804 }
794 805
795 if (tulip_debug > 4) 806 if (tulip_debug > 4)