<br><font size=2><tt>Roland Dreier <rdreier@cisco.com> wrote on 05/24/2006
04:07:58 PM:<br>
> To reiterate: freeing AHs is a rare,<br>
> "slow path" operation that can be done asynchronously.  It
is not a<br>
> good tradeoff to do two atomic_t operations for every sent packet,<br>
> just to avoid occasionally reaping AHs in process context.<br>
</tt></font>
<br><font size=2><tt>I don't think two atomic operation is that expensive
compare to </tt></font>
<br><font size=2><tt>reaping AHs in process context according to the test
results and </tt></font>
<br><font size=2><tt>profiling data. Or we can use RCU instead.</tt></font>
<br><font size=2><tt><br>
>  > > But can you guarantee that the AH stays around until
after the send<br>
>  > > completes (which could be an arbitrarily long delay)?<br>
> <br>
>  > I checked negih_add_path(), for unicast it is true always.
See code below.<br>
>  > <br>
>  > static void neigh_add_path(..)<br>
>  > {<br>
>  > ...<br>
>  >         if (path->ah) {<br>
>  >                
kref_get(&path->ah->ref);<br>
>  >                
neigh->ah = path->ah;<br>
>  >             ipoib_send(dev,
skb, path->ah... <br>
>  > } <br>
> <br>
> Again, I don't understand how this is a response at all.  The
AH<br>
> cannot be freed until after the send operation is actually fully<br>
> completed, which could be a long time after ib_post_send() returns.<br>
> <br>
> If an AH is freed after ipoib_send() returns but before the send is<br>
> executed, then the HCA may use stale data, which could lead to a send<br>
> error.<br>
> <br>
> To summarize: the patch is broken (leads to incorrect lifetimes for<br>
> AHs), and in any case makes the send fast path slower.<br>
> <br>
>  - R.<br>
</tt></font>
<br><font size=2><tt>That's a value point. This problem will be addressed
in next tx_ring removal </tt></font>
<br><font size=2><tt>patch. The kref_put was called in ipoib_ib_handle_send_wc().</tt></font>
<br><font size=2 face="sans-serif"><br>
Thanks<br>
Shirley Ma<br>
IBM Linux Technology Center<br>
15300 SW Koll Parkway<br>
Beaverton, OR 97006-6063<br>
Phone(Fax): (503) 578-7638</font>