diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-02-06 18:19:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-07 05:43:08 -0500 |
commit | dda0e0834c839c0e4b1717cbe9c22c35ca935809 (patch) | |
tree | 55be9a788e8b9815fe4fb40871cda0883c596431 /drivers/net/igb | |
parent | 2753f4cebf034a53f87b24679f394854275dcacb (diff) |
igb: add counter for dma out of sync errors
Add a counter for dma out of sync errors reported via interrupt.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r-- | drivers/net/igb/e1000_defines.h | 6 | ||||
-rw-r--r-- | drivers/net/igb/e1000_hw.h | 1 | ||||
-rw-r--r-- | drivers/net/igb/igb_ethtool.c | 1 | ||||
-rw-r--r-- | drivers/net/igb/igb_main.c | 19 |
4 files changed, 24 insertions, 3 deletions
diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h index 54a148923386..bff62dd84312 100644 --- a/drivers/net/igb/e1000_defines.h +++ b/drivers/net/igb/e1000_defines.h | |||
@@ -413,6 +413,7 @@ | |||
413 | /* LAN connected device generates an interrupt */ | 413 | /* LAN connected device generates an interrupt */ |
414 | #define E1000_ICR_PHYINT 0x00001000 | 414 | #define E1000_ICR_PHYINT 0x00001000 |
415 | #define E1000_ICR_EPRST 0x00100000 /* ME handware reset occurs */ | 415 | #define E1000_ICR_EPRST 0x00100000 /* ME handware reset occurs */ |
416 | #define E1000_ICR_DOUTSYNC 0x10000000 /* NIC DMA out of sync */ | ||
416 | 417 | ||
417 | /* Extended Interrupt Cause Read */ | 418 | /* Extended Interrupt Cause Read */ |
418 | #define E1000_EICR_RX_QUEUE0 0x00000001 /* Rx Queue 0 Interrupt */ | 419 | #define E1000_EICR_RX_QUEUE0 0x00000001 /* Rx Queue 0 Interrupt */ |
@@ -441,7 +442,8 @@ | |||
441 | E1000_IMS_TXDW | \ | 442 | E1000_IMS_TXDW | \ |
442 | E1000_IMS_RXDMT0 | \ | 443 | E1000_IMS_RXDMT0 | \ |
443 | E1000_IMS_RXSEQ | \ | 444 | E1000_IMS_RXSEQ | \ |
444 | E1000_IMS_LSC) | 445 | E1000_IMS_LSC | \ |
446 | E1000_IMS_DOUTSYNC) | ||
445 | 447 | ||
446 | /* Interrupt Mask Set */ | 448 | /* Interrupt Mask Set */ |
447 | #define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ | 449 | #define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ |
@@ -449,6 +451,7 @@ | |||
449 | #define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */ | 451 | #define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */ |
450 | #define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ | 452 | #define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ |
451 | #define E1000_IMS_RXT0 E1000_ICR_RXT0 /* rx timer intr */ | 453 | #define E1000_IMS_RXT0 E1000_ICR_RXT0 /* rx timer intr */ |
454 | #define E1000_IMS_DOUTSYNC E1000_ICR_DOUTSYNC /* NIC DMA out of sync */ | ||
452 | 455 | ||
453 | /* Extended Interrupt Mask Set */ | 456 | /* Extended Interrupt Mask Set */ |
454 | #define E1000_EIMS_TCP_TIMER E1000_EICR_TCP_TIMER /* TCP Timer */ | 457 | #define E1000_EIMS_TCP_TIMER E1000_EICR_TCP_TIMER /* TCP Timer */ |
@@ -457,6 +460,7 @@ | |||
457 | /* Interrupt Cause Set */ | 460 | /* Interrupt Cause Set */ |
458 | #define E1000_ICS_LSC E1000_ICR_LSC /* Link Status Change */ | 461 | #define E1000_ICS_LSC E1000_ICR_LSC /* Link Status Change */ |
459 | #define E1000_ICS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ | 462 | #define E1000_ICS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ |
463 | #define E1000_ICS_DOUTSYNC E1000_ICR_DOUTSYNC /* NIC DMA out of sync */ | ||
460 | 464 | ||
461 | /* Extended Interrupt Cause Set */ | 465 | /* Extended Interrupt Cause Set */ |
462 | 466 | ||
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h index acb42a21e95c..62ccd495356e 100644 --- a/drivers/net/igb/e1000_hw.h +++ b/drivers/net/igb/e1000_hw.h | |||
@@ -359,6 +359,7 @@ struct e1000_hw_stats { | |||
359 | u64 lenerrs; | 359 | u64 lenerrs; |
360 | u64 scvpc; | 360 | u64 scvpc; |
361 | u64 hrmpc; | 361 | u64 hrmpc; |
362 | u64 doosync; | ||
362 | }; | 363 | }; |
363 | 364 | ||
364 | struct e1000_phy_stats { | 365 | struct e1000_phy_stats { |
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c index 33c23a117fe6..de09430ce7f5 100644 --- a/drivers/net/igb/igb_ethtool.c +++ b/drivers/net/igb/igb_ethtool.c | |||
@@ -88,6 +88,7 @@ static const struct igb_stats igb_gstrings_stats[] = { | |||
88 | { "rx_long_byte_count", IGB_STAT(stats.gorc) }, | 88 | { "rx_long_byte_count", IGB_STAT(stats.gorc) }, |
89 | { "rx_csum_offload_good", IGB_STAT(hw_csum_good) }, | 89 | { "rx_csum_offload_good", IGB_STAT(hw_csum_good) }, |
90 | { "rx_csum_offload_errors", IGB_STAT(hw_csum_err) }, | 90 | { "rx_csum_offload_errors", IGB_STAT(hw_csum_err) }, |
91 | { "tx_dma_out_of_sync", IGB_STAT(stats.doosync) }, | ||
91 | { "alloc_rx_buff_failed", IGB_STAT(alloc_rx_buff_failed) }, | 92 | { "alloc_rx_buff_failed", IGB_STAT(alloc_rx_buff_failed) }, |
92 | { "tx_smbus", IGB_STAT(stats.mgptc) }, | 93 | { "tx_smbus", IGB_STAT(stats.mgptc) }, |
93 | { "rx_smbus", IGB_STAT(stats.mgprc) }, | 94 | { "rx_smbus", IGB_STAT(stats.mgprc) }, |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 8c27e0a23dff..c05ca3461f60 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -689,7 +689,7 @@ static void igb_irq_enable(struct igb_adapter *adapter) | |||
689 | wr32(E1000_EIAC, adapter->eims_enable_mask); | 689 | wr32(E1000_EIAC, adapter->eims_enable_mask); |
690 | wr32(E1000_EIAM, adapter->eims_enable_mask); | 690 | wr32(E1000_EIAM, adapter->eims_enable_mask); |
691 | wr32(E1000_EIMS, adapter->eims_enable_mask); | 691 | wr32(E1000_EIMS, adapter->eims_enable_mask); |
692 | wr32(E1000_IMS, E1000_IMS_LSC); | 692 | wr32(E1000_IMS, E1000_IMS_LSC | E1000_IMS_DOUTSYNC); |
693 | } else { | 693 | } else { |
694 | wr32(E1000_IMS, IMS_ENABLE_MASK); | 694 | wr32(E1000_IMS, IMS_ENABLE_MASK); |
695 | wr32(E1000_IAM, IMS_ENABLE_MASK); | 695 | wr32(E1000_IAM, IMS_ENABLE_MASK); |
@@ -3287,6 +3287,11 @@ static irqreturn_t igb_msix_other(int irq, void *data) | |||
3287 | u32 icr = rd32(E1000_ICR); | 3287 | u32 icr = rd32(E1000_ICR); |
3288 | 3288 | ||
3289 | /* reading ICR causes bit 31 of EICR to be cleared */ | 3289 | /* reading ICR causes bit 31 of EICR to be cleared */ |
3290 | |||
3291 | if(icr & E1000_ICR_DOUTSYNC) { | ||
3292 | /* HW is reporting DMA is out of sync */ | ||
3293 | adapter->stats.doosync++; | ||
3294 | } | ||
3290 | if (!(icr & E1000_ICR_LSC)) | 3295 | if (!(icr & E1000_ICR_LSC)) |
3291 | goto no_link_interrupt; | 3296 | goto no_link_interrupt; |
3292 | hw->mac.get_link_status = 1; | 3297 | hw->mac.get_link_status = 1; |
@@ -3295,7 +3300,7 @@ static irqreturn_t igb_msix_other(int irq, void *data) | |||
3295 | mod_timer(&adapter->watchdog_timer, jiffies + 1); | 3300 | mod_timer(&adapter->watchdog_timer, jiffies + 1); |
3296 | 3301 | ||
3297 | no_link_interrupt: | 3302 | no_link_interrupt: |
3298 | wr32(E1000_IMS, E1000_IMS_LSC); | 3303 | wr32(E1000_IMS, E1000_IMS_LSC | E1000_IMS_DOUTSYNC); |
3299 | wr32(E1000_EIMS, adapter->eims_other); | 3304 | wr32(E1000_EIMS, adapter->eims_other); |
3300 | 3305 | ||
3301 | return IRQ_HANDLED; | 3306 | return IRQ_HANDLED; |
@@ -3499,6 +3504,11 @@ static irqreturn_t igb_intr_msi(int irq, void *data) | |||
3499 | 3504 | ||
3500 | igb_write_itr(adapter->rx_ring); | 3505 | igb_write_itr(adapter->rx_ring); |
3501 | 3506 | ||
3507 | if(icr & E1000_ICR_DOUTSYNC) { | ||
3508 | /* HW is reporting DMA is out of sync */ | ||
3509 | adapter->stats.doosync++; | ||
3510 | } | ||
3511 | |||
3502 | if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { | 3512 | if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { |
3503 | hw->mac.get_link_status = 1; | 3513 | hw->mac.get_link_status = 1; |
3504 | if (!test_bit(__IGB_DOWN, &adapter->state)) | 3514 | if (!test_bit(__IGB_DOWN, &adapter->state)) |
@@ -3534,6 +3544,11 @@ static irqreturn_t igb_intr(int irq, void *data) | |||
3534 | if (!(icr & E1000_ICR_INT_ASSERTED)) | 3544 | if (!(icr & E1000_ICR_INT_ASSERTED)) |
3535 | return IRQ_NONE; | 3545 | return IRQ_NONE; |
3536 | 3546 | ||
3547 | if(icr & E1000_ICR_DOUTSYNC) { | ||
3548 | /* HW is reporting DMA is out of sync */ | ||
3549 | adapter->stats.doosync++; | ||
3550 | } | ||
3551 | |||
3537 | eicr = rd32(E1000_EICR); | 3552 | eicr = rd32(E1000_EICR); |
3538 | 3553 | ||
3539 | if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { | 3554 | if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { |