Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 348633
b: refs/heads/master
c: d0b9cec
h: refs/heads/master
i:
  348631: 9097cb7
v: v3
  • Loading branch information
Sathya Perla authored and David S. Miller committed Jan 12, 2013
1 parent 009e3cb commit 053f288
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 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: dd38bd853082355641d0034aaf368e13ef2438f8
refs/heads/master: d0b9cec3e27d0e9fda2fbf6aaacece68c99b1104
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/emulex/benet/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ struct be_eq_obj {

u8 idx; /* array index */
u16 tx_budget;
u16 spurious_intr;
struct napi_struct napi;
struct be_adapter *adapter;
} ____cacheline_aligned_in_smp;
Expand Down
29 changes: 20 additions & 9 deletions trunk/drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2026,19 +2026,30 @@ static irqreturn_t be_intx(int irq, void *dev)
struct be_adapter *adapter = eqo->adapter;
int num_evts = 0;

/* On Lancer, clear-intr bit of the EQ DB does not work.
* INTx is de-asserted only on notifying num evts.
/* IRQ is not expected when NAPI is scheduled as the EQ
* will not be armed.
* But, this can happen on Lancer INTx where it takes
* a while to de-assert INTx or in BE2 where occasionaly
* an interrupt may be raised even when EQ is unarmed.
* If NAPI is already scheduled, then counting & notifying
* events will orphan them.
*/
if (lancer_chip(adapter))
if (napi_schedule_prep(&eqo->napi)) {
num_evts = events_get(eqo);
__napi_schedule(&eqo->napi);
if (num_evts)
eqo->spurious_intr = 0;
}
be_eq_notify(adapter, eqo->q.id, false, true, num_evts);

/* The EQ-notify may not de-assert INTx rightaway, causing
* the ISR to be invoked again. So, return HANDLED even when
* num_evts is zero.
/* Return IRQ_HANDLED only for the the first spurious intr
* after a valid intr to stop the kernel from branding
* this irq as a bad one!
*/
be_eq_notify(adapter, eqo->q.id, false, true, num_evts);
napi_schedule(&eqo->napi);
return IRQ_HANDLED;
if (num_evts || eqo->spurious_intr++ == 0)
return IRQ_HANDLED;
else
return IRQ_NONE;
}

static irqreturn_t be_msix(int irq, void *dev)
Expand Down

0 comments on commit 053f288

Please sign in to comment.