xref: /dpdk/doc/guides/cryptodevs/null.rst (revision 8809f78c7dd9f33a44a4f89c58fc91ded34296ed)
15630257fSFerruh Yigit..  SPDX-License-Identifier: BSD-3-Clause
25630257fSFerruh Yigit    Copyright(c) 2016 Intel Corporation.
394b0ad8eSDeclan Doherty
457cfab87SPablo de LaraNull Crypto Poll Mode Driver
594b0ad8eSDeclan Doherty============================
694b0ad8eSDeclan Doherty
7*8809f78cSBruce RichardsonThe Null Crypto PMD (**librte_crypto_null**) provides a crypto poll mode
894b0ad8eSDeclan Dohertydriver which provides a minimal implementation for a software crypto device. As
994b0ad8eSDeclan Dohertya null device it does not modify the data in the mbuf on which the crypto
1094b0ad8eSDeclan Dohertyoperation is to operate and it only has support for a single cipher and
1194b0ad8eSDeclan Dohertyauthentication algorithm.
1294b0ad8eSDeclan Doherty
1394b0ad8eSDeclan DohertyWhen a burst of mbufs is submitted to a Null Crypto PMD for processing then
1494b0ad8eSDeclan Dohertyeach mbuf in the burst will be enqueued in an internal buffer for collection on
1594b0ad8eSDeclan Dohertya dequeue call as long as the mbuf has a valid rte_mbuf_offload operation with
1694b0ad8eSDeclan Dohertya valid rte_cryptodev_session or rte_crypto_xform chain of operations.
1794b0ad8eSDeclan Doherty
1894b0ad8eSDeclan DohertyFeatures
1994b0ad8eSDeclan Doherty--------
2094b0ad8eSDeclan Doherty
2194b0ad8eSDeclan DohertyModes:
2294b0ad8eSDeclan Doherty
2394b0ad8eSDeclan Doherty* RTE_CRYPTO_XFORM_CIPHER ONLY
2494b0ad8eSDeclan Doherty* RTE_CRYPTO_XFORM_AUTH ONLY
2594b0ad8eSDeclan Doherty* RTE_CRYPTO_XFORM_CIPHER THEN RTE_CRYPTO_XFORM_AUTH
2694b0ad8eSDeclan Doherty* RTE_CRYPTO_XFORM_AUTH THEN RTE_CRYPTO_XFORM_CIPHER
2794b0ad8eSDeclan Doherty
2894b0ad8eSDeclan DohertyCipher algorithms:
2994b0ad8eSDeclan Doherty
3094b0ad8eSDeclan Doherty* RTE_CRYPTO_CIPHER_NULL
3194b0ad8eSDeclan Doherty
3294b0ad8eSDeclan DohertyAuthentication algorithms:
3394b0ad8eSDeclan Doherty
3494b0ad8eSDeclan Doherty* RTE_CRYPTO_AUTH_NULL
3594b0ad8eSDeclan Doherty
3694b0ad8eSDeclan DohertyLimitations
3794b0ad8eSDeclan Doherty-----------
3894b0ad8eSDeclan Doherty
3994b0ad8eSDeclan Doherty* Only in-place is currently supported (destination address is the same as
4094b0ad8eSDeclan Doherty  source address).
4194b0ad8eSDeclan Doherty
4294b0ad8eSDeclan DohertyInstallation
4394b0ad8eSDeclan Doherty------------
4494b0ad8eSDeclan Doherty
4594b0ad8eSDeclan DohertyThe Null Crypto PMD is enabled and built by default in both the Linux and
4694b0ad8eSDeclan DohertyFreeBSD builds.
47b7d65109SPablo de Lara
48b7d65109SPablo de LaraInitialization
49b7d65109SPablo de Lara--------------
50b7d65109SPablo de Lara
51b7d65109SPablo de LaraTo use the PMD in an application, user must:
52b7d65109SPablo de Lara
532f6fec53SThomas Monjalon* Call rte_vdev_init("crypto_null") within the application.
54b7d65109SPablo de Lara
552f6fec53SThomas Monjalon* Use --vdev="crypto_null" in the EAL options, which will call rte_vdev_init() internally.
56b7d65109SPablo de Lara
57b7d65109SPablo de LaraThe following parameters (all optional) can be provided in the previous two calls:
58b7d65109SPablo de Lara
59b7d65109SPablo de Lara* socket_id: Specify the socket where the memory for the device is going to be allocated
60b7d65109SPablo de Lara  (by default, socket_id will be the socket where the core that is creating the PMD is running on).
61b7d65109SPablo de Lara
62b7d65109SPablo de Lara* max_nb_queue_pairs: Specify the maximum number of queue pairs in the device (8 by default).
63b7d65109SPablo de Lara
64b7d65109SPablo de Lara* max_nb_sessions: Specify the maximum number of sessions that can be created (2048 by default).
65b7d65109SPablo de Lara
66b7d65109SPablo de LaraExample:
67b7d65109SPablo de Lara
68b7d65109SPablo de Lara.. code-block:: console
69b7d65109SPablo de Lara
70fd5f9fb9SCiara Power    ./dpdk-l2fwd-crypto -l 1 -n 4 --vdev="crypto_null,socket_id=0,max_nb_sessions=128" \
71fda78c51SPablo de Lara    -- -p 1 --cdev SW --chain CIPHER_ONLY --cipher_algo "null"
72