aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/dnet.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/dnet.c')
-rw-r--r--drivers/net/ethernet/dnet.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c
index a379c3e4b57f..13d00a38a5bd 100644
--- a/drivers/net/ethernet/dnet.c
+++ b/drivers/net/ethernet/dnet.c
@@ -398,13 +398,8 @@ static int dnet_poll(struct napi_struct *napi, int budget)
398 * break out of while loop if there are no more 398 * break out of while loop if there are no more
399 * packets waiting 399 * packets waiting
400 */ 400 */
401 if (!(dnet_readl(bp, RX_FIFO_WCNT) >> 16)) { 401 if (!(dnet_readl(bp, RX_FIFO_WCNT) >> 16))
402 napi_complete(napi); 402 break;
403 int_enable = dnet_readl(bp, INTR_ENB);
404 int_enable |= DNET_INTR_SRC_RX_CMDFIFOAF;
405 dnet_writel(bp, int_enable, INTR_ENB);
406 return 0;
407 }
408 403
409 cmd_word = dnet_readl(bp, RX_LEN_FIFO); 404 cmd_word = dnet_readl(bp, RX_LEN_FIFO);
410 pkt_len = cmd_word & 0xFFFF; 405 pkt_len = cmd_word & 0xFFFF;
@@ -433,20 +428,17 @@ static int dnet_poll(struct napi_struct *napi, int budget)
433 "size %u.\n", dev->name, pkt_len); 428 "size %u.\n", dev->name, pkt_len);
434 } 429 }
435 430
436 budget -= npackets;
437
438 if (npackets < budget) { 431 if (npackets < budget) {
439 /* We processed all packets available. Tell NAPI it can 432 /* We processed all packets available. Tell NAPI it can
440 * stop polling then re-enable rx interrupts */ 433 * stop polling then re-enable rx interrupts.
434 */
441 napi_complete(napi); 435 napi_complete(napi);
442 int_enable = dnet_readl(bp, INTR_ENB); 436 int_enable = dnet_readl(bp, INTR_ENB);
443 int_enable |= DNET_INTR_SRC_RX_CMDFIFOAF; 437 int_enable |= DNET_INTR_SRC_RX_CMDFIFOAF;
444 dnet_writel(bp, int_enable, INTR_ENB); 438 dnet_writel(bp, int_enable, INTR_ENB);
445 return 0;
446 } 439 }
447 440
448 /* There are still packets waiting */ 441 return npackets;
449 return 1;
450} 442}
451 443
452static irqreturn_t dnet_interrupt(int irq, void *dev_id) 444static irqreturn_t dnet_interrupt(int irq, void *dev_id)