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

Eli Cohen eli at dev.mellanox.co.il
Tue Feb 5 00:38:00 PST 2008


On Tue, 2008-02-05 at 00:29 -0800, Shirley Ma wrote:
> Hello Eli,
> 
> Did you see my another email regarding the memory leak issue in
> post_receive()?

No, I saw you suggested using dynamic allocations for the list of
receive WQEs but nothing re memory leak. Can you be more specific?

> 
> +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
> 
> 




More information about the general mailing list