[PATCH v2] um: vector: Fix NAPI budget handling

anton.ivanov at cambridgegreys.com anton.ivanov at cambridgegreys.com
Sat Jul 6 02:12:00 PDT 2024


From: Anton Ivanov <anton.ivanov at cambridgegreys.com>

Fix the handling of NAPI budget.

Signed-off-by: Anton Ivanov <anton.ivanov at cambridgegreys.com>
---
 arch/um/drivers/vector_kern.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index 53e825bcc6fa..5e96efef65cf 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -968,7 +968,7 @@ static int vector_mmsg_rx(struct vector_private *vp, int budget)
 		budget = qi->max_depth;
 
 	packet_count = uml_vector_recvmmsg(
-		vp->fds->rx_fd, qi->mmsg_vector, qi->max_depth, 0);
+		vp->fds->rx_fd, qi->mmsg_vector, budget, 0);
 
 	if (packet_count < 0)
 		vp->in_error = true;
@@ -1184,7 +1184,7 @@ static int vector_poll(struct napi_struct *napi, int budget)
 
 	if (tx_enqueued || err > 0)
 		napi_schedule(napi);
-	if (work_done < budget)
+	if (work_done <= budget)
 		napi_complete_done(napi, work_done);
 	return work_done;
 }
-- 
2.39.2




More information about the linux-um mailing list