Dont try to post more send work requests if the TX ring is full.
Setting netif_stop_queue is insufficient: linux can still land
a tx packet on us.

Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>

Index: openib/drivers/infiniband/ulp/ipoib/ipoib_ib.c
===================================================================
--- openib.orig/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2006-01-10 
15:38:36.000000000 +0200
+++ openib/drivers/infiniband/ulp/ipoib/ipoib_ib.c      2006-01-10 
18:49:33.000000000 +0200
@@ -344,6 +344,13 @@ void ipoib_send(struct net_device *dev, 
         * means we have to make sure everything is properly recorded and
         * our state is consistent before we call post_send().
         */
+       if (unlikely(priv->tx_head - priv->tx_tail == IPOIB_TX_RING_SIZE)) {
+               ipoib_dbg(priv, "TX ring full, dropping packet\n");
+               ++priv->stats.tx_errors;
+               dev_kfree_skb_any(skb);
+               return;
+       }
+
        tx_req = &priv->tx_ring[priv->tx_head & (IPOIB_TX_RING_SIZE - 1)];
        tx_req->skb = skb;
        addr = dma_map_single(priv->ca->dma_device, skb->data, skb->len,

-- 
MST
_______________________________________________
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to