1 --- a/drivers/net/ethernet/freescale/gianfar.c
2 +++ b/drivers/net/ethernet/freescale/gianfar.c
3 @@ -2835,7 +2835,7 @@ static int gfar_poll(struct napi_struct
4 struct gfar_priv_rx_q *rx_queue = NULL;
5 int work_done = 0, work_done_per_q = 0;
6 int i, budget_per_q = 0;
9 unsigned long rstat_rxf;
12 @@ -2850,62 +2850,48 @@ static int gfar_poll(struct napi_struct
14 budget_per_q = budget/num_act_queues;
18 - for_each_set_bit(i, &gfargrp->tx_bit_map, priv->num_tx_queues) {
19 - tx_queue = priv->tx_queue[i];
20 - /* run Tx cleanup to completion */
21 - if (tx_queue->tx_skbuff[tx_queue->skb_dirtytx]) {
22 - gfar_clean_tx_ring(tx_queue);
27 - for_each_set_bit(i, &gfargrp->rx_bit_map, priv->num_rx_queues) {
28 - /* skip queue if not active */
29 - if (!(rstat_rxf & (RSTAT_CLEAR_RXF0 >> i)))
32 - rx_queue = priv->rx_queue[i];
34 - gfar_clean_rx_ring(rx_queue, budget_per_q);
35 - work_done += work_done_per_q;
37 - /* finished processing this queue */
38 - if (work_done_per_q < budget_per_q) {
39 - /* clear active queue hw indication */
40 - gfar_write(®s->rstat,
41 - RSTAT_CLEAR_RXF0 >> i);
42 - rstat_rxf &= ~(RSTAT_CLEAR_RXF0 >> i);
45 - if (!num_act_queues)
47 - /* recompute budget per Rx queue */
49 - (budget - work_done) / num_act_queues;
51 + for_each_set_bit(i, &gfargrp->tx_bit_map, priv->num_tx_queues) {
52 + tx_queue = priv->tx_queue[i];
53 + /* run Tx cleanup to completion */
54 + if (tx_queue->tx_skbuff[tx_queue->skb_dirtytx]) {
55 + gfar_clean_tx_ring(tx_queue);
60 - if (work_done >= budget)
62 + for_each_set_bit(i, &gfargrp->rx_bit_map, priv->num_rx_queues) {
63 + /* skip queue if not active */
64 + if (!(rstat_rxf & (RSTAT_CLEAR_RXF0 >> i)))
67 + rx_queue = priv->rx_queue[i];
68 + work_done_per_q = gfar_clean_rx_ring(rx_queue, budget_per_q);
69 + work_done += work_done_per_q;
71 + /* finished processing this queue */
72 + if (work_done_per_q < budget_per_q) {
73 + /* clear active queue hw indication */
74 + gfar_write(®s->rstat, RSTAT_CLEAR_RXF0 >> i);
77 - if (!num_act_queues && !has_tx_work) {
78 + if (!num_act_queues)
83 - napi_complete(napi);
84 + if (!num_act_queues && !has_tx_work) {
85 + napi_complete(napi);
87 - /* Clear the halt bit in RSTAT */
88 - gfar_write(®s->rstat, gfargrp->rstat);
89 + /* Clear the halt bit in RSTAT */
90 + gfar_write(®s->rstat, gfargrp->rstat);
92 - gfar_write(®s->imask, IMASK_DEFAULT);
93 + gfar_write(®s->imask, IMASK_DEFAULT);
95 - /* If we are coalescing interrupts, update the timer
96 - * Otherwise, clear it
98 - gfar_configure_coalescing(priv, gfargrp->rx_bit_map,
99 - gfargrp->tx_bit_map);
102 + /* If we are coalescing interrupts, update the timer
103 + * Otherwise, clear it
105 + gfar_configure_coalescing(priv, gfargrp->rx_bit_map,
106 + gfargrp->tx_bit_map);