Commit 2f74258d authored by Shannon Nelson's avatar Shannon Nelson Committed by Jakub Kicinski

ionic: minimal work with 0 budget

We should be doing as little as possible besides freeing Tx
space when our napi routines are called with budget of 0, so
jump out before doing anything besides Tx cleaning.

See commit afbed3f7 ("net/mlx5e: do as little as possible in napi poll when budget is 0")
for more info.

Fixes: fe8c30b5 ("ionic: separate interrupt for Tx and Rx")
Reviewed-by: default avatarBrett Creeley <brett.creeley@amd.com>
Signed-off-by: default avatarShannon Nelson <shannon.nelson@amd.com>
Link: https://lore.kernel.org/r/20240210001307.48450-1-shannon.nelson@amd.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1692b977
...@@ -579,6 +579,9 @@ int ionic_tx_napi(struct napi_struct *napi, int budget) ...@@ -579,6 +579,9 @@ int ionic_tx_napi(struct napi_struct *napi, int budget)
work_done = ionic_cq_service(cq, budget, work_done = ionic_cq_service(cq, budget,
ionic_tx_service, NULL, NULL); ionic_tx_service, NULL, NULL);
if (unlikely(!budget))
return budget;
if (work_done < budget && napi_complete_done(napi, work_done)) { if (work_done < budget && napi_complete_done(napi, work_done)) {
ionic_dim_update(qcq, IONIC_LIF_F_TX_DIM_INTR); ionic_dim_update(qcq, IONIC_LIF_F_TX_DIM_INTR);
flags |= IONIC_INTR_CRED_UNMASK; flags |= IONIC_INTR_CRED_UNMASK;
...@@ -607,6 +610,9 @@ int ionic_rx_napi(struct napi_struct *napi, int budget) ...@@ -607,6 +610,9 @@ int ionic_rx_napi(struct napi_struct *napi, int budget)
u32 work_done = 0; u32 work_done = 0;
u32 flags = 0; u32 flags = 0;
if (unlikely(!budget))
return budget;
lif = cq->bound_q->lif; lif = cq->bound_q->lif;
idev = &lif->ionic->idev; idev = &lif->ionic->idev;
...@@ -656,6 +662,9 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget) ...@@ -656,6 +662,9 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget)
tx_work_done = ionic_cq_service(txcq, IONIC_TX_BUDGET_DEFAULT, tx_work_done = ionic_cq_service(txcq, IONIC_TX_BUDGET_DEFAULT,
ionic_tx_service, NULL, NULL); ionic_tx_service, NULL, NULL);
if (unlikely(!budget))
return budget;
rx_work_done = ionic_cq_service(rxcq, budget, rx_work_done = ionic_cq_service(rxcq, budget,
ionic_rx_service, NULL, NULL); ionic_rx_service, NULL, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment