<br><br><div class="gmail_quote">On Mon, Oct 17, 2011 at 10:21 AM, David McCullough <span dir="ltr"><<a href="mailto:david_mccullough@mcafee.com">david_mccullough@mcafee.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
Jivin satpal parmar lays it down ...<br>
</div>...<br>
<div class="im">> That's something for the driver writers or the kernel people....<br>
><br>
><br>
><br>
> I made some progress in my investigation here. It seems there is a bug in driver (drivers/crypto/nss-sham.c)<br>
><br>
><br>
> static int nss_sham_update_cdma_start(struct nss_sham_dev *dd)<br>
> {<br>
> struct nss_sham_reqctx *ctx = ahash_request_ctx(dd->req);<br>
> unsigned int length, final, tail;<br>
> struct scatterlist *sg;<br>
><br>
><br>
> if (!ctx->total)<br>
> return 0;<br>
><br>
><br>
> if (ctx->bufcnt || ctx->offset)<br>
> return nss_sham_update_cdma_slow(dd); ---------------------->True for OCF/cryptodev/crptosoft path.This uses dma_single mapping instead of scatterlist.But in case of netkey/IPsec this is not true and we hit case<br>
><br>
><br>
> if (!dma_map_sg(dd->dev, ctx->sg, 1, DMA_TO_DEVICE)) {<br>
> dev_err(dd->dev, "dma_map_sg error\n");<br>
> return -EINVAL;<br>
> which is scatter list DMA implementation and crashes in the end of this path (as seen in crash dump). I am yet to explore why we got two different paths and why it crashing but I think this is the right direction to investigate.<br>
><br>
><br>
> @David<br>
</div>> I know its much to ask but if you can spare some time to see the code and confirm it would be great help. You can find code here. <<a href="http://processors.wiki.ti.com/index.php/Installing_AM389x_C6A816x_DM816x_Crypto_Support" target="_blank">http://processors.wiki.ti.com/index.php/Installing_AM389x_C6A816x_DM816x_Crypto_Support</a>><br>
<br>
cryptodev will only ever do single block requests (1 entry in the SG list).<br>
So that might explain the different paths.<br></blockquote><div><font class="Apple-style-span" color="#006600"> Ok!</font> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
It seems that for short/unaligned/other border cases that all processing is<br>
dne by the CPu and not the crypto HW, so it may be that you are just not<br>
using the crypt HW ? </blockquote><div>I<font class="Apple-style-span" color="#006600">n which case? When I am testing H/W accelerators with cryptotest I can see visible drop in CPU usage from 97 % to 45 % so I assume H/W accelerator are working fine with OCF and cryptotest. In Netkey case Its crashing before I see debug info.</font></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Maybe if you changed the test with OCF you can still<br>
get it to fail as well ?<br></blockquote><div><font class="Apple-style-span" color="#006600">Will try this and update you</font>. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Track the code through to where it fails, it might be obvious :-)<br></blockquote><div><font class="Apple-style-span" color="#006600">Yeah! going that way but I am dealing many sub modules (openswan, ocf, cryapi, drivers) its hard to concentrate on one plus information on web on all is a real mess (limited, version problem, stale, incorrect) . Thanks to you guys I am able to make some progress</font>. </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Have you tried asking the Authors (<a href="mailto:herman@ti.com">herman@ti.com</a>), seems they might be<br>
interested in helping you as well :-)<br></blockquote><div><font class="Apple-style-span" color="#006600">Opened communication channel with TI. But that world is no Opensource. I know understand what I mean :) </font></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Cheers,<br>
<font color="#888888">David</font></blockquote><div><font class="Apple-style-span" color="#006600">Thanks again for useful input.</font></div><div><font class="Apple-style-span" color="#006600">-SP</font></div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">
--<br>
David McCullough, <a href="mailto:david_mccullough@mcafee.com">david_mccullough@mcafee.com</a>, Ph:+61 734352815<br>
McAfee - SnapGear <a href="http://www.mcafee.com" target="_blank">http://www.mcafee.com</a> <a href="http://www.uCdot.org" target="_blank">http://www.uCdot.org</a><br>
</div></div></blockquote></div><br>