[dpdk-dev] building l2fwd-crypto example from Makefile

David Marchand david.marchand at redhat.com
Sun Feb 7 11:26:57 CET 2021


On Sun, Feb 7, 2021 at 10:17 AM mirzaei.reza <mirzaei.reza at ut.ac.ir> wrote:
> I have a problem to build l2fwd-crypto example using its Makefile. I
> build it using Makefile according to this [1] tutorial, when i run the
> compiled file using the following command:
>
> ./l2fwd-crypto -l 1 -n 4
> --vdev="crypto_aesni_mb,socket_id=0,max_nb_sessions=128" \
> -- -p 1 --cdev SW --chain CIPHER_HASH --cipher_algo "aes-cbc"
> --auth_algo "sha1-hmac"
>
> I get the follwing error:
>
> EAL: Detected 16 lcore(s)
> EAL: Detected 1 NUMA nodes
> EAL: FAILED TO PARSE DEVICE "CRYPTO_AESNI_GCM"
> EAL: UNABLE TO PARSE DEVICE
> 'CRYPTO_AESNI_GCM,SOCKET_ID=0,MAX_NB_SESSIONS=128'
> EAL: ERROR - EXITING WITH CODE: 1
>   CAUSE: INVALID EAL ARGUMENTS
>
> Could anyone help me to solve this problem?

(odd that everything is in capital letters :-))

No driver for this device has been found.

You probably did not install dpdk system-wide and you are trying to
start a dynamically linked example binary.


Using make for compiling examples, you get a dynamically linked
application by default.

$ ls -l build/
total 84
lrwxrwxrwx 1 dmarchan dmarchan    19 Feb  7 04:46 l2fwd-crypto ->
l2fwd-crypto-shared
-rwxrwxr-x 1 dmarchan dmarchan 83856 Feb  7 04:46 l2fwd-crypto-shared

If you try to list available drivers for this example, I suspect you
will find none:
$ ./usertools/dpdk-pmdinfo.py /path/to/build/l2fwd-crypto-shared

This tool inspects the binary itself and its dynamic dependencies
trying to find the EAL DPDK_PLUGIN_PATH internal setting.
$ strings /path/to/librte_eal.so |grep DPDK_PLUGIN
DPDK_PLUGIN_PATH=/usr/local/lib/dpdk/pmds-21.1
That's where drivers are automatically loaded from.


There are different solutions:
- you can install dpdk on this system and let EAL automatically load
all available drivers,
- you can keep your local build, and explicitly ask for loading the
drivers you need. Here, that would mean adding -d
/path/to/librte_crypto_aesni_gcm.so before the --vdev option),
- you can build a static binary that will get all drivers embedded
(static target in your make command line for l2fwd-crypto
compilation).


>
> It's worth to noting that when i build it using meson and ninja as the
> following, it works successfuly.
>
> meson -Dexamples=l2fwd-crypto build

By default, you get statically linked binaries with meson (this can be
changed by passing --default-library=shared).

Running the command from above, you probably get a lot of drivers
embedded in your example app binary.

Example with l3fwd from my env:
$ ./usertools/dpdk-pmdinfo.py /path/to/examples/dpdk-l3fwd |grep crypto_aesni
PMD NAME: crypto_aesni_gcm
PMD NAME: crypto_aesni_mb


-- 
David Marchand



More information about the dev mailing list