Skip to content

Commit 4aaa49a

Browse files
emuslnkuba-moo
authored andcommitted
ionic: remove missed doorbell per-queue timer
Remove the timer-per-queue mechanics from the missed doorbell check in preparation for the new missed doorbell fix. Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Link: https://lore.kernel.org/r/20240619003257.6138-2-shannon.nelson@amd.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 6f80fcd commit 4aaa49a

File tree

4 files changed

+15
-49
lines changed

4 files changed

+15
-49
lines changed

drivers/net/ethernet/pensando/ionic/ionic_dev.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -703,10 +703,6 @@ void ionic_q_post(struct ionic_queue *q, bool ring_doorbell)
703703
q->dbval | q->head_idx);
704704

705705
q->dbell_jiffies = jiffies;
706-
707-
if (q_to_qcq(q)->napi_qcq)
708-
mod_timer(&q_to_qcq(q)->napi_qcq->napi_deadline,
709-
jiffies + IONIC_NAPI_DEADLINE);
710706
}
711707
}
712708

drivers/net/ethernet/pensando/ionic/ionic_lif.c

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,6 @@ void ionic_link_status_check_request(struct ionic_lif *lif, bool can_sleep)
213213
}
214214
}
215215

216-
static void ionic_napi_deadline(struct timer_list *timer)
217-
{
218-
struct ionic_qcq *qcq = container_of(timer, struct ionic_qcq, napi_deadline);
219-
220-
napi_schedule(&qcq->napi);
221-
}
222-
223216
static irqreturn_t ionic_isr(int irq, void *data)
224217
{
225218
struct napi_struct *napi = data;
@@ -343,7 +336,6 @@ static int ionic_qcq_disable(struct ionic_lif *lif, struct ionic_qcq *qcq, int f
343336
synchronize_irq(qcq->intr.vector);
344337
irq_set_affinity_hint(qcq->intr.vector, NULL);
345338
napi_disable(&qcq->napi);
346-
del_timer_sync(&qcq->napi_deadline);
347339
}
348340

349341
/* If there was a previous fw communcation error, don't bother with
@@ -478,7 +470,6 @@ static void ionic_link_qcq_interrupts(struct ionic_qcq *src_qcq,
478470
{
479471
n_qcq->intr.vector = src_qcq->intr.vector;
480472
n_qcq->intr.index = src_qcq->intr.index;
481-
n_qcq->napi_qcq = src_qcq->napi_qcq;
482473
}
483474

484475
static int ionic_alloc_qcq_interrupt(struct ionic_lif *lif, struct ionic_qcq *qcq)
@@ -832,11 +823,8 @@ static int ionic_lif_txq_init(struct ionic_lif *lif, struct ionic_qcq *qcq)
832823
q->dbell_deadline = IONIC_TX_DOORBELL_DEADLINE;
833824
q->dbell_jiffies = jiffies;
834825

835-
if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) {
826+
if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state))
836827
netif_napi_add(lif->netdev, &qcq->napi, ionic_tx_napi);
837-
qcq->napi_qcq = qcq;
838-
timer_setup(&qcq->napi_deadline, ionic_napi_deadline, 0);
839-
}
840828

841829
qcq->flags |= IONIC_QCQ_F_INITED;
842830

@@ -909,9 +897,6 @@ static int ionic_lif_rxq_init(struct ionic_lif *lif, struct ionic_qcq *qcq)
909897
else
910898
netif_napi_add(lif->netdev, &qcq->napi, ionic_txrx_napi);
911899

912-
qcq->napi_qcq = qcq;
913-
timer_setup(&qcq->napi_deadline, ionic_napi_deadline, 0);
914-
915900
qcq->flags |= IONIC_QCQ_F_INITED;
916901

917902
return 0;
@@ -1166,7 +1151,6 @@ static int ionic_adminq_napi(struct napi_struct *napi, int budget)
11661151
struct ionic_dev *idev = &lif->ionic->idev;
11671152
unsigned long irqflags;
11681153
unsigned int flags = 0;
1169-
bool resched = false;
11701154
int rx_work = 0;
11711155
int tx_work = 0;
11721156
int n_work = 0;
@@ -1203,15 +1187,12 @@ static int ionic_adminq_napi(struct napi_struct *napi, int budget)
12031187
ionic_intr_credits(idev->intr_ctrl, intr->index, credits, flags);
12041188
}
12051189

1206-
if (!a_work && ionic_adminq_poke_doorbell(&lif->adminqcq->q))
1207-
resched = true;
1208-
if (lif->hwstamp_rxq && !rx_work && ionic_rxq_poke_doorbell(&lif->hwstamp_rxq->q))
1209-
resched = true;
1210-
if (lif->hwstamp_txq && !tx_work && ionic_txq_poke_doorbell(&lif->hwstamp_txq->q))
1211-
resched = true;
1212-
if (resched)
1213-
mod_timer(&lif->adminqcq->napi_deadline,
1214-
jiffies + IONIC_NAPI_DEADLINE);
1190+
if (!a_work)
1191+
ionic_adminq_poke_doorbell(&lif->adminqcq->q);
1192+
if (lif->hwstamp_rxq && !rx_work)
1193+
ionic_rxq_poke_doorbell(&lif->hwstamp_rxq->q);
1194+
if (lif->hwstamp_txq && !tx_work)
1195+
ionic_txq_poke_doorbell(&lif->hwstamp_txq->q);
12151196

12161197
return work_done;
12171198
}
@@ -3502,9 +3483,6 @@ static int ionic_lif_adminq_init(struct ionic_lif *lif)
35023483

35033484
netif_napi_add(lif->netdev, &qcq->napi, ionic_adminq_napi);
35043485

3505-
qcq->napi_qcq = qcq;
3506-
timer_setup(&qcq->napi_deadline, ionic_napi_deadline, 0);
3507-
35083486
napi_enable(&qcq->napi);
35093487

35103488
if (qcq->flags & IONIC_QCQ_F_INTR) {

drivers/net/ethernet/pensando/ionic/ionic_lif.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,9 @@ struct ionic_qcq {
8484
u32 cmb_pgid;
8585
u32 cmb_order;
8686
struct dim dim;
87-
struct timer_list napi_deadline;
8887
struct ionic_queue q;
8988
struct ionic_cq cq;
9089
struct napi_struct napi;
91-
struct ionic_qcq *napi_qcq;
9290
struct ionic_intr_info intr;
9391
struct dentry *dentry;
9492
};

drivers/net/ethernet/pensando/ionic/ionic_txrx.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -868,9 +868,6 @@ void ionic_rx_fill(struct ionic_queue *q)
868868

869869
q->dbell_deadline = IONIC_RX_MIN_DOORBELL_DEADLINE;
870870
q->dbell_jiffies = jiffies;
871-
872-
mod_timer(&q_to_qcq(q)->napi_qcq->napi_deadline,
873-
jiffies + IONIC_NAPI_DEADLINE);
874871
}
875872

876873
void ionic_rx_empty(struct ionic_queue *q)
@@ -953,8 +950,8 @@ int ionic_tx_napi(struct napi_struct *napi, int budget)
953950
work_done, flags);
954951
}
955952

956-
if (!work_done && ionic_txq_poke_doorbell(&qcq->q))
957-
mod_timer(&qcq->napi_deadline, jiffies + IONIC_NAPI_DEADLINE);
953+
if (!work_done)
954+
ionic_txq_poke_doorbell(&qcq->q);
958955

959956
return work_done;
960957
}
@@ -996,8 +993,8 @@ int ionic_rx_napi(struct napi_struct *napi, int budget)
996993
work_done, flags);
997994
}
998995

999-
if (!work_done && ionic_rxq_poke_doorbell(&qcq->q))
1000-
mod_timer(&qcq->napi_deadline, jiffies + IONIC_NAPI_DEADLINE);
996+
if (!work_done)
997+
ionic_rxq_poke_doorbell(&qcq->q);
1001998

1002999
return work_done;
10031000
}
@@ -1010,7 +1007,6 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget)
10101007
struct ionic_qcq *txqcq;
10111008
struct ionic_lif *lif;
10121009
struct ionic_cq *txcq;
1013-
bool resched = false;
10141010
u32 rx_work_done = 0;
10151011
u32 tx_work_done = 0;
10161012
u32 flags = 0;
@@ -1042,12 +1038,10 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget)
10421038
tx_work_done + rx_work_done, flags);
10431039
}
10441040

1045-
if (!rx_work_done && ionic_rxq_poke_doorbell(&rxqcq->q))
1046-
resched = true;
1047-
if (!tx_work_done && ionic_txq_poke_doorbell(&txqcq->q))
1048-
resched = true;
1049-
if (resched)
1050-
mod_timer(&rxqcq->napi_deadline, jiffies + IONIC_NAPI_DEADLINE);
1041+
if (!rx_work_done)
1042+
ionic_rxq_poke_doorbell(&rxqcq->q);
1043+
if (!tx_work_done)
1044+
ionic_txq_poke_doorbell(&txqcq->q);
10511045

10521046
return rx_work_done;
10531047
}

0 commit comments

Comments
 (0)