ionic: Fix dim work handling in split interrupt mode

[ Upstream commit 4115ba677c35f694b62298e55f0e04ce84eed469 ]

Currently ionic_dim_work() is incorrect when in
split interrupt mode. This is because the interrupt
rate is only being changed for the Rx side even for
dim running on Tx. Fix this by using the qcq from
the container_of macro. Also, introduce some local
variables for a bit of cleanup.

Fixes: a6ff85e0a2d9 ("ionic: remove intr coalesce update from napi")
Signed-off-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20231204192234.21017-3-shannon.nelson@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Brett Creeley 2023-12-04 11:22:34 -08:00 committed by Ksawlii
parent ddda7c8210
commit 73bfc7ad53

View file

@ -45,24 +45,24 @@ static void ionic_lif_queue_identify(struct ionic_lif *lif);
static void ionic_dim_work(struct work_struct *work) static void ionic_dim_work(struct work_struct *work)
{ {
struct dim *dim = container_of(work, struct dim, work); struct dim *dim = container_of(work, struct dim, work);
struct ionic_intr_info *intr;
struct dim_cq_moder cur_moder; struct dim_cq_moder cur_moder;
struct ionic_qcq *qcq; struct ionic_qcq *qcq;
struct ionic_lif *lif;
u32 new_coal; u32 new_coal;
cur_moder = net_dim_get_rx_moderation(dim->mode, dim->profile_ix); cur_moder = net_dim_get_rx_moderation(dim->mode, dim->profile_ix);
qcq = container_of(dim, struct ionic_qcq, dim); qcq = container_of(dim, struct ionic_qcq, dim);
new_coal = ionic_coal_usec_to_hw(qcq->q.lif->ionic, cur_moder.usec); lif = qcq->q.lif;
new_coal = ionic_coal_usec_to_hw(lif->ionic, cur_moder.usec);
new_coal = new_coal ? new_coal : 1; new_coal = new_coal ? new_coal : 1;
if (qcq->intr.dim_coal_hw != new_coal) { intr = &qcq->intr;
unsigned int qi = qcq->cq.bound_q->index; if (intr->dim_coal_hw != new_coal) {
struct ionic_lif *lif = qcq->q.lif; intr->dim_coal_hw = new_coal;
qcq->intr.dim_coal_hw = new_coal;
ionic_intr_coal_init(lif->ionic->idev.intr_ctrl, ionic_intr_coal_init(lif->ionic->idev.intr_ctrl,
lif->rxqcqs[qi]->intr.index, intr->index, intr->dim_coal_hw);
qcq->intr.dim_coal_hw);
} }
dim->state = DIM_START_MEASURE; dim->state = DIM_START_MEASURE;