be2net: fix EQ from getting full while cleaning RX CQ
authorSathya Perla <sathya.perla@emulex.com>
Wed, 8 May 2013 02:05:49 +0000 (02:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 May 2013 18:59:48 +0000 (11:59 -0700)
While cleaning RX queues, the CQ DB may be rung several times (with rearm)
while waiting for the flush compl. Each CQ-notify with rearm can result in
an event. The EQ may get full resulting in a HW error.

Fix this by not re-arming the CQ while notifying a valid completion.
Also, there's no need to wait for 1ms after destroying RXQ, as the code in
be_rx_cq_clean() waits for the flush compl to arrive.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index b304b837f5bd963395c15a3889ffcc481bed04c7..792d8383e8d6d2178df42d445b3dec0c262445c0 100644 (file)
@@ -1827,7 +1827,7 @@ static void be_rx_cq_clean(struct be_rx_obj *rxo)
                        mdelay(1);
                } else {
                        be_rx_compl_discard(rxo, rxcp);
-                       be_cq_notify(adapter, rx_cq->id, true, 1);
+                       be_cq_notify(adapter, rx_cq->id, false, 1);
                        if (rxcp->num_rcvd == 0)
                                break;
                }
@@ -2533,11 +2533,6 @@ static void be_rx_qs_destroy(struct be_adapter *adapter)
                q = &rxo->q;
                if (q->created) {
                        be_cmd_rxq_destroy(adapter, q);
-                       /* After the rxq is invalidated, wait for a grace time
-                        * of 1ms for all dma to end and the flush compl to
-                        * arrive
-                        */
-                       mdelay(1);
                        be_rx_cq_clean(rxo);
                }
                be_queue_free(adapter, q);