[ofa-general] [PATCH 0/5]: Improve small UDP messages

Shirley Ma xma at us.ibm.com
Tue Feb 5 00:29:57 PST 2008





Hello Eli,

      Did you see my another email regarding the memory leak issue in
post_receive()?

+static int ipoib_ib_post_receive(struct net_device *dev, int id)
+{
+       struct ipoib_dev_priv *priv = netdev_priv(dev);
+       struct ib_recv_wr *bad_wr;
+       int ret = 0;
+       int i = priv->rx_outst;
+
+       priv->sglist_draft[i].addr = priv->rx_ring[id].mapping;
+       priv->rx_wr_draft[i].wr_id = id | IPOIB_OP_RECV;
+       if (++priv->rx_outst == UD_POST_RCV_COUNT) {
+               ret = ib_post_recv(priv->qp, priv->rx_wr_draft,
&bad_wr);
+
+               if (unlikely(ret)) {
+                       ipoib_warn(priv, "receive failed for buf %d (%
d)\n", id, ret);
+                       while (bad_wr) {
+                               id = bad_wr->wr_id & ~IPOIB_OP_RECV;
+                               ib_dma_unmap_single(priv->ca,
priv->rx_ring[id].mapping,
+                                                   IPOIB_BUF_SIZE,
DMA_FROM_DEVICE);
+                               dev_kfree_skb_any(priv->rx_ring[id].skb);
+                               priv->rx_ring[id].skb = NULL;
+                       }

16 skbs need to be freed here when errors, not just this one.

+               }
+               priv->rx_outst = 0;
+       }

        return ret;
 }

Thanks
Shirley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080205/a2dc0e48/attachment.html>


More information about the general mailing list