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

Commit cbd84a44 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

To the best of understanding processing any received packets when the
napi budget == 0 is broken driver behavior.  At the same time I don't
think we have ever cared before so there are a handful of drivers that
need fixes.

I care now as I will shortly be using htis in netpoll to get the
tx queue processing without the rx queue processing.

Drivers that need fixes are few and far between, and so far I have only
found two of them.  More similar patches later if I find more drivers
that need fixes.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents f9708b43 50ff44be
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3132,6 +3132,9 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
	struct l2_fhdr *rx_hdr;
	int rx_pkt = 0, pg_ring_used = 0;

	if (budget <= 0)
		return rx_pkt;

	hw_cons = bnx2_get_hw_rx_cons(bnapi);
	sw_cons = rxr->rx_cons;
	sw_prod = rxr->rx_prod;
+1 −4
Original line number Diff line number Diff line
@@ -476,7 +476,7 @@ rx_status_loop:
	rx = 0;
	cpw16(IntrStatus, cp_rx_intr_mask);

	while (1) {
	while (rx < budget) {
		u32 status, len;
		dma_addr_t mapping, new_mapping;
		struct sk_buff *skb, *new_skb;
@@ -554,9 +554,6 @@ rx_next:
		else
			desc->opts1 = cpu_to_le32(DescOwn | cp->rx_buf_sz);
		rx_tail = NEXT_RX(rx_tail);

		if (rx >= budget)
			break;
	}

	cp->rx_tail = rx_tail;