Skip to content

Commit 9ac6bb1

Browse files
Denis Bolotindavem330
authored andcommitted
qed: Delete redundant doorbell recovery types
DB_REC_DRY_RUN (running doorbell recovery without sending doorbells) is never used. DB_REC_ONCE (send a single doorbell from the doorbell recovery) is not needed anymore because by running the periodic handler we make sure we check the overflow status later instead. This patch is needed because in the next patches, the only doorbell recovery type being used is DB_REC_REAL_DEAL, and the fixes are much cleaner without this enum. 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 c543cb4 commit 9ac6bb1

File tree

4 files changed

+31
-51
lines changed

4 files changed

+31
-51
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,8 +920,7 @@ u16 qed_get_cm_pq_idx_llt_mtc(struct qed_hwfn *p_hwfn, u8 tc);
920920

921921
/* doorbell recovery mechanism */
922922
void qed_db_recovery_dp(struct qed_hwfn *p_hwfn);
923-
void qed_db_recovery_execute(struct qed_hwfn *p_hwfn,
924-
enum qed_db_rec_exec db_exec);
923+
void qed_db_recovery_execute(struct qed_hwfn *p_hwfn);
925924
bool qed_edpm_enabled(struct qed_hwfn *p_hwfn);
926925

927926
/* Other Linux specific common definitions */

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

Lines changed: 26 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -300,26 +300,19 @@ void qed_db_recovery_dp(struct qed_hwfn *p_hwfn)
300300

301301
/* Ring the doorbell of a single doorbell recovery entry */
302302
static void qed_db_recovery_ring(struct qed_hwfn *p_hwfn,
303-
struct qed_db_recovery_entry *db_entry,
304-
enum qed_db_rec_exec db_exec)
305-
{
306-
if (db_exec != DB_REC_ONCE) {
307-
/* Print according to width */
308-
if (db_entry->db_width == DB_REC_WIDTH_32B) {
309-
DP_VERBOSE(p_hwfn, QED_MSG_SPQ,
310-
"%s doorbell address %p data %x\n",
311-
db_exec == DB_REC_DRY_RUN ?
312-
"would have rung" : "ringing",
313-
db_entry->db_addr,
314-
*(u32 *)db_entry->db_data);
315-
} else {
316-
DP_VERBOSE(p_hwfn, QED_MSG_SPQ,
317-
"%s doorbell address %p data %llx\n",
318-
db_exec == DB_REC_DRY_RUN ?
319-
"would have rung" : "ringing",
320-
db_entry->db_addr,
321-
*(u64 *)(db_entry->db_data));
322-
}
303+
struct qed_db_recovery_entry *db_entry)
304+
{
305+
/* Print according to width */
306+
if (db_entry->db_width == DB_REC_WIDTH_32B) {
307+
DP_VERBOSE(p_hwfn, QED_MSG_SPQ,
308+
"ringing doorbell address %p data %x\n",
309+
db_entry->db_addr,
310+
*(u32 *)db_entry->db_data);
311+
} else {
312+
DP_VERBOSE(p_hwfn, QED_MSG_SPQ,
313+
"ringing doorbell address %p data %llx\n",
314+
db_entry->db_addr,
315+
*(u64 *)(db_entry->db_data));
323316
}
324317

325318
/* Sanity */
@@ -334,14 +327,12 @@ static void qed_db_recovery_ring(struct qed_hwfn *p_hwfn,
334327
wmb();
335328

336329
/* Ring the doorbell */
337-
if (db_exec == DB_REC_REAL_DEAL || db_exec == DB_REC_ONCE) {
338-
if (db_entry->db_width == DB_REC_WIDTH_32B)
339-
DIRECT_REG_WR(db_entry->db_addr,
340-
*(u32 *)(db_entry->db_data));
341-
else
342-
DIRECT_REG_WR64(db_entry->db_addr,
343-
*(u64 *)(db_entry->db_data));
344-
}
330+
if (db_entry->db_width == DB_REC_WIDTH_32B)
331+
DIRECT_REG_WR(db_entry->db_addr,
332+
*(u32 *)(db_entry->db_data));
333+
else
334+
DIRECT_REG_WR64(db_entry->db_addr,
335+
*(u64 *)(db_entry->db_data));
345336

346337
/* Flush the write combined buffer. Next doorbell may come from a
347338
* different entity to the same address...
@@ -350,29 +341,21 @@ static void qed_db_recovery_ring(struct qed_hwfn *p_hwfn,
350341
}
351342

352343
/* Traverse the doorbell recovery entry list and ring all the doorbells */
353-
void qed_db_recovery_execute(struct qed_hwfn *p_hwfn,
354-
enum qed_db_rec_exec db_exec)
344+
void qed_db_recovery_execute(struct qed_hwfn *p_hwfn)
355345
{
356346
struct qed_db_recovery_entry *db_entry = NULL;
357347

358-
if (db_exec != DB_REC_ONCE) {
359-
DP_NOTICE(p_hwfn,
360-
"Executing doorbell recovery. Counter was %d\n",
361-
p_hwfn->db_recovery_info.db_recovery_counter);
348+
DP_NOTICE(p_hwfn, "Executing doorbell recovery. Counter was %d\n",
349+
p_hwfn->db_recovery_info.db_recovery_counter);
362350

363-
/* Track amount of times recovery was executed */
364-
p_hwfn->db_recovery_info.db_recovery_counter++;
365-
}
351+
/* Track amount of times recovery was executed */
352+
p_hwfn->db_recovery_info.db_recovery_counter++;
366353

367354
/* Protect the list */
368355
spin_lock_bh(&p_hwfn->db_recovery_info.lock);
369356
list_for_each_entry(db_entry,
370-
&p_hwfn->db_recovery_info.list, list_entry) {
371-
qed_db_recovery_ring(p_hwfn, db_entry, db_exec);
372-
if (db_exec == DB_REC_ONCE)
373-
break;
374-
}
375-
357+
&p_hwfn->db_recovery_info.list, list_entry)
358+
qed_db_recovery_ring(p_hwfn, db_entry);
376359
spin_unlock_bh(&p_hwfn->db_recovery_info.lock);
377360
}
378361

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,8 @@ int qed_db_rec_handler(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
411411

412412
overflow = qed_rd(p_hwfn, p_ptt, DORQ_REG_PF_OVFL_STICKY);
413413
DP_NOTICE(p_hwfn, "PF Overflow sticky 0x%x\n", overflow);
414-
if (!overflow) {
415-
qed_db_recovery_execute(p_hwfn, DB_REC_ONCE);
414+
if (!overflow)
416415
return 0;
417-
}
418416

419417
if (qed_edpm_enabled(p_hwfn)) {
420418
rc = qed_db_rec_flush_queue(p_hwfn, p_ptt);
@@ -429,7 +427,7 @@ int qed_db_rec_handler(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
429427
qed_wr(p_hwfn, p_ptt, DORQ_REG_PF_OVFL_STICKY, 0x0);
430428

431429
/* Repeat all last doorbells (doorbell drop recovery) */
432-
qed_db_recovery_execute(p_hwfn, DB_REC_REAL_DEAL);
430+
qed_db_recovery_execute(p_hwfn);
433431

434432
return 0;
435433
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ void qed_int_disable_post_isr_release(struct qed_dev *cdev);
192192

193193
/**
194194
* @brief - Doorbell Recovery handler.
195-
* Run DB_REAL_DEAL doorbell recovery in case of PF overflow
196-
* (and flush DORQ if needed), otherwise run DB_REC_ONCE.
195+
* Run doorbell recovery in case of PF overflow (and flush DORQ if
196+
* needed).
197197
*
198198
* @param p_hwfn
199199
* @param p_ptt

0 commit comments

Comments
 (0)