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

Commit e7ef085d authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'napi_budget_zero'



Eric W. Biederman says:

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

After reading through all 120 drivers supporting netpoll I have found 16
more that process at least received packet when the napi budget == 0.

Processing more packets than your budget has always been a bug but
we haven't cared before so it looks like these drivers slipped through,
and need fixes.

As netpoll will shortly be using a budget of 0 to get the tx queue
processing with the rx queue processing we now care.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 1c79a5a8 75363a46
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -720,6 +720,9 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget)
	int rx_pkt_limit = budget;
	unsigned long flags;

	if (rx_pkt_limit <= 0)
		goto rx_not_empty;

	do{
		/* process receive packets until we use the quota*/
		/* If we own the next entry, it's a new packet. Send it up. */
+2 −0
Original line number Diff line number Diff line
@@ -872,6 +872,8 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
	if (unlikely(bp->panic))
		return 0;
#endif
	if (budget <= 0)
		return rx_pkt;

	bd_cons = fp->rx_bd_cons;
	bd_prod = fp->rx_bd_prod;
+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);

+3 −0
Original line number Diff line number Diff line
@@ -91,6 +91,9 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget)
	u16 pkt_len, sc;
	int curidx;

	if (budget <= 0)
		return received;

	/*
	 * First, grab all of the stats for the incoming packet.
	 * These get messed up if we get called due to a busy condition.
+2 −2
Original line number Diff line number Diff line
@@ -1072,7 +1072,7 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
	unsigned long lpar_rc;

restart_poll:
	do {
	while (frames_processed < budget) {
		if (!ibmveth_rxq_pending_buffer(adapter))
			break;

@@ -1121,7 +1121,7 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
			netdev->stats.rx_bytes += length;
			frames_processed++;
		}
	} while (frames_processed < budget);
	}

	ibmveth_replenish_task(adapter);

Loading