Commit 66fee9ed03a4413ea054e437b65af6fd3583b4db
Committed by
David S. Miller
1 parent
520efdf44f
Exists in
master
and in
20 other branches
cnic: Unify IRQ code for all hardware types.
By creating a common cnic_doirq(). Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 20 additions and 13 deletions Side-by-side Diff
drivers/net/cnic.c
... | ... | @@ -2188,6 +2188,9 @@ |
2188 | 2188 | u16 tx_cons = *cp->tx_cons_ptr; |
2189 | 2189 | int comp = 0; |
2190 | 2190 | |
2191 | + if (!test_bit(CNIC_F_CNIC_UP, &cp->dev->flags)) | |
2192 | + return; | |
2193 | + | |
2191 | 2194 | if (cp->tx_cons != tx_cons || cp->rx_cons != rx_cons) { |
2192 | 2195 | if (test_bit(CNIC_LCL_FL_L2_WAIT, &cp->cnic_local_flags)) |
2193 | 2196 | comp = cnic_l2_completion(cp); |
2194 | 2197 | |
2195 | 2198 | |
2196 | 2199 | |
... | ... | @@ -2284,21 +2287,29 @@ |
2284 | 2287 | BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | cp->last_status_idx); |
2285 | 2288 | } |
2286 | 2289 | |
2290 | +static void cnic_doirq(struct cnic_dev *dev) | |
2291 | +{ | |
2292 | + struct cnic_local *cp = dev->cnic_priv; | |
2293 | + u16 prod = cp->kcq_prod_idx & MAX_KCQ_IDX; | |
2294 | + | |
2295 | + if (likely(test_bit(CNIC_F_CNIC_UP, &dev->flags))) { | |
2296 | + prefetch(cp->status_blk.gen); | |
2297 | + prefetch(&cp->kcq[KCQ_PG(prod)][KCQ_IDX(prod)]); | |
2298 | + | |
2299 | + tasklet_schedule(&cp->cnic_irq_task); | |
2300 | + } | |
2301 | +} | |
2302 | + | |
2287 | 2303 | static irqreturn_t cnic_irq(int irq, void *dev_instance) |
2288 | 2304 | { |
2289 | 2305 | struct cnic_dev *dev = dev_instance; |
2290 | 2306 | struct cnic_local *cp = dev->cnic_priv; |
2291 | - u16 prod = cp->kcq_prod_idx & MAX_KCQ_IDX; | |
2292 | 2307 | |
2293 | 2308 | if (cp->ack_int) |
2294 | 2309 | cp->ack_int(dev); |
2295 | 2310 | |
2296 | - prefetch(cp->status_blk.gen); | |
2297 | - prefetch(&cp->kcq[KCQ_PG(prod)][KCQ_IDX(prod)]); | |
2311 | + cnic_doirq(dev); | |
2298 | 2312 | |
2299 | - if (likely(test_bit(CNIC_F_CNIC_UP, &dev->flags))) | |
2300 | - tasklet_schedule(&cp->cnic_irq_task); | |
2301 | - | |
2302 | 2313 | return IRQ_HANDLED; |
2303 | 2314 | } |
2304 | 2315 | |
2305 | 2316 | |
2306 | 2317 | |
... | ... | @@ -2373,15 +2384,11 @@ |
2373 | 2384 | { |
2374 | 2385 | struct cnic_dev *dev = data; |
2375 | 2386 | struct cnic_local *cp = dev->cnic_priv; |
2376 | - u16 prod = cp->kcq_prod_idx & MAX_KCQ_IDX; | |
2377 | 2387 | |
2378 | - if (likely(test_bit(CNIC_F_CNIC_UP, &dev->flags))) { | |
2379 | - prefetch(cp->status_blk.bnx2x); | |
2380 | - prefetch(&cp->kcq[KCQ_PG(prod)][KCQ_IDX(prod)]); | |
2388 | + if (!(cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX)) | |
2389 | + cnic_doirq(dev); | |
2381 | 2390 | |
2382 | - tasklet_schedule(&cp->cnic_irq_task); | |
2383 | - cnic_chk_pkt_rings(cp); | |
2384 | - } | |
2391 | + cnic_chk_pkt_rings(cp); | |
2385 | 2392 | |
2386 | 2393 | return 0; |
2387 | 2394 | } |