Skip to content

Commit d4476b8

Browse files
Denis Bolotindavem330
authored andcommitted
qed: Fix missing DORQ attentions
When the DORQ (doorbell block) is overflowed, all PFs get attentions at the same time. If one PF finished handling the attention before another PF even started, the second PF might miss the DORQ's attention bit and not handle the attention at all. If the DORQ attention is missed and the issue is not resolved, another attention will not be sent, therefore each attention is treated as a potential DORQ attention. As a result, the attention callback is called more frequently so the debug print was moved to reduce its quantity. The number of periodic doorbell recovery handler schedules was reduced because it was the previous way to mitigating the missed attention issue. Signed-off-by: Denis Bolotin <[email protected]> Signed-off-by: Michal Kalderon <[email protected]> Signed-off-by: Ariel Elior <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b61b04a commit d4476b8

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

drivers/net/ethernet/qlogic/qed/qed.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ struct qed_db_recovery_info {
436436

437437
/* Lock to protect the doorbell recovery mechanism list */
438438
spinlock_t lock;
439+
bool dorq_attn;
439440
u32 db_recovery_counter;
440441
};
441442

drivers/net/ethernet/qlogic/qed/qed_int.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,17 +438,19 @@ static int qed_dorq_attn_cb(struct qed_hwfn *p_hwfn)
438438
struct qed_ptt *p_ptt = p_hwfn->p_dpc_ptt;
439439
int rc;
440440

441-
int_sts = qed_rd(p_hwfn, p_ptt, DORQ_REG_INT_STS);
442-
DP_NOTICE(p_hwfn->cdev, "DORQ attention. int_sts was %x\n", int_sts);
441+
p_hwfn->db_recovery_info.dorq_attn = true;
443442

444443
/* int_sts may be zero since all PFs were interrupted for doorbell
445444
* overflow but another one already handled it. Can abort here. If
446445
* This PF also requires overflow recovery we will be interrupted again.
447446
* The masked almost full indication may also be set. Ignoring.
448447
*/
448+
int_sts = qed_rd(p_hwfn, p_ptt, DORQ_REG_INT_STS);
449449
if (!(int_sts & ~DORQ_REG_INT_STS_DORQ_FIFO_AFULL))
450450
return 0;
451451

452+
DP_NOTICE(p_hwfn->cdev, "DORQ attention. int_sts was %x\n", int_sts);
453+
452454
/* check if db_drop or overflow happened */
453455
if (int_sts & (DORQ_REG_INT_STS_DB_DROP |
454456
DORQ_REG_INT_STS_DORQ_FIFO_OVFL_ERR)) {
@@ -505,6 +507,17 @@ static int qed_dorq_attn_cb(struct qed_hwfn *p_hwfn)
505507
return -EINVAL;
506508
}
507509

510+
static void qed_dorq_attn_handler(struct qed_hwfn *p_hwfn)
511+
{
512+
if (p_hwfn->db_recovery_info.dorq_attn)
513+
goto out;
514+
515+
/* Call DORQ callback if the attention was missed */
516+
qed_dorq_attn_cb(p_hwfn);
517+
out:
518+
p_hwfn->db_recovery_info.dorq_attn = false;
519+
}
520+
508521
/* Instead of major changes to the data-structure, we have a some 'special'
509522
* identifiers for sources that changed meaning between adapters.
510523
*/
@@ -1078,6 +1091,9 @@ static int qed_int_deassertion(struct qed_hwfn *p_hwfn,
10781091
}
10791092
}
10801093

1094+
/* Handle missed DORQ attention */
1095+
qed_dorq_attn_handler(p_hwfn);
1096+
10811097
/* Clear IGU indication for the deasserted bits */
10821098
DIRECT_REG_WR((u8 __iomem *)p_hwfn->regview +
10831099
GTT_BAR0_MAP_REG_IGU_CMD +

drivers/net/ethernet/qlogic/qed/qed_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ static void qed_update_pf_params(struct qed_dev *cdev,
970970
}
971971
}
972972

973-
#define QED_PERIODIC_DB_REC_COUNT 100
973+
#define QED_PERIODIC_DB_REC_COUNT 10
974974
#define QED_PERIODIC_DB_REC_INTERVAL_MS 100
975975
#define QED_PERIODIC_DB_REC_INTERVAL \
976976
msecs_to_jiffies(QED_PERIODIC_DB_REC_INTERVAL_MS)

0 commit comments

Comments
 (0)