Re: [Ocf-linux-users] ocf-linux-20071215's ixp4xx freeze as cryptotest with LinuxLink 2.6.16.11 and
Brought to you by:
david-m
From: David M. <Dav...@se...> - 2008-03-20 04:53:26
|
Jivin JUN J lays it down ... > Hi, I did tests by Intel's crypto codelets stuff and have the result in the > attachment crypto_codelets_4096_Mar19th.log > > And I turned the debug on of the NPE driver and added some > ixCryptoAccShow() functions to see the status of write queue and read > queue, > It seems like the write queue(29) is full while no one is > really draining it, > which leads to the "cannot allocate memory" error. > see attachment cryptotest.log Sounds like your access library code is a little mixed up. Are you loading the corrent NPE image with crypto ? If the codelets are having problems then I would guess something is wrong in there. Cheers, Davidm > David McCullough <Dav...@se...> wrote: > Jivin JUN J lays it down ... > > > > I just subscribed and not to follow the old discussions, sorry. > > No problems. See below. > > > Platform: Intel IXP425, LinuxLink 2.6.16.11, Intel Access Library With Crypto v2.4. > > ocf-linux-20071215 software. > > > > I did: > > insmod ixp400.ko > > cat IxNpeMicrocode.dat > /dev/ixNpe > > insmod ixp400_eth.ko > > > > (ethernet works fine) > > > > Then I did: > > # insmod /lib/modules/2.6.16.11/kernel/crypto/ocf/ocf.ko crypto_debug=1 > > > > crypto_init(0xbf1acbc8) > > crypto/ocf/crypto.c,1227:Q_LOCK() > > crypto_proc-sleeping(qe=1 qb=0 kqe=1 kqb=0) > > crypto/ocf/crypto.c,1374:Q_UNLOCK() > > crypto/ocf/crypto.c,1415:RETQ_LOCK > > crypto_ret_proc-sleeping > > crypto/ocf/crypto.c,1446: RETQ_UNLOCK > > > > > > # insmod /lib/modules/2.6.16.11/kernel/crypto/ocf/cryptodev.ko cryptodev_debug=1 > > > > cryptodev_init(bf1b7000) > > > > # insmod /lib/modules/2.6.16.11/kernel/crypto/ocf/ixp4xx/ixp4xx.ko ixp_debug=1 > > > > ixp_init(bf1b8270) > > crypto/ocf/crypto.c,469:DRIVER_LOCK() > > crypto/ocf/crypto.c,514:DRIVER_UNLOCK() > > crypto_register(id=0x0, alg=1, maxoplen=0, flags=0x0) > > crypto/ocf/crypto.c,619:DRIVER_LOCK() > > crypto/ocf/crypto.c,645:DRIVER_UNLOCK() > > crypto_register(id=0x0, alg=2, maxoplen=0, flags=0x0) > > crypto/ocf/crypto.c,619:DRIVER_LOCK() > > crypto/ocf/crypto.c,645:DRIVER_UNLOCK() > > crypto_register(id=0x0, alg=11, maxoplen=0, flags=0x0) > > crypto/ocf/crypto.c,619:DRIVER_LOCK() > > crypto/ocf/crypto.c,645:DRIVER_UNLOCK() > > crypto_register(id=0x0, alg=13, maxoplen=0, flags=0x0) > > crypto/ocf/crypto.c,619:DRIVER_LOCK() > > crypto/ocf/crypto.c,645:DRIVER_UNLOCK() > > crypto_register(id=0x0, alg=14, maxoplen=0, flags=0x0) > > crypto/ocf/crypto.c,619:DRIVER_LOCK() > > crypto/ocf/crypto.c,645:DRIVER_UNLOCK() > > crypto_register(id=0x0, alg=6, maxoplen=0, flags=0x0) > > crypto/ocf/crypto.c,619:DRIVER_LOCK() > > crypto/ocf/crypto.c,645:DRIVER_UNLOCK() > > crypto_register(id=0x0, alg=7, maxoplen=0, flags=0x0) > > crypto/ocf/crypto.c,619:DRIVER_LOCK() > > crypto/ocf/crypto.c,645: DRIVER_UNLOCK() > > > > > > > > At last I did: > > > > #cryptotest > > > > cryptodev_open() > > cryptodev_ioctl(cmd=c0046364 arg=bef84af4) > > cryptodev_ioctl(CRIOGET) > > cryptodev_ioctl(cmd=c030636a arg=bef84b3c) > > cryptodev_ioctl(CIOCGSESSION2) > > cryptodev_ioctl(CIOCGSESSION2) - no mac > > crypto/ocf/crypto.c,355: DRIVER_LOCK() > > crypto/ocf/crypto.c,379: DRIVER_UNLOCK() > > ixp_newsession():alg 2 > > crypto/ocf/crypto.c,381: DRIVER_LOCK() > > crypto/ocf/crypto.c,391: DRIVER_UNLOCK() > > csecreate() > > cseadd() > > cryptodev_ioctl(cmd=c01c6367 arg=bef84b20) > > cryptodev_ioctl(CIOCCRYPT) > > csefind() > > cryptodev_op() > > crypto_dispatch() > > crypto_invoke() > > ixp_process() > > cryptodev_op about to WAIT > > ixp_register_cb(999, 00000000, 0) > > ixp_process_pending(c2885000) > > ixp_q_process(c2e5a9e0) > > > > (freezed here) > > > > ___________________________________________________________________ > > > > I tracked down the source a little and found that it was waiting for the crp_flags > > to be set to CRYPTO_F_DONE around line 310 in crypto/ocf/cryptodev.c. > > And I found there's only one function: > > void crypto_done(struct cryptop *crp); > > to set crp_flags to CRYPTO_F_DONE. > > (Ctrl-c also sends signal to break out the loop but it's been disabled intently.) > > > > > > >From the debug output of ixp4xx.ko I followed the last function ixp_q_process() > > and saw it returned successfully with IX_CRYPTO_ACC_STATUS_SUCCESS == status > > (line 550 in crypto/ocf/ixp4xx/ixp4xx.c) ... > > which means crypto_done() has never been called since the request was sent to > > NPE stuff regardless of the ixCryptoAcc.... function returned successfully. > > > > I don't understand. Actually I met this situation when I was tring to integrate > > MontaVista4.01 plus NPE v2.3 and ocf-linux ... > > > > Any suggestion or hints would be appreciated, thank you very much. > > Thanks for all the detail, makes it easy for see what is happening ;-) > > It looks fairly simple, try the attached "untested" patch and see how you go. > > Somehow you have generated a request that does not call back through the > ixp_perform_cb or ixp_hash_perform_cb routines. Obviously we hadn't hit > that one before. Of course all we had to do was run cryptotest without > args, but that is obviously too hard :-) :-) > > Cheers, > Davidm > > > -- > David McCullough, dav...@se..., Ph:+61 734352815 > Secure Computing - SnapGear http://www.uCdot.org http://www.cyberguard.com > Index: ocf/ixp4xx/ixp4xx.c > =================================================================== > RCS file: ocf/ixp4xx/ixp4xx.c,v > retrieving revision 1.46 > diff -u -r1.46 ixp4xx.c > --- ocf/ixp4xx/ixp4xx.c 12 Oct 2007 01:10:31 -0000 1.46 > +++ ocf/ixp4xx/ixp4xx.c 18 Mar 2008 04:48:30 -0000 > @@ -547,16 +547,15 @@ > q->ixp_q_iv); > } > > - if (IX_CRYPTO_ACC_STATUS_SUCCESS == status) > - return; > - > if (IX_CRYPTO_ACC_STATUS_QUEUE_FULL == status) { > q->ixp_q_crp->crp_etype = ENOMEM; > goto done; > } > > - printk("ixp: %s failed %u\n", crypt_func, status); > - q->ixp_q_crp->crp_etype = EINVAL; > + if (IX_CRYPTO_ACC_STATUS_SUCCESS != status) { > + printk("ixp: %s failed %u\n", crypt_func, status); > + q->ixp_q_crp->crp_etype = EINVAL; > + } > > done: > crypto_done(q->ixp_q_crp); > > > > --------------------------------- > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. -- David McCullough, dav...@se..., Ph:+61 734352815 Secure Computing - SnapGear http://www.uCdot.org http://www.cyberguard.com |