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                                                 
             <[EMAIL PROTECTED]                                         
             .co.il>                                                    To
                                       Shirley Ma/Beaverton/[EMAIL PROTECTED]  
             02/05/08 12:38 AM                                          cc
                                       openfabrics                     
                                       <[EMAIL PROTECTED]
             Please respond to         rg>, Roland Dreier              
             [EMAIL PROTECTED]         <[EMAIL PROTECTED]>,            
                   co.il               [EMAIL PROTECTED]     
                                                                   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
>
>

<<inline: graycol.gif>>

<<inline: pic01959.gif>>

<<inline: ecblank.gif>>

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

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

Reply via email to