DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] building l2fwd-crypto example from Makefile
@ 2021-02-07  9:16 mirzaei.reza
  2021-02-07 10:26 ` David Marchand
  2021-02-08 16:37 ` Bruce Richardson
  0 siblings, 2 replies; 3+ messages in thread
From: mirzaei.reza @ 2021-02-07  9:16 UTC (permalink / raw)
  To: dev

Hello, 

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? 

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 

Thanks in advance 

Links:
------
[1] https://doc.dpdk.org/guides-20.11/cryptodevs/aesni_gcm.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] building l2fwd-crypto example from Makefile
  2021-02-07  9:16 [dpdk-dev] building l2fwd-crypto example from Makefile mirzaei.reza
@ 2021-02-07 10:26 ` David Marchand
  2021-02-08 16:37 ` Bruce Richardson
  1 sibling, 0 replies; 3+ messages in thread
From: David Marchand @ 2021-02-07 10:26 UTC (permalink / raw)
  To: mirzaei.reza; +Cc: dev

On Sun, Feb 7, 2021 at 10:17 AM mirzaei.reza <mirzaei.reza@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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] building l2fwd-crypto example from Makefile
  2021-02-07  9:16 [dpdk-dev] building l2fwd-crypto example from Makefile mirzaei.reza
  2021-02-07 10:26 ` David Marchand
@ 2021-02-08 16:37 ` Bruce Richardson
  1 sibling, 0 replies; 3+ messages in thread
From: Bruce Richardson @ 2021-02-08 16:37 UTC (permalink / raw)
  To: mirzaei.reza; +Cc: dev

On Sun, Feb 07, 2021 at 12:46:50PM +0330, mirzaei.reza wrote:
> Hello, 
> 
> 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? 
> 
> 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 
> 
> Thanks in advance 
>

As well as the response David provided which is pretty comprehensive, I
have just today hit some similar issues when trying to run a shared-linked
DPDK app, even when DPDK was installed system-wide. If you install DPDK in
e.g. /usr/local on your system and still see issues, can you perhaps test out
patch http://patches.dpdk.org/patch/87823/ and see if it helps.

Regards,
/Bruce

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-08 16:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-07  9:16 [dpdk-dev] building l2fwd-crypto example from Makefile mirzaei.reza
2021-02-07 10:26 ` David Marchand
2021-02-08 16:37 ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).