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

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






Hello Eli,

      If i undersand your code correctly, you post_receive 16 skb's at
once. when ib_post_receive returns error, all these 16 skb's would fail,
not just this skb failure, am I right? If all failure, then we should free
these 16 skb's not just one. Also the same issue in ipoib-cm code.

Thanks
Shirley




                                                                           
             Eli Cohen                                                     
             <eli at dev.mellanox                                             
             .co.il>                                                    To 
                                       Shirley Ma/Beaverton/IBM at IBMUS      
             02/05/08 12:38 AM                                          cc 
                                       openfabrics                         
                                       <openib-general at lists.openfabrics.o 
             Please respond to         rg>, Roland Dreier                  
             eli at dev.mellanox.         <rdreier at cisco.com>,                
                   co.il               tziporet at dev.mellanox.co.il         
                                                                   Subject 
                                       Re: [ofa-general] [PATCH 0/5]:      
                                       Improve small UDP messages          
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           





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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080205/5f2fbdff/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080205/5f2fbdff/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic01959.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080205/5f2fbdff/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080205/5f2fbdff/attachment-0002.gif>


More information about the general mailing list