Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c502549 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by David S. Miller
Browse files

enic: Don't receive packets when the napi budget == 0



Processing any incoming packets with a with a napi budget of 0
is incorrect driver behavior.

This matters as netpoll will shortly call drivers with a budget of 0
to avoid receive packet processing happening in hard irq context.

Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 278d5385
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -1086,12 +1086,13 @@ static int enic_poll(struct napi_struct *napi, int budget)
	unsigned int intr = enic_legacy_io_intr();
	unsigned int rq_work_to_do = budget;
	unsigned int wq_work_to_do = -1; /* no limit */
	unsigned int  work_done, rq_work_done, wq_work_done;
	unsigned int  work_done, rq_work_done = 0, wq_work_done;
	int err;

	/* Service RQ (first) and WQ
	 */

	if (budget > 0)
		rq_work_done = vnic_cq_service(&enic->cq[cq_rq],
			rq_work_to_do, enic_rq_service, NULL);

@@ -1141,12 +1142,13 @@ static int enic_poll_msix(struct napi_struct *napi, int budget)
	unsigned int cq = enic_cq_rq(enic, rq);
	unsigned int intr = enic_msix_rq_intr(enic, rq);
	unsigned int work_to_do = budget;
	unsigned int work_done;
	unsigned int work_done = 0;
	int err;

	/* Service RQ
	 */

	if (budget > 0)
		work_done = vnic_cq_service(&enic->cq[cq],
			work_to_do, enic_rq_service, NULL);