get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/139609/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 139609,
    "url": "http://patchwork.dpdk.org/api/patches/139609/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240422143102.251-2-zhangfei.gao@linaro.org/",
    "project": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20240422143102.251-2-zhangfei.gao@linaro.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240422143102.251-2-zhangfei.gao@linaro.org",
    "date": "2024-04-22T14:31:00",
    "name": "[1/3] compress/uadk: Introduce UADK compression driver",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "6b05688c018bacd45b426b44cf4982ff45fb1829",
    "submitter": {
        "id": 2701,
        "url": "http://patchwork.dpdk.org/api/people/2701/?format=api",
        "name": "Zhangfei Gao",
        "email": "zhangfei.gao@linaro.org"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patchwork.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240422143102.251-2-zhangfei.gao@linaro.org/mbox/",
    "series": [
        {
            "id": 31802,
            "url": "http://patchwork.dpdk.org/api/series/31802/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31802",
            "date": "2024-04-22T14:30:59",
            "name": "Introduce UADK compression driver",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/31802/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/139609/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/139609/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 0470B43EDB;\n\tMon, 22 Apr 2024 16:31:25 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id EDF09402EA;\n\tMon, 22 Apr 2024 16:31:20 +0200 (CEST)",
            "from mail-pg1-f172.google.com (mail-pg1-f172.google.com\n [209.85.215.172])\n by mails.dpdk.org (Postfix) with ESMTP id 67C25402DE\n for <dev@dpdk.org>; Mon, 22 Apr 2024 16:31:19 +0200 (CEST)",
            "by mail-pg1-f172.google.com with SMTP id\n 41be03b00d2f7-5d42e7ab8a9so2693438a12.3\n for <dev@dpdk.org>; Mon, 22 Apr 2024 07:31:19 -0700 (PDT)",
            "from localhost.localdomain ([121.37.54.139])\n by smtp.gmail.com with ESMTPSA id\n v17-20020a17090ad59100b0029c19285192sm9481284pju.44.2024.04.22.07.31.16\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 22 Apr 2024 07:31:17 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1713796278; x=1714401078; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=j4xMt+AWey8VWm3KvQnvr2bJH8ndbonWITOXul8268w=;\n b=ZdLH9zTIBQ1bshupjwU5DL6N4zp7TZj0dWIBDSKTDfUlaW1ElSCJq5UA+XAVxG6Tzl\n UU6PwH5FweajOmcoArHvC4QBDeG/38fjeqgyLjqn/rMlpoTnrMSFSQ0rEYb2r4Lx4nQ1\n kP8HwYGAiwChCBIdsusYhYufwJcUrvPZVDnfPfY5EFr84ZzhJe3PTpzjb/VDogkznS7a\n tvQO308M1Ubyc6TR/cMbsPgrhhaqsGtCchWGY48wUt0hWpsTK1LCGMMyq8xy4pYAYgNZ\n cdV2toeKvS4Q8Uui3SrK/BhEnzMUhAgpP0NuTS5OVNUVKMK8hjxYUoMYd9Jg8psgaE5M\n cTQQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1713796278; x=1714401078;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=j4xMt+AWey8VWm3KvQnvr2bJH8ndbonWITOXul8268w=;\n b=PUalrDO4QfD3D1wwH0Hqqlp0dUsJqkyZI9wdZi6xq9BXeNeBqcdbeFeIIRjneUXeYe\n Vd7YRqBLw29w2L19g94oD1ZSmJWjoSz0Z9yB1p868XLL1ZSdFyehq4wPm7TnANi32Aue\n KC3stKxDZu0kbSZwFtO/KYWakOfDXYaC0mDSpzhkZXXAcdZ0w3N7AV5bFiM8VDIbfpAZ\n fEy8b9EoS8O1Tva1nx+LYQlwcdk8n4bZLtV4nWqcPcJzOA8bhJIWFcNAX5ozPQcb2FME\n yF3mY2S7GSMo9Rq/K/XToRq09sp8ElKpONh7zQuyBUyh43RkRyiFZx1U8k/1gFiWM1fZ\n amuw==",
        "X-Gm-Message-State": "AOJu0Ywyuqigjj25CgE4mRndJURMAnY+NnlJY918H4SgvzdEzFyDwS3D\n 3IxfS8OLmCUknx0YBkCbOL2CNafgLCfbPYgirPC4iMyrHT3LJMgeXu6RCi+Ycyw6xxETNpDHe+7\n glp5jq2wr",
        "X-Google-Smtp-Source": "\n AGHT+IEURGAmOf9AKlwPEUWoYgEKWdOWLXnIn3IvK2WXYnKWAg3Bw0idW0ypR3FvHua4lwterIwVDQ==",
        "X-Received": "by 2002:a17:90a:2f62:b0:2ab:a991:6eb8 with SMTP id\n s89-20020a17090a2f6200b002aba9916eb8mr8470782pjd.42.1713796278369;\n Mon, 22 Apr 2024 07:31:18 -0700 (PDT)",
        "From": "Zhangfei Gao <zhangfei.gao@linaro.org>",
        "To": "Akhil Goyal <gakhil@marvell.com>, Fan Zhang <fanzhang.oss@gmail.com>,\n Ashish Gupta <ashish.gupta@marvell.com>",
        "Cc": "dev@dpdk.org,\n\tZhangfei Gao <zhangfei.gao@linaro.org>",
        "Subject": "[PATCH 1/3] compress/uadk: Introduce UADK compression driver",
        "Date": "Mon, 22 Apr 2024 14:31:00 +0000",
        "Message-Id": "<20240422143102.251-2-zhangfei.gao@linaro.org>",
        "X-Mailer": "git-send-email 2.33.0",
        "In-Reply-To": "<20240422143102.251-1-zhangfei.gao@linaro.org>",
        "References": "<20240422143102.251-1-zhangfei.gao@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Introduce a new compression & decompression PMD for hardware accelerators\nbased on UADK [1].\n\nUADK is a framework for user applications to access hardware accelerators.\nUADK relies on IOMMU SVA (Shared Virtual Address) feature, which shares\nthe same page table between IOMMU and MMU.\nThereby user application can directly use the virtual address for the\ndevice DMA, which enhances the performance as well as easy usability.\n\nThis patch adds the basic framework.\n\nTest:\nsudo dpdk-test --vdev=compress_uadk\nRTE>>compressdev_autotest\nRTE>>quit\n\n[1] https://github.com/Linaro/uadk\n\nSigned-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>\n---\n MAINTAINERS                                   |  6 ++\n doc/guides/compressdevs/features/uadk.ini     | 11 +++\n doc/guides/compressdevs/index.rst             |  1 +\n doc/guides/compressdevs/uadk.rst              | 98 +++++++++++++++++++\n doc/guides/rel_notes/release_24_07.rst        |  5 +\n drivers/compress/meson.build                  |  1 +\n drivers/compress/uadk/meson.build             | 30 ++++++\n drivers/compress/uadk/uadk_compress_pmd.c     | 89 +++++++++++++++++\n .../compress/uadk/uadk_compress_pmd_private.h | 20 ++++\n 9 files changed, 261 insertions(+)\n create mode 100644 doc/guides/compressdevs/features/uadk.ini\n create mode 100644 doc/guides/compressdevs/uadk.rst\n create mode 100644 drivers/compress/uadk/meson.build\n create mode 100644 drivers/compress/uadk/uadk_compress_pmd.c\n create mode 100644 drivers/compress/uadk/uadk_compress_pmd_private.h",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 7abb3aee49..4f1f640004 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -1212,6 +1212,12 @@ F: drivers/compress/octeontx/\n F: doc/guides/compressdevs/octeontx.rst\n F: doc/guides/compressdevs/features/octeontx.ini\n \n+HiSilicon UADK compress\n+M: Zhangfei Gao <zhangfei.gao@linaro.org>\n+F: drivers/compress/uadk/\n+F: doc/guides/compressdevs/uadk.rst\n+F: doc/guides/compressdevs/features/uadk.ini\n+\n Intel QuickAssist\n M: Kai Ji <kai.ji@intel.com>\n F: drivers/compress/qat/\ndiff --git a/doc/guides/compressdevs/features/uadk.ini b/doc/guides/compressdevs/features/uadk.ini\nnew file mode 100644\nindex 0000000000..0bbdb6c5cf\n--- /dev/null\n+++ b/doc/guides/compressdevs/features/uadk.ini\n@@ -0,0 +1,11 @@\n+;\n+; Refer to default.ini for the full list of available PMD features.\n+;\n+; Supported features of 'uadk' compression driver.\n+;\n+[Features]\n+HW Accelerated = Y\n+Deflate        = Y\n+Crc32          = N\n+Fixed          = Y\n+Dynamic        = Y\ndiff --git a/doc/guides/compressdevs/index.rst b/doc/guides/compressdevs/index.rst\nindex 849f211688..87ed4f72a4 100644\n--- a/doc/guides/compressdevs/index.rst\n+++ b/doc/guides/compressdevs/index.rst\n@@ -15,4 +15,5 @@ Compression Device Drivers\n     nitrox\n     octeontx\n     qat_comp\n+    uadk\n     zlib\ndiff --git a/doc/guides/compressdevs/uadk.rst b/doc/guides/compressdevs/uadk.rst\nnew file mode 100644\nindex 0000000000..7e7f9f2548\n--- /dev/null\n+++ b/doc/guides/compressdevs/uadk.rst\n@@ -0,0 +1,98 @@\n+.. SPDX-License-Identifier: BSD-3-Clause\n+   Copyright 2024-2025 Huawei Technologies Co.,Ltd. All rights reserved.\n+   Copyright 2024-2025 Linaro ltd.\n+\n+UADK Compression Poll Mode Driver\n+=================================\n+\n+UADK compression PMD provides poll mode compression & decompression driver\n+All compression operations are using UADK library compression API, which is\n+algorithm-level API, abstracting accelerators' low-level implementations.\n+\n+UADK compression PMD relies on `UADK library <https://github.com/Linaro/uadk>`_.\n+\n+UADK is a framework for user applications to access hardware accelerators.\n+UADK relies on IOMMU SVA (Shared Virtual Address) feature,\n+which shares the same page table between IOMMU and MMU.\n+As a result, the user application can directly use the virtual address for\n+device DMA, which enhances performance as well as easy usability.\n+\n+\n+Features\n+--------\n+\n+UADK compression PMD has support for:\n+\n+Compression/Decompression algorithm:\n+\n+    * DEFLATE - using Fixed and Dynamic Huffman encoding\n+\n+Window size support:\n+\n+    * 32K\n+\n+\n+Test steps\n+----------\n+\n+#. Build UADK\n+\n+   .. code-block:: console\n+\n+      git clone https://github.com/Linaro/uadk.git\n+      cd uadk\n+      mkdir build\n+      ./autogen.sh\n+      ./configure --prefix=$PWD/build\n+      make\n+      make install\n+\n+   .. note::\n+\n+      Without ``--prefix``, UADK will be installed to ``/usr/local/lib`` by default.\n+\n+   .. note::\n+\n+      If get error: \"cannot find -lnuma\", please install the libnuma-dev.\n+\n+#. Run pkg-config libwd to ensure env is setup correctly\n+\n+   .. code-block:: console\n+\n+      export PKG_CONFIG_PATH=$PWD/build/lib/pkgconfig\n+      pkg-config libwd --cflags --libs -I/usr/local/include -L/usr/local/lib -lwd\n+\n+   .. note::\n+\n+      export ``PKG_CONFIG_PATH`` is required on demand,\n+      not needed if UADK is installed to ``/usr/local/lib``.\n+\n+#. Build DPDK\n+\n+   .. code-block:: console\n+\n+      cd dpdk\n+      mkdir build\n+      meson setup build (--reconfigure)\n+      cd build\n+      ninja\n+      sudo ninja install\n+\n+#. Prepare hugepages for DPDK (see also :doc:`../tools/hugepages`)\n+\n+   .. code-block:: console\n+\n+      echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages\n+      echo 1024 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages\n+      echo 1024 > /sys/devices/system/node/node2/hugepages/hugepages-2048kB/nr_hugepages\n+      echo 1024 > /sys/devices/system/node/node3/hugepages/hugepages-2048kB/nr_hugepages\n+      mkdir -p /mnt/huge_2mb\n+      mount -t hugetlbfs none /mnt/huge_2mb -o pagesize=2MB\n+\n+#. Run test app\n+\n+   .. code-block:: console\n+\n+\tsudo dpdk-test --vdev=compress_uadk\n+\tRTE>>compressdev_autotest\n+\tRTE>>quit\ndiff --git a/doc/guides/rel_notes/release_24_07.rst b/doc/guides/rel_notes/release_24_07.rst\nindex a69f24cf99..a7574045f0 100644\n--- a/doc/guides/rel_notes/release_24_07.rst\n+++ b/doc/guides/rel_notes/release_24_07.rst\n@@ -24,6 +24,11 @@ DPDK Release 24.07\n New Features\n ------------\n \n+* **Added UADK compress driver.**\n+\n+  Added a new compress driver for the UADK library. See the\n+  :doc:`../compressdevs/uadk` guide for more details on this new driver.\n+\n .. This section should contain new features added in this release.\n    Sample format:\n \ndiff --git a/drivers/compress/meson.build b/drivers/compress/meson.build\nindex b91195b27d..91d7800a4a 100644\n--- a/drivers/compress/meson.build\n+++ b/drivers/compress/meson.build\n@@ -10,6 +10,7 @@ drivers = [\n         'mlx5',\n         'nitrox',\n         'octeontx',\n+        'uadk',\n         'zlib',\n ]\n \ndiff --git a/drivers/compress/uadk/meson.build b/drivers/compress/uadk/meson.build\nnew file mode 100644\nindex 0000000000..704833bbcf\n--- /dev/null\n+++ b/drivers/compress/uadk/meson.build\n@@ -0,0 +1,30 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright 2024-2025 Huawei Technologies Co.,Ltd. All rights reserved.\n+# Copyright 2024-2025 Linaro ltd.\n+\n+if not is_linux\n+    build = false\n+    reason = 'only supported on Linux'\n+    subdir_done()\n+endif\n+\n+sources = files(\n+        'uadk_compress_pmd.c',\n+)\n+\n+deps += 'bus_vdev'\n+dep = dependency('libwd_comp', required: false, method: 'pkg-config')\n+if not dep.found()\n+\tbuild = false\n+\treason = 'missing dependency, \"libwd_comp\"'\n+else\n+\text_deps += dep\n+endif\n+\n+dep = dependency('libwd', required: false, method: 'pkg-config')\n+if not dep.found()\n+    build = false\n+    reason = 'missing dependency, \"libwd\"'\n+else\n+    ext_deps += dep\n+endif\ndiff --git a/drivers/compress/uadk/uadk_compress_pmd.c b/drivers/compress/uadk/uadk_compress_pmd.c\nnew file mode 100644\nindex 0000000000..d73524ce84\n--- /dev/null\n+++ b/drivers/compress/uadk/uadk_compress_pmd.c\n@@ -0,0 +1,89 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2024-2025 Huawei Technologies Co.,Ltd. All rights reserved.\n+ * Copyright 2024-2025 Linaro ltd.\n+ */\n+\n+#include <bus_vdev_driver.h>\n+#include <rte_compressdev_pmd.h>\n+#include <rte_malloc.h>\n+\n+#include <uadk/wd_comp.h>\n+#include <uadk/wd_sched.h>\n+\n+#include \"uadk_compress_pmd_private.h\"\n+\n+static struct rte_compressdev_ops uadk_compress_pmd_ops = {\n+\t\t.dev_configure\t\t= NULL,\n+\t\t.dev_start\t\t= NULL,\n+\t\t.dev_stop\t\t= NULL,\n+\t\t.dev_close\t\t= NULL,\n+\t\t.stats_get\t\t= NULL,\n+\t\t.stats_reset\t\t= NULL,\n+\t\t.dev_infos_get\t\t= NULL,\n+\t\t.queue_pair_setup\t= NULL,\n+\t\t.queue_pair_release\t= NULL,\n+\t\t.private_xform_create\t= NULL,\n+\t\t.private_xform_free\t= NULL,\n+\t\t.stream_create\t\t= NULL,\n+\t\t.stream_free\t\t= NULL,\n+};\n+\n+static int\n+uadk_compress_probe(struct rte_vdev_device *vdev)\n+{\n+\tstruct rte_compressdev_pmd_init_params init_params = {\n+\t\t\"\",\n+\t\trte_socket_id(),\n+\t};\n+\tstruct rte_compressdev *compressdev;\n+\tstruct uacce_dev *udev;\n+\tconst char *name;\n+\n+\tudev = wd_get_accel_dev(\"deflate\");\n+\tif (!udev)\n+\t\treturn -ENODEV;\n+\n+\tname = rte_vdev_device_name(vdev);\n+\tif (name == NULL)\n+\t\treturn -EINVAL;\n+\n+\tcompressdev = rte_compressdev_pmd_create(name, &vdev->device,\n+\t\t\tsizeof(struct uadk_compress_priv), &init_params);\n+\tif (compressdev == NULL) {\n+\t\tUADK_LOG(ERR, \"driver %s: create failed\", init_params.name);\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tcompressdev->dev_ops = &uadk_compress_pmd_ops;\n+\tcompressdev->dequeue_burst = NULL;\n+\tcompressdev->enqueue_burst = NULL;\n+\tcompressdev->feature_flags = RTE_COMPDEV_FF_HW_ACCELERATED;\n+\n+\treturn 0;\n+}\n+\n+static int\n+uadk_compress_remove(struct rte_vdev_device *vdev)\n+{\n+\tstruct rte_compressdev *compressdev;\n+\tconst char *name;\n+\n+\tname = rte_vdev_device_name(vdev);\n+\tif (name == NULL)\n+\t\treturn -EINVAL;\n+\n+\tcompressdev = rte_compressdev_pmd_get_named_dev(name);\n+\tif (compressdev == NULL)\n+\t\treturn -ENODEV;\n+\n+\treturn rte_compressdev_pmd_destroy(compressdev);\n+}\n+\n+static struct rte_vdev_driver uadk_compress_pmd = {\n+\t.probe = uadk_compress_probe,\n+\t.remove = uadk_compress_remove,\n+};\n+\n+#define UADK_COMPRESS_DRIVER_NAME compress_uadk\n+RTE_PMD_REGISTER_VDEV(UADK_COMPRESS_DRIVER_NAME, uadk_compress_pmd);\n+RTE_LOG_REGISTER_DEFAULT(uadk_compress_logtype, INFO);\ndiff --git a/drivers/compress/uadk/uadk_compress_pmd_private.h b/drivers/compress/uadk/uadk_compress_pmd_private.h\nnew file mode 100644\nindex 0000000000..a96aea7c73\n--- /dev/null\n+++ b/drivers/compress/uadk/uadk_compress_pmd_private.h\n@@ -0,0 +1,20 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2024-2025 Huawei Technologies Co.,Ltd. All rights reserved.\n+ * Copyright 2024-2025 Linaro ltd.\n+ */\n+\n+#ifndef _UADK_COMPRESS_PMD_PRIVATE_H_\n+#define _UADK_COMPRESS_PMD_PRIVATE_H_\n+\n+struct uadk_compress_priv {\n+\tstruct rte_mempool *mp;\n+};\n+\n+extern int uadk_compress_logtype;\n+\n+#define UADK_LOG(level, fmt, ...)  \\\n+\trte_log(RTE_LOG_ ## level, uadk_compress_logtype,  \\\n+\t\t\"%s() line %u: \" fmt \"\\n\", __func__, __LINE__,  \\\n+\t\t## __VA_ARGS__)\n+\n+#endif /* _UADK_COMPRESS_PMD_PRIVATE_H_ */\n",
    "prefixes": [
        "1/3"
    ]
}