From patchwork Wed Jan 20 11:29:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matan Azrad X-Patchwork-Id: 86969 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 00F4AA0A05; Wed, 20 Jan 2021 12:35:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7910C140CF9; Wed, 20 Jan 2021 12:35:09 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id 03E93140CF8 for ; Wed, 20 Jan 2021 12:35:07 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from matan@nvidia.com) with SMTP; 20 Jan 2021 13:35:05 +0200 Received: from pegasus25.mtr.labs.mlnx. (pegasus25.mtr.labs.mlnx [10.210.16.10]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 10KBTfXI001381; Wed, 20 Jan 2021 13:35:05 +0200 From: Matan Azrad To: dev@dpdk.org Cc: Thomas Monjalon , Ashish Gupta , Fiona Trahe , akhil.goyal@nxp.com Date: Wed, 20 Jan 2021 11:29:35 +0000 Message-Id: <1611142175-409485-12-git-send-email-matan@nvidia.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1611142175-409485-1-git-send-email-matan@nvidia.com> References: <1610554690-411627-1-git-send-email-matan@nvidia.com> <1611142175-409485-1-git-send-email-matan@nvidia.com> Subject: [dpdk-dev] [PATCH v3 11/11] compress/mlx5: add the supported capabilities X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add all the capabilities supported by the device. Add the driver documentations. Signed-off-by: Matan Azrad Acked-by: Viacheslav Ovsiienko --- doc/guides/compressdevs/features/mlx5.ini | 13 +++++ doc/guides/compressdevs/index.rst | 1 + doc/guides/compressdevs/mlx5.rst | 94 +++++++++++++++++++++++++++++++ doc/guides/rel_notes/release_21_02.rst | 6 ++ drivers/compress/mlx5/mlx5_compress.c | 24 +++++++- 5 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 doc/guides/compressdevs/features/mlx5.ini create mode 100644 doc/guides/compressdevs/mlx5.rst diff --git a/doc/guides/compressdevs/features/mlx5.ini b/doc/guides/compressdevs/features/mlx5.ini new file mode 100644 index 0000000..891ce47 --- /dev/null +++ b/doc/guides/compressdevs/features/mlx5.ini @@ -0,0 +1,13 @@ +; +; Refer to default.ini for the full list of available PMD features. +; +; Supported features of 'MLX5' compression driver. +; +[Features] +HW Accelerated = Y +Deflate = Y +Adler32 = Y +Crc32 = Y +Adler32&Crc32 = Y +Fixed = Y +Dynamic = Y diff --git a/doc/guides/compressdevs/index.rst b/doc/guides/compressdevs/index.rst index 1f37e26..54a3ef4 100644 --- a/doc/guides/compressdevs/index.rst +++ b/doc/guides/compressdevs/index.rst @@ -11,6 +11,7 @@ Compression Device Drivers overview isal + mlx5 octeontx qat_comp zlib diff --git a/doc/guides/compressdevs/mlx5.rst b/doc/guides/compressdevs/mlx5.rst new file mode 100644 index 0000000..c5433e9 --- /dev/null +++ b/doc/guides/compressdevs/mlx5.rst @@ -0,0 +1,94 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright 2021 Mellanox Technologies, Ltd + +.. include:: + +MLX5 compress driver +==================== + +The MLX5 compress driver library +(**librte_compress_mlx5**) provides support for **Mellanox BlueField 2** +families of 25/50/100/200 Gb/s adapters. + +Design +------ + +This PMD is configuring the compress, decompress amd DMA engines. + +GGAs (Generic Global Accelerators) are offload engines that can be used +to do memory to memory tasks on data. +These engines are part of the ARM complex of the BlueField chip, and as +such they do not use NIC related resources (e.g. RX/TX bandwidth). +They do share the same PCI and memory bandwidth. + +So, using the BlueField device (starting from BlueField 2), the compress +class operations can be supported in parallel to the net, vDPA and +RegEx class operations. + +For security reasons and robustness, this driver only deals with virtual +memory addresses. The way resources allocations are handled by the kernel, +combined with hardware specifications that allow to handle virtual memory +addresses directly, ensure that DPDK applications cannot access random +physical memory (or memory that does not belong to the current process). + +The PMD uses libibverbs and libmlx5 to access the device firmware +or directly the hardware components. +There are different levels of objects and bypassing abilities +to get the best performances: + +- Verbs is a complete high-level generic API. +- Direct Verbs is a device-specific API. +- DevX allows to access firmware objects. + +Enabling librte_compress_mlx5 causes DPDK applications to be linked against +libibverbs. + +Mellanox mlx5 pci device can be probed by number of different pci devices, +for example net / vDPA / RegEx. To select the compress PMD ``class=compress`` +should be specified as device parameter. The compress device can be probed and +used with other Mellanox classes, by adding more options in the class. +For example: ``class=net:compress`` will probe both the net PMD and the compress +PMD. + +Features +-------- + +Compress mlx5 PMD has support for: + +Compression/Decompression algorithm: + +* DEFLATE. + +NULL algorithm for DMA operations. + +Huffman code type: + +* FIXED. +* DYNAMIC. + +Window size support: + +1KB, 2KB, 4KB, 8KB, 16KB and 32KB. + +Shareable transformation. + +Checksum generation: + +* CRC32, Adler32 and combined checksum. + +Limitations +----------- + +* Scatter-Gather, SHA and Stateful are not supported. +* Non-compressed block is not supported in compress (supported in decompress). + +Supported NICs +-------------- + +* Mellanox\ |reg| BlueField 2 SmartNIC + +Prerequisites +------------- + +- Mellanox OFED version: **5.2** + see :doc:`../../nics/mlx5` guide for more Mellanox OFED details. diff --git a/doc/guides/rel_notes/release_21_02.rst b/doc/guides/rel_notes/release_21_02.rst index ae36b6a..3550f4e 100644 --- a/doc/guides/rel_notes/release_21_02.rst +++ b/doc/guides/rel_notes/release_21_02.rst @@ -51,6 +51,12 @@ New Features * Other libs * Apps, Examples, Tools (if significant) +* **Added mlx5 compress PMD.** + + Added a new compress PMD driver for Bluefield 2 adapters. + + See the :doc:`../compressdevs/mlx5` for more details. + This section is a comment. Do not overwrite or remove it. Also, make sure to start the actual text at the margin. ======================================================= diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index f7ef913..a274366 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -77,8 +77,28 @@ struct mlx5_compress_qp { int mlx5_compress_logtype; -const struct rte_compressdev_capabilities mlx5_caps[RTE_COMP_ALGO_LIST_END]; - +static const struct rte_compressdev_capabilities mlx5_caps[] = { + { + .algo = RTE_COMP_ALGO_NULL, + .comp_feature_flags = RTE_COMP_FF_ADLER32_CHECKSUM | + RTE_COMP_FF_CRC32_CHECKSUM | + RTE_COMP_FF_CRC32_ADLER32_CHECKSUM | + RTE_COMP_FF_SHAREABLE_PRIV_XFORM, + }, + { + .algo = RTE_COMP_ALGO_DEFLATE, + .comp_feature_flags = RTE_COMP_FF_ADLER32_CHECKSUM | + RTE_COMP_FF_CRC32_CHECKSUM | + RTE_COMP_FF_CRC32_ADLER32_CHECKSUM | + RTE_COMP_FF_SHAREABLE_PRIV_XFORM | + RTE_COMP_FF_HUFFMAN_FIXED | + RTE_COMP_FF_HUFFMAN_DYNAMIC, + .window_size = {.min = 10, .max = 15, .increment = 1}, + }, + { + .algo = RTE_COMP_ALGO_LIST_END, + } +}; static void mlx5_compress_dev_info_get(struct rte_compressdev *dev,