Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135057
b: refs/heads/master
c: 2c3c3d0
h: refs/heads/master
i:
  135055: 394169f
v: v3
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Mar 5, 2009
1 parent 27371f5 commit 60bb944
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 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: 4720bc6cfe70b606cf62a244c7a5391e59923e45
refs/heads/master: 2c3c3d02f28801d7ad2da4952b2c7ca6621ef221
23 changes: 19 additions & 4 deletions trunk/drivers/net/sfc/falcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@
* @next_buffer_table: First available buffer table id
* @pci_dev2: The secondary PCI device if present
* @i2c_data: Operations and state for I2C bit-bashing algorithm
* @int_error_count: Number of internal errors seen recently
* @int_error_expire: Time at which error count will be expired
*/
struct falcon_nic_data {
unsigned next_buffer_table;
struct pci_dev *pci_dev2;
struct i2c_algo_bit_data i2c_data;

unsigned int_error_count;
unsigned long int_error_expire;
};

/**************************************************************************
Expand Down Expand Up @@ -119,8 +124,12 @@ MODULE_PARM_DESC(rx_xon_thresh_bytes, "RX fifo XON threshold");
#define FALCON_EVQ_SIZE 4096
#define FALCON_EVQ_MASK (FALCON_EVQ_SIZE - 1)

/* Max number of internal errors. After this resets will not be performed */
#define FALCON_MAX_INT_ERRORS 4
/* If FALCON_MAX_INT_ERRORS internal errors occur within
* FALCON_INT_ERROR_EXPIRE seconds, we consider the NIC broken and
* disable it.
*/
#define FALCON_INT_ERROR_EXPIRE 3600
#define FALCON_MAX_INT_ERRORS 5

/* We poll for events every FLUSH_INTERVAL ms, and check FLUSH_POLL_COUNT times
*/
Expand Down Expand Up @@ -1374,7 +1383,6 @@ static irqreturn_t falcon_fatal_interrupt(struct efx_nic *efx)
efx_oword_t *int_ker = efx->irq_status.addr;
efx_oword_t fatal_intr;
int error, mem_perr;
static int n_int_errors;

falcon_read(efx, &fatal_intr, FATAL_INTR_REG_KER);
error = EFX_OWORD_FIELD(fatal_intr, INT_KER_ERROR);
Expand All @@ -1401,7 +1409,14 @@ static irqreturn_t falcon_fatal_interrupt(struct efx_nic *efx)
pci_clear_master(nic_data->pci_dev2);
falcon_disable_interrupts(efx);

if (++n_int_errors < FALCON_MAX_INT_ERRORS) {
/* Count errors and reset or disable the NIC accordingly */
if (nic_data->int_error_count == 0 ||
time_after(jiffies, nic_data->int_error_expire)) {
nic_data->int_error_count = 0;
nic_data->int_error_expire =
jiffies + FALCON_INT_ERROR_EXPIRE * HZ;
}
if (++nic_data->int_error_count < FALCON_MAX_INT_ERRORS) {
EFX_ERR(efx, "SYSTEM ERROR - reset scheduled\n");
efx_schedule_reset(efx, RESET_TYPE_INT_ERROR);
} else {
Expand Down

0 comments on commit 60bb944

Please sign in to comment.