be2net: Prevent CQ full condition for Lancer
authorPadmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Thu, 3 Nov 2011 01:49:55 +0000 (01:49 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Nov 2011 01:59:40 +0000 (21:59 -0400)
Indicate to HW that the CQ is cleaned up before posting new RX buffers.
This prevents the HW to go into CQ full error condition.

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index 21804972fa2f91cc2278823c096f379403a51218..30606f5ec0d09696f2680b76ac53d26724a8298d 100644 (file)
@@ -1905,6 +1905,8 @@ loop_continue:
                be_rx_stats_update(rxo, rxcp);
        }
 
+       be_cq_notify(adapter, rx_cq->id, false, work_done);
+
        /* Refill the queue */
        if (work_done && atomic_read(&rxo->q.used) < RX_FRAGS_REFILL_WM)
                be_post_rx_frags(rxo, GFP_ATOMIC);
@@ -1912,10 +1914,8 @@ loop_continue:
        /* All consumed */
        if (work_done < budget) {
                napi_complete(napi);
-               be_cq_notify(adapter, rx_cq->id, true, work_done);
-       } else {
-               /* More to be consumed; continue with interrupts disabled */
-               be_cq_notify(adapter, rx_cq->id, false, work_done);
+               /* Arm CQ */
+               be_cq_notify(adapter, rx_cq->id, true, 0);
        }
        return work_done;
 }