Skip to content

Commit 0197b08

Browse files
Michael Chandavem330
authored andcommitted
cnic: Fix lost interrupt on bnx2x
We service 2 queues (kcq1 and kcq2) in cnic_service_bnx2x_bh(). If the status block index has changed when servicing the kcq2, we must go back and check kcq1. The latest status block index will be used to acknowledge the interrupt, and without looping back to check kcq1, we may miss events on kcq1. Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 107c3f4 commit 0197b08

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

drivers/net/cnic.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2914,26 +2914,35 @@ static void cnic_service_bnx2x_bh(unsigned long data)
29142914
{
29152915
struct cnic_dev *dev = (struct cnic_dev *) data;
29162916
struct cnic_local *cp = dev->cnic_priv;
2917-
u32 status_idx;
2917+
u32 status_idx, new_status_idx;
29182918

29192919
if (unlikely(!test_bit(CNIC_F_CNIC_UP, &dev->flags)))
29202920
return;
29212921

2922-
status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq1);
2922+
while (1) {
2923+
status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq1);
29232924

2924-
CNIC_WR16(dev, cp->kcq1.io_addr, cp->kcq1.sw_prod_idx + MAX_KCQ_IDX);
2925+
CNIC_WR16(dev, cp->kcq1.io_addr,
2926+
cp->kcq1.sw_prod_idx + MAX_KCQ_IDX);
29252927

2926-
if (BNX2X_CHIP_IS_E2(cp->chip_id)) {
2927-
status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq2);
2928+
if (!BNX2X_CHIP_IS_E2(cp->chip_id)) {
2929+
cnic_ack_bnx2x_int(dev, cp->bnx2x_igu_sb_id, USTORM_ID,
2930+
status_idx, IGU_INT_ENABLE, 1);
2931+
break;
2932+
}
2933+
2934+
new_status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq2);
2935+
2936+
if (new_status_idx != status_idx)
2937+
continue;
29282938

29292939
CNIC_WR16(dev, cp->kcq2.io_addr, cp->kcq2.sw_prod_idx +
29302940
MAX_KCQ_IDX);
29312941

29322942
cnic_ack_igu_sb(dev, cp->bnx2x_igu_sb_id, IGU_SEG_ACCESS_DEF,
29332943
status_idx, IGU_INT_ENABLE, 1);
2934-
} else {
2935-
cnic_ack_bnx2x_int(dev, cp->bnx2x_igu_sb_id, USTORM_ID,
2936-
status_idx, IGU_INT_ENABLE, 1);
2944+
2945+
break;
29372946
}
29382947
}
29392948

0 commit comments

Comments
 (0)