This patch adds documents and release notes<br />about compressdev and cryptodev.<br /> <br />Signed-off-by: Hanxiao Li <li.hanxiao@zte.com.cn> <br />---<br /> doc/guides/compressdevs/features/zsda.ini |  15 ++<br /> doc/guides/compressdevs/index.rst         |   1 +<br /> doc/guides/compressdevs/zsda.rst          |  45 ++++<br /> doc/guides/cryptodevs/features/zsda.ini   |  53 +++++<br /> doc/guides/cryptodevs/index.rst           |   1 +<br /> doc/guides/cryptodevs/zsda.rst            | 260 ++++++++++++++++++++++<br /> doc/guides/rel_notes/release_24_11.rst    |   8 +<br /> 7 files changed, 383 insertions(+)<br /> create mode 100644 doc/guides/compressdevs/features/zsda.ini<br /> create mode 100644 doc/guides/compressdevs/zsda.rst<br /> create mode 100644 doc/guides/cryptodevs/features/zsda.ini<br /> create mode 100644 doc/guides/cryptodevs/zsda.rst<br /> <br />diff --git a/doc/guides/compressdevs/features/zsda.ini b/doc/guides/compressdevs/features/zsda.ini<br />new file mode 100644<br />index 0000000000..3b087ea7f9<br />--- /dev/null<br />+++ b/doc/guides/compressdevs/features/zsda.ini<br />@@ -0,0 +1,15 @@<br />+;<br />+; Refer to default.ini for the full list of available PMD features.<br />+;<br />+; Supported features of 'ZSDA' compression driver.<br />+;<br />+[Features]<br />+HW Accelerated         = Y<br />+OOP SGL In SGL Out     = Y<br />+OOP SGL In LB  Out     = Y<br />+OOP LB  In SGL Out     = Y<br />+Deflate                = Y<br />+Adler32                = Y<br />+Crc32                  = Y<br />+Fixed                  = Y<br />+Dynamic                = Y<br />diff --git a/doc/guides/compressdevs/index.rst b/doc/guides/compressdevs/index.rst<br />index 87ed4f72a4..bab226ffbc 100644<br />--- a/doc/guides/compressdevs/index.rst<br />+++ b/doc/guides/compressdevs/index.rst<br />@@ -17,3 +17,4 @@ Compression Device Drivers<br />     qat_comp<br />     uadk<br />     zlib<br />+    zsda<br />diff --git a/doc/guides/compressdevs/zsda.rst b/doc/guides/compressdevs/zsda.rst<br />new file mode 100644<br />index 0000000000..2d0737e4ba<br />--- /dev/null<br />+++ b/doc/guides/compressdevs/zsda.rst<br />@@ -0,0 +1,45 @@<br />+..  SPDX-License-Identifier: BSD-3-Clause<br />+    Copyright(c) 2024 ZTE Corporation.<br />+<br />+ZTE Storage Data Accelerator (ZSDA) Poll Mode Driver<br />+=======================================================<br />+<br />+The ZSDA compression PMD provides poll mode compression & decompression driver<br />+support for the following hardware accelerator devices:<br />+<br />+* ``ZTE Processing accelerators 1cf2``<br />+<br />+<br />+Features<br />+--------<br />+<br />+ZSDA compression PMD has support for:<br />+<br />+Compression/Decompression algorithm:<br />+<br />+    * DEFLATE - using Fixed and Dynamic Huffman encoding<br />+<br />+Checksum generation:<br />+<br />+    * CRC32, Adler32<br />+<br />+Huffman code type:<br />+<br />+* FIXED<br />+* DYNAMIC<br />+<br />+<br />+Limitations<br />+-----------<br />+<br />+* Compressdev level 0, no compression, is not supported.<br />+* No BSD support as BSD ZSDA kernel driver not available.<br />+* Stateful is not supported.<br />+<br />+<br />+Installation<br />+------------<br />+<br />+The ZSDA compression PMD is built by default with a standard DPDK build.<br />+<br />+It depends on a ZSDA kernel driver, see :ref:`building_zsda`.<br />\ No newline at end of file<br />diff --git a/doc/guides/cryptodevs/features/zsda.ini b/doc/guides/cryptodevs/features/zsda.ini<br />new file mode 100644<br />index 0000000000..efa33fbf3c<br />--- /dev/null<br />+++ b/doc/guides/cryptodevs/features/zsda.ini<br />@@ -0,0 +1,53 @@<br />+;<br />+; Supported features of the 'zsda' crypto driver.<br />+;<br />+; Refer to default.ini for the full list of available PMD features.<br />+;<br />+[Features]<br />+Symmetric crypto       = Y<br />+HW Accelerated         = Y<br />+Protocol offload       = Y<br />+In Place SGL           = Y<br />+OOP SGL In SGL Out     = Y<br />+OOP SGL In LB  Out     = Y<br />+OOP LB  In SGL Out     = Y<br />+OOP LB  In LB  Out     = Y<br />+Digest encrypted       = Y<br />+Sym raw data path API  = Y<br />+<br />+;<br />+; Supported crypto algorithms of the 'zsda' crypto driver.<br />+;<br />+[Cipher]<br />+NULL           = Y<br />+AES XTS (128)  = Y<br />+AES XTS (256)  = Y<br />+SM4 AES        = Y<br />+;<br />+; Supported authentication algorithms of the 'zsda' crypto driver.<br />+;<br />+[Auth]<br />+NULL         = Y<br />+SHA1         = Y<br />+SHA224       = Y<br />+SHA256       = Y<br />+SHA384       = Y<br />+SHA512       = Y<br />+SM3          = Y<br />+<br />+;<br />+; Supported AEAD algorithms of the 'zsda' crypto driver.<br />+;<br />+[AEAD]<br />+<br />+<br />+;<br />+; Supported Asymmetric algorithms of the 'zsda' crypto driver.<br />+;<br />+[Asymmetric]<br />+<br />+;<br />+; Supported Operating systems of the 'zsda' crypto driver.<br />+;<br />+[OS]<br />+Linux = Y<br />diff --git a/doc/guides/cryptodevs/index.rst b/doc/guides/cryptodevs/index.rst<br />index 1e57a9fe86..be2620f185 100644<br />--- a/doc/guides/cryptodevs/index.rst<br />+++ b/doc/guides/cryptodevs/index.rst<br />@@ -34,3 +34,4 @@ Crypto Device Drivers<br />     uadk<br />     virtio<br />     zuc<br />+    zsda<br />diff --git a/doc/guides/cryptodevs/zsda.rst b/doc/guides/cryptodevs/zsda.rst<br />new file mode 100644<br />index 0000000000..fa6015182d<br />--- /dev/null<br />+++ b/doc/guides/cryptodevs/zsda.rst<br />@@ -0,0 +1,260 @@<br />+..  SPDX-License-Identifier: BSD-3-Clause<br />+    Copyright(c) 2024 ZTE Corporation.<br />+<br />+ZTE Storage Data Accelerator (ZSDA) Poll Mode Driver<br />+==================================================<br />+<br />+ZSDA documentation consists of three parts:<br />+<br />+* Details of the symmetric crypto services below.<br />+* Details of the :doc:`compression service <../compressdevs/zsda>`<br />+  in the compressdev drivers section.<br />+* Details of building the common ZSDA infrastructure and the PMDs to support the<br />+  above services. See :ref:`building_zsda` below.<br />+<br />+<br />+Symmetric Crypto Service on ZSDA<br />+-------------------------------<br />+<br />+The ZSDA symmetric crypto PMD provides poll mode crypto driver<br />+support for the following hardware accelerator devices:<br />+<br />+* ``ZTE Processing accelerators 1cf2``<br />+<br />+Features<br />+~~~~~~~~<br />+<br />+The ZSDA SYM PMD has support for:<br />+<br />+Cipher algorithms:<br />+<br />+* ``RTE_CRYPTO_CIPHER_AES_XTS``<br />+* ``RTE_CRYPTO_CIPHER_SM4_XTS``<br />+<br />+Hash algorithms:<br />+<br />+* ``RTE_CRYPTO_AUTH_SHA1``<br />+* ``RTE_CRYPTO_AUTH_SHA224``<br />+* ``RTE_CRYPTO_AUTH_SHA256``<br />+* ``RTE_CRYPTO_AUTH_SHA384``<br />+* ``RTE_CRYPTO_AUTH_SHA512``<br />+* ``RTE_CRYPTO_AUTH_SM3``<br />+<br />+Limitations<br />+~~~~~~~~~~~<br />+<br />+* Only supports the session-oriented API implementation (session-less APIs are not supported).<br />+* No BSD support as BSD ZSDA kernel driver not available.<br />+<br />+* Queue-pairs are thread-safe on Intel CPUs but Queues are not (that is, within a single<br />+  queue-pair all enqueues to the TX queue must be done from one thread and all dequeues<br />+  from the RX queue must be done from one thread, but enqueues and dequeues may be done<br />+  in different threads.)<br />+<br />+<br />+.. _building_zsda:<br />+<br />+Building PMDs on ZSDA<br />+--------------------<br />+<br />+A ZSDA device can host multiple acceleration services:<br />+<br />+* symmetric cryptography<br />+* data compression<br />+<br />+These services are provided to DPDK applications via PMDs which register to<br />+implement the corresponding cryptodev and compressdev APIs. The PMDs use<br />+common ZSDA driver code which manages the ZSDA PCI device.<br />+<br />+<br />+Configuring and Building the DPDK ZSDA PMDs<br />+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />+<br />+<br />+Further information on configuring, building and installing DPDK is described<br />+:doc:`here <../linux_gsg/build_dpdk>`.<br />+<br />+.. _building_zsda_config:<br />+<br />+Build Configuration<br />+~~~~~~~~~~~~~~~~~~~<br />+These is the build configuration options affecting ZSDA, and its default values:<br />+<br />+.. code-block:: console<br />+<br />+    RTE_PMD_ZSDA_MAX_PCI_DEVICES=256<br />+<br />+ZSDA SYM PMD has an external dependency on libcrypto, so is not built by default.<br />+<br />+Ubuntu<br />+<br />+.. code-block:: console<br />+<br />+   apt install libssl-dev<br />+<br />+RHEL<br />+<br />+.. code-block:: console<br />+<br />+   dnf install openssl-devel<br />+<br />+The ZSDA compressdev PMD has no external dependencies, so is built by default.<br />+<br />+<br />+Device and driver naming<br />+~~~~~~~~~~~~~~~~~~~~~~~~<br />+<br />+* The zsda cryptodev symmetric crypto driver name is "crypto_zsda".<br />+* The zsda compressdev compress driver name is "compress_zsda".<br />+<br />+The "rte_cryptodev_devices_get()" returns the devices exposed by either of these drivers.<br />+<br />+* Each zsda sym crypto device has a unique name, in format<br />+  "<pci bdf>", e.g. "0000:cc:00.3_zsda".<br />+  This name can be passed to "rte_cryptodev_get_dev_id()" to get the device_id.<br />+<br />+.. Note::<br />+<br />+    The cryptodev driver name is passed to the dpdk-test-crypto-perf tool in the "-devtype" parameter.<br />+<br />+    The zsda crypto device name is in the format of the worker parameter passed to the crypto scheduler.<br />+<br />+* The zsda compressdev driver name is "compress_zsda".<br />+  The rte_compressdev_devices_get() returns the devices exposed by this driver.<br />+<br />+* Each zsda compression device has a unique name, in format<br />+  <pci bdf>, e.g. "0000:cc:00.3_zsda".<br />+  This name can be passed to rte_compressdev_get_dev_id() to get the device_id.<br />+<br />+<br />+Enable VFs<br />+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />+<br />+Instructions for installation are below, but first an explanation of the<br />+relationships between the PF/VF devices and the PMDs visible to<br />+DPDK applications.<br />+<br />+Each ZSDA PF device exposes a number of VF devices. Each VF device can<br />+enable one symmetric cryptodev PMD and/or one compressdev PMD.<br />+<br />+These ZSDA PMDs share the same underlying device and pci-mgmt code, but are<br />+enumerated independently on their respective APIs and appear as independent<br />+devices to applications.<br />+.. Note::<br />+<br />+   Each VF can only be used by one DPDK process. It is not possible to share<br />+   the same VF across multiple processes, even if these processes are using<br />+   different acceleration services.<br />+   Conversely one DPDK process can use one or more ZSDA VFs and can expose both<br />+   cryptodev and compressdev instances on each of those VFs.<br />+<br />+<br />+The examples below are based on the 1cf2 device, if you have a different device<br />+use the corresponding values in the above table.<br />+<br />+In BIOS ensure that SRIOV is enabled and either:<br />+<br />+* Disable VT-d or<br />+* Enable VT-d and set ``"intel_iommu=on iommu=pt"`` in the grub file.<br />+<br />+you need to expose the Virtual Functions (VFs) using the sysfs file system.<br />+<br />+First find the BDFs (Bus-Device-Function) of the physical functions (PFs) of<br />+your device, e.g.::<br />+<br />+    lspci -d:8050<br />+<br />+You should see output similar to::<br />+<br />+<br />+    cc:00.4 Processing accelerators: Device 1cf2:8050 (rev 01)<br />+    ce:00.3 Processing accelerators: Device 1cf2:8050 (rev 01)<br />+    d0:00.3 Processing accelerators: Device 1cf2:8050 (rev 01)<br />+    d2:00.3 Processing accelerators: Device 1cf2:8050 (rev 01)<br />+<br />+Enable the VFs for each PF by echoing the number of VFs per PF to the pci driver::<br />+<br />+     echo 31 > /sys/bus/pci/device/0000:cc:00.4/sriov_numvfs<br />+     echo 31 > /sys/bus/pci/device/0000:ce:00.3/sriov_numvfs<br />+     echo 31 > /sys/bus/pci/device/0000:d0:00.3/sriov_numvfs<br />+     echo 31 > /sys/bus/pci/device/0000:d2:00.3/sriov_numvfs<br />+<br />+Check that the VFs are available for use. For example ``lspci -d:8051`` should<br />+list 124 VF devices available.<br />+<br />+To complete the installation follow the instructions in<br />+`Binding the available VFs to the vfio-pci driver`_.<br />+<br />+.. Note::<br />+<br />+   If you see the following warning in ``/var/log/messages`` it can be ignored:<br />+   ``IOMMU should be enabled for SR-IOV to work correctly``.<br />+<br />+Binding the available VFs to the vfio-pci driver<br />+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />+<br />+Note:<br />+<br />+* Please note that due to security issues, the usage of older DPDK igb_uio<br />+  driver is not recommended. This document shows how to use the more secure<br />+  vfio-pci driver.<br />+<br />+Unbind the VFs from the stock driver so they can be bound to the vfio-pci driver.<br />+<br />+Bind to the vfio-pci driver<br />+^^^^^^^^^^^^^^^^^^^^^^^^^^^<br />+<br />+Load the vfio-pci driver, bind the VF PCI Device id to it using the<br />+``dpdk-devbind.py`` script then use the ``--status`` option<br />+to confirm the VF devices are now in use by vfio-pci kernel driver,<br />+e.g. for the 1cf2 device::<br />+<br />+    cd to the top-level DPDK directory<br />+    modprobe vfio-pci<br />+    usertools/dpdk-devbind.py -b vfio-pci 0000:cc:01.4<br />+    usertools/dpdk-devbind.py --status<br />+<br />+Use ``modprobe vfio-pci disable_denylist=1`` from kernel 5.9 onwards.<br />+See note in the section `Binding the available VFs to the vfio-pci driver`_<br />+above.<br />+<br />+Testing<br />+~~~~~~~<br />+<br />+ZSDA SYM crypto PMD can be tested by running the test application::<br />+<br />+    cd ./<build_dir>/app/test<br />+    ./dpdk-test -l1 -n1 -a <your zsda bdf> <br />+    RTE>>cryptodev_zsda_autotest<br />+<br />+ZSDA compression PMD can be tested by running the test application::<br />+<br />+    cd ./<build_dir>/app/test<br />+    ./dpdk-test -l1 -n1 -a <your zsda bdf> <br />+    RTE>>compressdev_autotest<br />+<br />+<br />+Debugging<br />+~~~~~~~~~<br />+<br />+There are 2 sets of trace available via the dynamic logging feature:<br />+<br />+* pmd.zsda.dp exposes trace on the data-path.<br />+* pmd.zsda.general exposes all other trace.<br />+<br />+pmd.zsda exposes both sets of traces.<br />+They can be enabled using the log-level option (where 8=maximum log level) on<br />+the process cmdline, e.g. using any of the following::<br />+<br />+    --log-level="pmd.zsda.general,8" <br />+    --log-level="pmd.zsda.dp,8" <br />+<br />+.. Note::<br />+<br />+    The global RTE_LOG_DP_LEVEL overrides data-path trace so must be set to<br />+    RTE_LOG_DEBUG to see all the trace. This variable is in config/rte_config.h<br />+    for meson build.<br />+    Also the dynamic global log level overrides both sets of trace, so e.g. no<br />+    ZSDA trace would display in this case::<br />+<br />+    --log-level="pmd.zsda.general,8" --log-level="pmd.zsda,8" <br />diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst<br />index 0ff70d9057..4b666d3e79 100644<br />--- a/doc/guides/rel_notes/release_24_11.rst<br />+++ b/doc/guides/rel_notes/release_24_11.rst<br />@@ -24,6 +24,14 @@ DPDK Release 24.11<br /> New Features<br /> ------------<br />  <br />+* **Added a cryptodev driver for the ZTE Storage Data Accelerator device.**<br />+  Added the new ``zsda`` cryptodev driver for the ZTE ZSDA device.<br />+  See the :doc:`../cryptodevs/zsda` cryptodev guide for more details on this new driver.<br />+<br />+* **Added a compressdev driver for the ZTE Storage Data Accelerator device.**<br />+  Added the new ``zsda`` compressdev driver for the ZTE ZSDA device.<br />+  See the :doc:`../compressdevs/zsda` compressdev guide for more details on this new driver.<br />+<br /> .. This section should contain new features added in this release.<br />    Sample format:<br />  <br />--  <br />2.27.0<br />