Commit cbd84a44 authored by David S. Miller's avatar David S. Miller

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
......@@ -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;
......
......@@ -476,7 +476,7 @@ static int cp_rx_poll(struct napi_struct *napi, int budget)
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 @@ static int cp_rx_poll(struct napi_struct *napi, int budget)
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;
......
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