<html><body>
<p>Hello Roland & Eli,<br>
<br>
        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.<br>
<br>
struct ipoib_tx_buf {<br>
        struct sk_buff *skb;<br>
        u64             mapping[MAX_SKB_FRAGS + 1];<br>
};<br>
<br>
Thanks<br>
Shirley<br>
<br>
<img width="16" height="16" src="cid:1__=08BBF97FDFB043978f9e8a93df938@us.ibm.com" border="0" alt="Inactive hide details for Roland Dreier <rdreier@cisco.com>">Roland Dreier <rdreier@cisco.com><br>
<br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td style="background-image:url(cid:2__=08BBF97FDFB043978f9e8a93df938@us.ibm.com); background-repeat: no-repeat; " width="29%">
<ul>
<ul>
<ul>
<ul><b><font size="2">Roland Dreier <rdreier@cisco.com></font></b><font size="2"> </font><br>
<font size="2">Sent by: general-bounces@lists.openfabrics.org</font>
<p><font size="2">02/08/08 02:32 PM</font></ul>
</ul>
</ul>
</ul>
</td><td width="71%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:3__=08BBF97FDFB043978f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<div align="right"><font size="2">To</font></div></td><td width="100%"><img width="1" height="1" src="cid:3__=08BBF97FDFB043978f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">eli@mellanox.co.il</font></td></tr>

<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:3__=08BBF97FDFB043978f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<div align="right"><font size="2">cc</font></div></td><td width="100%"><img width="1" height="1" src="cid:3__=08BBF97FDFB043978f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">openfabrics <general@lists.openfabrics.org></font></td></tr>

<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:3__=08BBF97FDFB043978f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<div align="right"><font size="2">Subject</font></div></td><td width="100%"><img width="1" height="1" src="cid:3__=08BBF97FDFB043978f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">[ofa-general] Re: [PATCH 2/16 v4] IB/ipoib: Add s/g support</font></td></tr>
</table>

<table border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="58"><img width="1" height="1" src="cid:3__=08BBF97FDFB043978f9e8a93df938@us.ibm.com" border="0" alt=""></td><td width="336"><img width="1" height="1" src="cid:3__=08BBF97FDFB043978f9e8a93df938@us.ibm.com" border="0" alt=""></td></tr>
</table>
</td></tr>
</table>
<br>
<tt>Thanks, applied...<br>
<br>
 > --- a/drivers/infiniband/ulp/ipoib/ipoib.h<br>
 > +++ b/drivers/infiniband/ulp/ipoib/ipoib.h<br>
<br>
 > +static inline int ipoib_dma_map_tx(struct ib_device *ca,<br>
 > +                                                             struct ipoib_tx_buf *tx_req)<br>
<br>
I didn't see why this needed to be in a header-- I just moved it to<br>
ipoib_ib.c.  Also<br>
<br>
 > +          int frags;<br>
 > +          int i;<br>
 > +<br>
 > +          mapping[0] = ib_dma_map_single(ca, skb->data, skb_headlen(skb),<br>
 > +                                                                 DMA_TO_DEVICE);<br>
 > +          if (unlikely(ib_dma_mapping_error(ca, mapping[0])))<br>
 > +                          return -EIO;<br>
 > +<br>
 > +          frags = skb_shinfo(skb)->nr_frags;<br>
<br>
Not sure what the advantage of having a local variable that is only<br>
used once to hold the value of nr_frags, so I got rid of it.<br>
<br>
 - R.<br>
_______________________________________________<br>
general mailing list<br>
general@lists.openfabrics.org<br>
</tt><tt><a href="http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general">http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general</a></tt><tt><br>
<br>
To unsubscribe, please visit </tt><tt><a href="http://openib.org/mailman/listinfo/openib-general">http://openib.org/mailman/listinfo/openib-general</a></tt><tt><br>
</tt><br>
</body></html>