[Openswan Users] Netkey + Openswan + OCF && H/W accelerators drivers == kernel crash/panic

David McCullough david_mccullough at mcafee.com
Mon Oct 17 00:51:34 EDT 2011


Jivin satpal parmar lays it down ...
...
> 	That's something for the driver writers or the kernel people....
> 	
> 
>  
> I made some progress in my investigation here. It seems there is a bug in driver (drivers/crypto/nss-sham.c)
> 
> 
> static int nss_sham_update_cdma_start(struct nss_sham_dev *dd)
> {
>         struct nss_sham_reqctx *ctx = ahash_request_ctx(dd->req);
>         unsigned int length, final, tail;
>         struct scatterlist *sg;
> 
> 
>         if (!ctx->total)
>                 return 0;
> 
> 
>         if (ctx->bufcnt || ctx->offset)
>        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 
> 
> 
>      if (!dma_map_sg(dd->dev, ctx->sg, 1, DMA_TO_DEVICE)) {
>                 dev_err(dd->dev, "dma_map_sg  error\n");
>                 return -EINVAL;
>  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.
> 
> 
> @David 
> 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. <http://processors.wiki.ti.com/index.php/Installing_AM389x_C6A816x_DM816x_Crypto_Support> 

cryptodev will only ever do single block requests (1 entry in the SG list).
So that might explain the different paths.

It seems that for short/unaligned/other border cases that all processing is
dne by the CPu and not the crypto HW,  so it may be that you are just not
using the crypt HW ?  Maybe if you changed the test with OCF you can still
get it to fail as well ?

Track the code through to where it fails, it might be obvious :-)
Have you tried asking the Authors (herman at ti.com), seems they might be
interested in helping you as well :-)

Cheers,
David

-- 
David McCullough,      david_mccullough at mcafee.com,  Ph:+61 734352815
McAfee - SnapGear      http://www.mcafee.com         http://www.uCdot.org


More information about the Users mailing list