[ofa-general] Re: [PATCH 2/16 v4] IB/ipoib: Add s/g support

Shirley Ma xma at us.ibm.com
Sun Feb 10 22:41:47 PST 2008






Hello Roland & Eli,

      We have seen memory allocation failure when allocating large tx_ring
size. Like 1K tx_ring size,  kerne page size = 4K. tx_ring will need at
least 36 pages (MAX_SKB_FRAGS = 64K/4K + 2 =18) contiguous memory per port.
Either each mapping needs to be dynamically allocated or the allocation
should be based on page size for tx_ring.

struct ipoib_tx_buf {
        struct sk_buff *skb;
        u64             mapping[MAX_SKB_FRAGS + 1];
};

Thanks
Shirley



                                                                           
             Roland                                                        
             Dreier                                                        
             <rdreier@                                                  To 
             cisco.com         eli at mellanox.co.il                          
             >                                                          cc 
             Sent by:          openfabrics <general at lists.openfabrics.org> 
             general-b                                             Subject 
             ounces at li         [ofa-general] Re: [PATCH 2/16 v4] IB/ipoib: 
             sts.openf         Add s/g support                             
             abrics.or                                                     
             g                                                             
                                                                           
                                                                           
             02/08/08                                                      
             02:32 PM                                                      
                                                                           




Thanks, applied...

 > --- a/drivers/infiniband/ulp/ipoib/ipoib.h
 > +++ b/drivers/infiniband/ulp/ipoib/ipoib.h

 > +static inline int ipoib_dma_map_tx(struct ib_device *ca,
 > +                                                struct ipoib_tx_buf
*tx_req)

I didn't see why this needed to be in a header-- I just moved it to
ipoib_ib.c.  Also

 > +         int frags;
 > +         int i;
 > +
 > +         mapping[0] = ib_dma_map_single(ca, skb->data,
skb_headlen(skb),
 > +                                                    DMA_TO_DEVICE);
 > +         if (unlikely(ib_dma_mapping_error(ca, mapping[0])))
 > +                     return -EIO;
 > +
 > +         frags = skb_shinfo(skb)->nr_frags;

Not sure what the advantage of having a local variable that is only
used once to hold the value of nr_frags, so I got rid of it.

 - R.
_______________________________________________
general mailing list
general at lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit
http://openib.org/mailman/listinfo/openib-general
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080210/b11a3425/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/20080210/b11a3425/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic31887.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080210/b11a3425/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/20080210/b11a3425/attachment-0002.gif>


More information about the general mailing list