Re: [Ocf-linux-users] OCF driver for Marvell Kirkwood (88F6xxx) Processors
Brought to you by:
david-m
From: Flaig, P. <Pat...@bd...> - 2010-08-17 06:59:08
|
Hi David, Thanks for the feedback, ok now I know that cannot reference "/proc/crypto" for OCF details. But how can I check if the hardware driver is used or loaded? As said when I try to use an AES CBC algorithm with the Feroceon driver I'm getting in invalid argument error. --- /* Get crypto session for AES128 */ sess.cipher = CRYPTO_AES_CBC; sess.keylen = KEY_SIZE; sess.key = key; if (ioctl(cfd, CIOCGSESSION, &sess)) { perror("ioctl(CIOCGSESSION)"); return 1; } --- With the software driver no problem! Some time ago I did some measurements with the original Marvell SDK Kernel for the Feroceon. Without HW driver I was able to encrypt about 9 MB/s, with HW support 36 MB/s. If I now do the same measurements again with loaded SW and HW driver I'm only getting a rate about 9 MB/s, which leads to the speculation that only the software driver is working. Is there a way to check if the hardware driver is working? Patrick -----Original Message----- From: David McCullough [mailto:dav...@mc...] Sent: Tuesday, August 17, 2010 1:24 AM To: Flaig, Patrick Cc: ocf...@li... Subject: Re: [Ocf-linux-users] OCF driver for Marvell Kirkwood (88F6xxx) Processors Jivin Flaig, Patrick lays it down ... > Hi David, > > Thanks a lot, the additional lines in the Makefile let me compile the Feroceon driver. > > I've now compiled the OCF module and the driver directly into the kernel. > > I think I've now an understanding problem, how to configure OCF the right way. > Do I have to configure the cryptographic API as well, with all the algorithms I want? > How can I make sure that, if I have selected AES for example, the hardware acceleration is used? > /proc/crypto is only showing module: kernel. OCF doesn't register with /proc/crypto as it is not part of the kernel crypto. If you only have one OCF driver loaded then only that option can be used. OCF, by default, preferrs HW drivers over SW drivers. Of source this only matters if you have more than one OCF crypto driver loaded, and one is SW. Jivin Flaig, Patrick lays it down ... > Hi David, > > I tried to do some measurements with the Feroceon driver and run into some problems. > It seems the hardware support is not fully working. > > I configured OCF to use the CRYPTOSOFT driver and run a little test application, everything works fine. > But when I disabled the CRYPTOSOFT driver and enabled the FEROCEON driver, my test failed with an "ioctl(CIOCGSESSION): Invalid argument" error. > > --- > /* Get crypto session for AES128 */ > sess.cipher = CRYPTO_AES_CBC; > sess.keylen = KEY_SIZE; > sess.key = key; > if (ioctl(cfd, CIOCGSESSION, &sess)) { > perror("ioctl(CIOCGSESSION)"); > return 1; > } > --- > > For me this looks like the driver is not loaded. > Did I forget to configure something? This sounds like either the driver is not loaded and registered properly. You said you have compiled everytihng into the kernel ? It might be easier to use modules so you can debug it more easily (add trace etc). Try turning on debug in the ocf and crypto drivers before you load your driver. echo 1 > /sys/module/ocf/parameters/crypto_debug echo 1 > /sys/module/cryptodev/parameters/cryptodev_debug Make sure your driver is registering with OCF for the alg's you want. > How will OCF handle algorithms that are not supported by the hardware, will the OCF switch to the kernel algorithm? No, OCF has no fall back, it can only use the drivers that you have loaded. If you want it to fall back to kernel SW versions you need to load cryptosoft. OCF will use HW versions in preference to SW versions. > Do I have to enable the CRYPTOSOFT in combination with the hardware driver? No. And while you are debugging your driver I recommend only loading one driver (feroceon). Get the cryptotest app that in bundled in with the OCF release and use that to test your OCF driver. It can do everything you need to help debug the driver and is very simple code that talks direct to OCF via /dev/crypto. Cheers, Davidm -- David McCullough, dav...@mc..., Ph:+61 734352815 McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org |