Commit 66fee9ed authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

cnic: Unify IRQ code for all hardware types.

By creating a common cnic_doirq().
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 520efdf4
...@@ -2188,6 +2188,9 @@ static void cnic_chk_pkt_rings(struct cnic_local *cp) ...@@ -2188,6 +2188,9 @@ static void cnic_chk_pkt_rings(struct cnic_local *cp)
u16 tx_cons = *cp->tx_cons_ptr; u16 tx_cons = *cp->tx_cons_ptr;
int comp = 0; int comp = 0;
if (!test_bit(CNIC_F_CNIC_UP, &cp->dev->flags))
return;
if (cp->tx_cons != tx_cons || cp->rx_cons != rx_cons) { if (cp->tx_cons != tx_cons || cp->rx_cons != rx_cons) {
if (test_bit(CNIC_LCL_FL_L2_WAIT, &cp->cnic_local_flags)) if (test_bit(CNIC_LCL_FL_L2_WAIT, &cp->cnic_local_flags))
comp = cnic_l2_completion(cp); comp = cnic_l2_completion(cp);
...@@ -2284,20 +2287,28 @@ static void cnic_service_bnx2_msix(unsigned long data) ...@@ -2284,20 +2287,28 @@ static void cnic_service_bnx2_msix(unsigned long data)
BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | cp->last_status_idx); BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | cp->last_status_idx);
} }
static void cnic_doirq(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
u16 prod = cp->kcq_prod_idx & MAX_KCQ_IDX;
if (likely(test_bit(CNIC_F_CNIC_UP, &dev->flags))) {
prefetch(cp->status_blk.gen);
prefetch(&cp->kcq[KCQ_PG(prod)][KCQ_IDX(prod)]);
tasklet_schedule(&cp->cnic_irq_task);
}
}
static irqreturn_t cnic_irq(int irq, void *dev_instance) static irqreturn_t cnic_irq(int irq, void *dev_instance)
{ {
struct cnic_dev *dev = dev_instance; struct cnic_dev *dev = dev_instance;
struct cnic_local *cp = dev->cnic_priv; struct cnic_local *cp = dev->cnic_priv;
u16 prod = cp->kcq_prod_idx & MAX_KCQ_IDX;
if (cp->ack_int) if (cp->ack_int)
cp->ack_int(dev); cp->ack_int(dev);
prefetch(cp->status_blk.gen); cnic_doirq(dev);
prefetch(&cp->kcq[KCQ_PG(prod)][KCQ_IDX(prod)]);
if (likely(test_bit(CNIC_F_CNIC_UP, &dev->flags)))
tasklet_schedule(&cp->cnic_irq_task);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -2373,15 +2384,11 @@ static int cnic_service_bnx2x(void *data, void *status_blk) ...@@ -2373,15 +2384,11 @@ static int cnic_service_bnx2x(void *data, void *status_blk)
{ {
struct cnic_dev *dev = data; struct cnic_dev *dev = data;
struct cnic_local *cp = dev->cnic_priv; struct cnic_local *cp = dev->cnic_priv;
u16 prod = cp->kcq_prod_idx & MAX_KCQ_IDX;
if (likely(test_bit(CNIC_F_CNIC_UP, &dev->flags))) { if (!(cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX))
prefetch(cp->status_blk.bnx2x); cnic_doirq(dev);
prefetch(&cp->kcq[KCQ_PG(prod)][KCQ_IDX(prod)]);
tasklet_schedule(&cp->cnic_irq_task); cnic_chk_pkt_rings(cp);
cnic_chk_pkt_rings(cp);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment