DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: "mirzaei.reza" <mirzaei.reza@ut.ac.ir>
Cc: dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] building l2fwd-crypto example from Makefile
Date: Sun, 7 Feb 2021 11:26:57 +0100	[thread overview]
Message-ID: <CAJFAV8zi9q7CKX58mBzByP_dmzcE5XJiwDq6VQmT=CVdB2ZGGw@mail.gmail.com> (raw)
In-Reply-To: <85f763d093a3d6e5a7a73f8eee9aa0c1@ut.ac.ir>

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


  reply	other threads:[~2021-02-07 10:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07  9:16 mirzaei.reza
2021-02-07 10:26 ` David Marchand [this message]
2021-02-08 16:37 ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJFAV8zi9q7CKX58mBzByP_dmzcE5XJiwDq6VQmT=CVdB2ZGGw@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=mirzaei.reza@ut.ac.ir \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).