get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 86284,
    "url": "http://patchwork.dpdk.org/api/patches/86284/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1610373560-253158-3-git-send-email-matan@nvidia.com/",
    "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": "<1610373560-253158-3-git-send-email-matan@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1610373560-253158-3-git-send-email-matan@nvidia.com",
    "date": "2021-01-11T13:59:12",
    "name": "[02/10] drivers: introduce mlx5 compress PMD",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "14848e214392d83ed33dd614181285c4cebb413e",
    "submitter": {
        "id": 1911,
        "url": "http://patchwork.dpdk.org/api/people/1911/?format=api",
        "name": "Matan Azrad",
        "email": "matan@nvidia.com"
    },
    "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/1610373560-253158-3-git-send-email-matan@nvidia.com/mbox/",
    "series": [
        {
            "id": 14634,
            "url": "http://patchwork.dpdk.org/api/series/14634/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=14634",
            "date": "2021-01-11T13:59:10",
            "name": "add mlx5 compress PMD",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/14634/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/86284/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/86284/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 ED716A09FF;\n\tMon, 11 Jan 2021 14:59:43 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BADED140CF7;\n\tMon, 11 Jan 2021 14:59:38 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by mails.dpdk.org (Postfix) with ESMTP id 35F0B140CE8\n for <dev@dpdk.org>; Mon, 11 Jan 2021 14:59:37 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n matan@nvidia.com) with SMTP; 11 Jan 2021 15:59:33 +0200",
            "from pegasus25.mtr.labs.mlnx. (pegasus25.mtr.labs.mlnx\n [10.210.16.10])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 10BDxPKJ010436;\n Mon, 11 Jan 2021 15:59:33 +0200"
        ],
        "From": "Matan Azrad <matan@nvidia.com>",
        "To": "dev@dpdk.org",
        "Cc": "Thomas Monjalon <thomas@monjalon.net>,\n Ashish Gupta <ashish.gupta@marvell.com>,\n Fiona Trahe <fiona.trahe@intel.com>",
        "Date": "Mon, 11 Jan 2021 13:59:12 +0000",
        "Message-Id": "<1610373560-253158-3-git-send-email-matan@nvidia.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1610373560-253158-1-git-send-email-matan@nvidia.com>",
        "References": "<1610373560-253158-1-git-send-email-matan@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH 02/10] drivers: introduce mlx5 compress PMD",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add a new compress PMD for Mellanox devices.\n\nThe MLX5 compress driver library provides support for Mellanox\nBlueField 2 families of 25/50/100/200 Gb/s adapters.\n\nUsing the BlueField 2 device, the compress class operations can be run in\nparallel to the net, vdpa, and regex class operations.\n\nThis driver is depending on rdma-core like the other mlx5 PMDs, also it\nis going to use mlx5 DevX to create HW objects directly by the FW.\n\nAdd the probing functions, PCI bus connectivity, HW capabilities checks\nand some basic objects preparations.\n\nSigned-off-by: Matan Azrad <matan@nvidia.com>\n---\n MAINTAINERS                                 |   4 +\n drivers/common/mlx5/mlx5_common.h           |   1 +\n drivers/common/mlx5/mlx5_common_pci.c       |   7 +\n drivers/common/mlx5/mlx5_common_pci.h       |  36 ++--\n drivers/compress/meson.build                |   2 +-\n drivers/compress/mlx5/meson.build           |  26 +++\n drivers/compress/mlx5/mlx5_compress.c       | 297 ++++++++++++++++++++++++++++\n drivers/compress/mlx5/mlx5_compress_utils.h |  20 ++\n drivers/compress/mlx5/version.map           |   3 +\n 9 files changed, 377 insertions(+), 19 deletions(-)\n create mode 100644 drivers/compress/mlx5/meson.build\n create mode 100644 drivers/compress/mlx5/mlx5_compress.c\n create mode 100644 drivers/compress/mlx5/mlx5_compress_utils.h\n create mode 100644 drivers/compress/mlx5/version.map",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex eafe9f8..f7527f0 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -1132,6 +1132,10 @@ F: drivers/compress/zlib/\n F: doc/guides/compressdevs/zlib.rst\n F: doc/guides/compressdevs/features/zlib.ini\n \n+Mellanox mlx5\n+M: Matan Azrad <matan@nvidia.com>\n+F: drivers/compress/mlx5/\n+\n \n RegEx Drivers\n -------------\ndiff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h\nindex e35188d..3855582 100644\n--- a/drivers/common/mlx5/mlx5_common.h\n+++ b/drivers/common/mlx5/mlx5_common.h\n@@ -217,6 +217,7 @@ enum mlx5_class {\n \tMLX5_CLASS_NET = RTE_BIT64(0),\n \tMLX5_CLASS_VDPA = RTE_BIT64(1),\n \tMLX5_CLASS_REGEX = RTE_BIT64(2),\n+\tMLX5_CLASS_COMPRESS = RTE_BIT64(3),\n };\n \n #define MLX5_DBR_SIZE RTE_CACHE_LINE_SIZE\ndiff --git a/drivers/common/mlx5/mlx5_common_pci.c b/drivers/common/mlx5/mlx5_common_pci.c\nindex 5208972..2b65768 100644\n--- a/drivers/common/mlx5/mlx5_common_pci.c\n+++ b/drivers/common/mlx5/mlx5_common_pci.c\n@@ -28,14 +28,21 @@ static TAILQ_HEAD(mlx5_pci_devices_head, mlx5_pci_device) devices_list =\n \t{ .name = \"vdpa\", .driver_class = MLX5_CLASS_VDPA },\n \t{ .name = \"net\", .driver_class = MLX5_CLASS_NET },\n \t{ .name = \"regex\", .driver_class = MLX5_CLASS_REGEX },\n+\t{ .name = \"compress\", .driver_class = MLX5_CLASS_COMPRESS },\n };\n \n static const unsigned int mlx5_class_combinations[] = {\n \tMLX5_CLASS_NET,\n \tMLX5_CLASS_VDPA,\n \tMLX5_CLASS_REGEX,\n+\tMLX5_CLASS_COMPRESS,\n \tMLX5_CLASS_NET | MLX5_CLASS_REGEX,\n \tMLX5_CLASS_VDPA | MLX5_CLASS_REGEX,\n+\tMLX5_CLASS_NET | MLX5_CLASS_COMPRESS,\n+\tMLX5_CLASS_VDPA | MLX5_CLASS_COMPRESS,\n+\tMLX5_CLASS_REGEX | MLX5_CLASS_COMPRESS,\n+\tMLX5_CLASS_NET | MLX5_CLASS_REGEX | MLX5_CLASS_COMPRESS,\n+\tMLX5_CLASS_VDPA | MLX5_CLASS_REGEX | MLX5_CLASS_COMPRESS,\n \t/* New class combination should be added here. */\n };\n \ndiff --git a/drivers/common/mlx5/mlx5_common_pci.h b/drivers/common/mlx5/mlx5_common_pci.h\nindex 41b73e1..de89bb9 100644\n--- a/drivers/common/mlx5/mlx5_common_pci.h\n+++ b/drivers/common/mlx5/mlx5_common_pci.h\n@@ -9,26 +9,26 @@\n  * @file\n  *\n  * RTE Mellanox PCI Driver Interface\n- * Mellanox ConnectX PCI device supports multiple class (net/vdpa/regex)\n- * devices. This layer enables creating such multiple class of devices on a\n- * single PCI device by allowing to bind multiple class specific device\n+ * Mellanox ConnectX PCI device supports multiple class: net,vdpa,regex and\n+ * compress devices. This layer enables creating such multiple class of devices\n+ * on a single PCI device by allowing to bind multiple class specific device\n  * driver to attach to mlx5_pci driver.\n  *\n- * -----------    ------------    -------------\n- * |   mlx5  |    |   mlx5   |    |   mlx5    |\n- * | net pmd |    | vdpa pmd |    | regex pmd |\n- * -----------    ------------    -------------\n- *      \\              |                 /\n- *       \\             |                /\n- *        \\       --------------       /\n- *         \\______|   mlx5     |_____ /\n- *                | pci common |\n- *                --------------\n- *                     |\n- *                 -----------\n- *                 |   mlx5  |\n- *                 | pci dev |\n- *                 -----------\n+ * -----------    ------------    -------------    ----------------\n+ * |   mlx5  |    |   mlx5   |    |   mlx5    |    |     mlx5     |\n+ * | net pmd |    | vdpa pmd |    | regex pmd |    | compress pmd |\n+ * -----------    ------------    -------------    ----------------\n+ *      \\              \\                    /              /\n+ *       \\              \\                  /              /\n+ *        \\              \\_--------------_/              /\n+ *         \\_______________|   mlx5     |_______________/\n+ *                         | pci common |\n+ *                         --------------\n+ *                               |\n+ *                           -----------\n+ *                           |   mlx5  |\n+ *                           | pci dev |\n+ *                           -----------\n  *\n  * - mlx5 pci driver binds to mlx5 PCI devices defined by PCI\n  *   ID table of all related mlx5 PCI devices.\ndiff --git a/drivers/compress/meson.build b/drivers/compress/meson.build\nindex 33f5e33..d8f3ddb 100644\n--- a/drivers/compress/meson.build\n+++ b/drivers/compress/meson.build\n@@ -5,7 +5,7 @@ if is_windows\n \tsubdir_done()\n endif\n \n-drivers = ['isal', 'octeontx', 'zlib']\n+drivers = ['isal', 'octeontx', 'zlib', 'mlx5']\n \n std_deps = ['compressdev'] # compressdev pulls in all other needed deps\n config_flag_fmt = 'RTE_LIBRTE_PMD_@0@'\ndiff --git a/drivers/compress/mlx5/meson.build b/drivers/compress/mlx5/meson.build\nnew file mode 100644\nindex 0000000..2a6dc3f\n--- /dev/null\n+++ b/drivers/compress/mlx5/meson.build\n@@ -0,0 +1,26 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright 2021 Mellanox Technologies, Ltd\n+\n+if not is_linux\n+\tbuild = false\n+\treason = 'only supported on Linux'\n+\tsubdir_done()\n+endif\n+\n+fmt_name = 'mlx5_compress'\n+deps += ['common_mlx5', 'eal', 'compressdev']\n+sources = files(\n+\t'mlx5_compress.c',\n+)\n+cflags_options = [\n+\t'-std=c11',\n+\t'-Wno-strict-prototypes',\n+\t'-D_BSD_SOURCE',\n+\t'-D_DEFAULT_SOURCE',\n+\t'-D_XOPEN_SOURCE=600'\n+]\n+foreach option:cflags_options\n+\tif cc.has_argument(option)\n+\t\tcflags += option\n+\tendif\n+endforeach\ndiff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c\nnew file mode 100644\nindex 0000000..639dd61\n--- /dev/null\n+++ b/drivers/compress/mlx5/mlx5_compress.c\n@@ -0,0 +1,297 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2021 Mellanox Technologies, Ltd\n+ */\n+\n+#include <rte_malloc.h>\n+#include <rte_log.h>\n+#include <rte_errno.h>\n+#include <rte_pci.h>\n+#include <rte_comp.h>\n+#include <rte_compressdev.h>\n+#include <rte_compressdev_pmd.h>\n+\n+#include <mlx5_glue.h>\n+#include <mlx5_common.h>\n+#include <mlx5_common_pci.h>\n+#include <mlx5_devx_cmds.h>\n+#include <mlx5_common_os.h>\n+#include <mlx5_prm.h>\n+\n+#include \"mlx5_compress_utils.h\"\n+\n+#define MLX5_COMPRESS_DRIVER_NAME mlx5_compress\n+#define MLX5_COMPRESS_LOG_NAME    pmd.compress.mlx5\n+\n+struct mlx5_compress_priv {\n+\tTAILQ_ENTRY(mlx5_compress_priv) next;\n+\tstruct ibv_context *ctx; /* Device context. */\n+\tstruct rte_pci_device *pci_dev;\n+\tstruct rte_compressdev *cdev;\n+\tvoid *uar;\n+\tuint32_t pdn; /* Protection Domain number. */\n+\tuint8_t min_block_size;\n+\t/* Minimum huffman block size supported by the device. */\n+\tstruct ibv_pd *pd;\n+};\n+\n+TAILQ_HEAD(mlx5_compress_privs, mlx5_compress_priv) mlx5_compress_priv_list =\n+\t\t\t\tTAILQ_HEAD_INITIALIZER(mlx5_compress_priv_list);\n+static pthread_mutex_t priv_list_lock = PTHREAD_MUTEX_INITIALIZER;\n+\n+int mlx5_compress_logtype;\n+\n+static struct rte_compressdev_ops mlx5_compress_ops = {\n+\t.dev_configure\t\t= NULL,\n+\t.dev_start\t\t= NULL,\n+\t.dev_stop\t\t= NULL,\n+\t.dev_close\t\t= NULL,\n+\t.dev_infos_get\t\t= NULL,\n+\t.stats_get\t\t= NULL,\n+\t.stats_reset\t\t= NULL,\n+\t.queue_pair_setup\t= NULL,\n+\t.queue_pair_release\t= NULL,\n+\t.private_xform_create\t= NULL,\n+\t.private_xform_free\t= NULL,\n+\t.stream_create\t\t= NULL,\n+\t.stream_free\t\t= NULL,\n+};\n+\n+static struct ibv_device *\n+mlx5_compress_get_ib_device_match(struct rte_pci_addr *addr)\n+{\n+\tint n;\n+\tstruct ibv_device **ibv_list = mlx5_glue->get_device_list(&n);\n+\tstruct ibv_device *ibv_match = NULL;\n+\n+\tif (ibv_list == NULL) {\n+\t\trte_errno = ENOSYS;\n+\t\treturn NULL;\n+\t}\n+\twhile (n-- > 0) {\n+\t\tstruct rte_pci_addr paddr;\n+\n+\t\tDRV_LOG(DEBUG, \"Checking device \\\"%s\\\"..\", ibv_list[n]->name);\n+\t\tif (mlx5_dev_to_pci_addr(ibv_list[n]->ibdev_path, &paddr) != 0)\n+\t\t\tcontinue;\n+\t\tif (rte_pci_addr_cmp(addr, &paddr) != 0)\n+\t\t\tcontinue;\n+\t\tibv_match = ibv_list[n];\n+\t\tbreak;\n+\t}\n+\tif (ibv_match == NULL)\n+\t\trte_errno = ENOENT;\n+\tmlx5_glue->free_device_list(ibv_list);\n+\treturn ibv_match;\n+}\n+\n+static void\n+mlx5_compress_hw_global_release(struct mlx5_compress_priv *priv)\n+{\n+\tif (priv->pd != NULL) {\n+\t\tclaim_zero(mlx5_glue->dealloc_pd(priv->pd));\n+\t\tpriv->pd = NULL;\n+\t}\n+\tif (priv->uar != NULL) {\n+\t\tmlx5_glue->devx_free_uar(priv->uar);\n+\t\tpriv->uar = NULL;\n+\t}\n+}\n+\n+static int\n+mlx5_compress_pd_create(struct mlx5_compress_priv *priv)\n+{\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+\tstruct mlx5dv_obj obj;\n+\tstruct mlx5dv_pd pd_info;\n+\tint ret;\n+\n+\tpriv->pd = mlx5_glue->alloc_pd(priv->ctx);\n+\tif (priv->pd == NULL) {\n+\t\tDRV_LOG(ERR, \"Failed to allocate PD.\");\n+\t\treturn errno ? -errno : -ENOMEM;\n+\t}\n+\tobj.pd.in = priv->pd;\n+\tobj.pd.out = &pd_info;\n+\tret = mlx5_glue->dv_init_obj(&obj, MLX5DV_OBJ_PD);\n+\tif (ret != 0) {\n+\t\tDRV_LOG(ERR, \"Fail to get PD object info.\");\n+\t\tmlx5_glue->dealloc_pd(priv->pd);\n+\t\tpriv->pd = NULL;\n+\t\treturn -errno;\n+\t}\n+\tpriv->pdn = pd_info.pdn;\n+\treturn 0;\n+#else\n+\t(void)priv;\n+\tDRV_LOG(ERR, \"Cannot get pdn - no DV support.\");\n+\treturn -ENOTSUP;\n+#endif /* HAVE_IBV_FLOW_DV_SUPPORT */\n+}\n+\n+static int\n+mlx5_compress_hw_global_prepare(struct mlx5_compress_priv *priv)\n+{\n+\tif (mlx5_compress_pd_create(priv) != 0)\n+\t\treturn -1;\n+\tpriv->uar = mlx5_devx_alloc_uar(priv->ctx, -1);\n+\tif (priv->uar == NULL || mlx5_os_get_devx_uar_reg_addr(priv->uar) ==\n+\t    NULL) {\n+\t\trte_errno = errno;\n+\t\tclaim_zero(mlx5_glue->dealloc_pd(priv->pd));\n+\t\tDRV_LOG(ERR, \"Failed to allocate UAR.\");\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n+/**\n+ * DPDK callback to register a PCI device.\n+ *\n+ * This function spawns compress device out of a given PCI device.\n+ *\n+ * @param[in] pci_drv\n+ *   PCI driver structure (mlx5_compress_driver).\n+ * @param[in] pci_dev\n+ *   PCI device information.\n+ *\n+ * @return\n+ *   0 on success, 1 to skip this driver, a negative errno value otherwise\n+ *   and rte_errno is set.\n+ */\n+static int\n+mlx5_compress_pci_probe(struct rte_pci_driver *pci_drv,\n+\t\t\tstruct rte_pci_device *pci_dev)\n+{\n+\tstruct ibv_device *ibv;\n+\tstruct rte_compressdev *cdev;\n+\tstruct ibv_context *ctx;\n+\tstruct mlx5_compress_priv *priv;\n+\tstruct mlx5_hca_attr att = { 0 };\n+\tstruct rte_compressdev_pmd_init_params init_params = {\n+\t\t.name = \"\",\n+\t\t.socket_id = pci_dev->device.numa_node,\n+\t};\n+\n+\tRTE_SET_USED(pci_drv);\n+\tibv = mlx5_compress_get_ib_device_match(&pci_dev->addr);\n+\tif (ibv == NULL) {\n+\t\tDRV_LOG(ERR, \"No matching IB device for PCI slot \"\n+\t\t\tPCI_PRI_FMT \".\", pci_dev->addr.domain,\n+\t\t\tpci_dev->addr.bus, pci_dev->addr.devid,\n+\t\t\tpci_dev->addr.function);\n+\t\treturn -rte_errno;\n+\t}\n+\tDRV_LOG(INFO, \"PCI information matches for device \\\"%s\\\".\", ibv->name);\n+\tctx = mlx5_glue->dv_open_device(ibv);\n+\tif (ctx == NULL) {\n+\t\tDRV_LOG(ERR, \"Failed to open IB device \\\"%s\\\".\", ibv->name);\n+\t\trte_errno = ENODEV;\n+\t\treturn -rte_errno;\n+\t}\n+\tif (mlx5_devx_cmd_query_hca_attr(ctx, &att) != 0 ||\n+\t    att.mmo_compress_en == 0 || att.mmo_decompress_en == 0 ||\n+\t    att.mmo_dma_en == 0) {\n+\t\tDRV_LOG(ERR, \"Not enough capabilities to support compress \"\n+\t\t\t\"operations, maybe old FW/OFED version?\");\n+\t\tclaim_zero(mlx5_glue->close_device(ctx));\n+\t\trte_errno = ENOTSUP;\n+\t\treturn -ENOTSUP;\n+\t}\n+\tcdev = rte_compressdev_pmd_create(ibv->name, &pci_dev->device,\n+\t\t\t\t\t  sizeof(*priv), &init_params);\n+\tif (cdev == NULL) {\n+\t\tDRV_LOG(ERR, \"Failed to create device \\\"%s\\\".\", ibv->name);\n+\t\tclaim_zero(mlx5_glue->close_device(ctx));\n+\t\treturn -ENODEV;\n+\t}\n+\tDRV_LOG(INFO,\n+\t\t\"Compress device %s was created successfully.\", ibv->name);\n+\tcdev->dev_ops = &mlx5_compress_ops;\n+\tcdev->dequeue_burst = NULL;\n+\tcdev->enqueue_burst = NULL;\n+\tcdev->feature_flags = RTE_COMPDEV_FF_HW_ACCELERATED;\n+\tpriv = cdev->data->dev_private;\n+\tpriv->ctx = ctx;\n+\tpriv->pci_dev = pci_dev;\n+\tpriv->cdev = cdev;\n+\tpriv->min_block_size = att.compress_min_block_size;\n+\tif (mlx5_compress_hw_global_prepare(priv) != 0) {\n+\t\trte_compressdev_pmd_destroy(priv->cdev);\n+\t\tclaim_zero(mlx5_glue->close_device(priv->ctx));\n+\t\treturn -1;\n+\t}\n+\tpthread_mutex_lock(&priv_list_lock);\n+\tTAILQ_INSERT_TAIL(&mlx5_compress_priv_list, priv, next);\n+\tpthread_mutex_unlock(&priv_list_lock);\n+\treturn 0;\n+}\n+\n+/**\n+ * DPDK callback to remove a PCI device.\n+ *\n+ * This function removes all compress devices belong to a given PCI device.\n+ *\n+ * @param[in] pci_dev\n+ *   Pointer to the PCI device.\n+ *\n+ * @return\n+ *   0 on success, the function cannot fail.\n+ */\n+static int\n+mlx5_compress_pci_remove(struct rte_pci_device *pdev)\n+{\n+\tstruct mlx5_compress_priv *priv = NULL;\n+\tint found = 0;\n+\n+\tpthread_mutex_lock(&priv_list_lock);\n+\tTAILQ_FOREACH(priv, &mlx5_compress_priv_list, next) {\n+\t\tif (rte_pci_addr_cmp(&priv->pci_dev->addr, &pdev->addr) != 0) {\n+\t\t\tfound = 1;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\tif (found != 0)\n+\t\tTAILQ_REMOVE(&mlx5_compress_priv_list, priv, next);\n+\tpthread_mutex_unlock(&priv_list_lock);\n+\tif (found != 0) {\n+\t\tmlx5_compress_hw_global_release(priv);\n+\t\trte_compressdev_pmd_destroy(priv->cdev);\n+\t\tclaim_zero(mlx5_glue->close_device(priv->ctx));\n+\t}\n+\treturn 0;\n+}\n+\n+static const struct rte_pci_id mlx5_compress_pci_id_map[] = {\n+\t{\n+\t\tRTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,\n+\t\t\t\tPCI_DEVICE_ID_MELLANOX_CONNECTX6DXBF)\n+\t},\n+\t{\n+\t\t.vendor_id = 0\n+\t}\n+};\n+\n+static struct mlx5_pci_driver mlx5_compress_driver = {\n+\t.driver_class = MLX5_CLASS_COMPRESS,\n+\t.pci_driver = {\n+\t\t.driver = {\n+\t\t\t.name = RTE_STR(MLX5_COMPRESS_DRIVER_NAME),\n+\t\t},\n+\t\t.id_table = mlx5_compress_pci_id_map,\n+\t\t.probe = mlx5_compress_pci_probe,\n+\t\t.remove = mlx5_compress_pci_remove,\n+\t\t.drv_flags = 0,\n+\t},\n+};\n+\n+RTE_INIT(rte_mlx5_compress_init)\n+{\n+\tmlx5_common_init();\n+\tif (mlx5_glue != NULL)\n+\t\tmlx5_pci_driver_register(&mlx5_compress_driver);\n+}\n+\n+RTE_LOG_REGISTER(mlx5_compress_logtype, MLX5_COMPRESS_LOG_NAME, NOTICE)\n+RTE_PMD_EXPORT_NAME(MLX5_COMPRESS_DRIVER_NAME, __COUNTER__);\n+RTE_PMD_REGISTER_PCI_TABLE(MLX5_COMPRESS_DRIVER_NAME, mlx5_compress_pci_id_map);\n+RTE_PMD_REGISTER_KMOD_DEP(MLX5_COMPRESS_DRIVER_NAME, \"* ib_uverbs & mlx5_core & mlx5_ib\");\ndiff --git a/drivers/compress/mlx5/mlx5_compress_utils.h b/drivers/compress/mlx5/mlx5_compress_utils.h\nnew file mode 100644\nindex 0000000..f93244f\n--- /dev/null\n+++ b/drivers/compress/mlx5/mlx5_compress_utils.h\n@@ -0,0 +1,20 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2021 Mellanox Technologies, Ltd\n+ */\n+\n+#ifndef RTE_PMD_MLX5_COMPRESS_UTILS_H_\n+#define RTE_PMD_MLX5_COMPRESS_UTILS_H_\n+\n+#include <mlx5_common.h>\n+\n+\n+extern int mlx5_compress_logtype;\n+\n+#define MLX5_COMPRESS_LOG_PREFIX \"mlx5_compress\"\n+/* Generic printf()-like logging macro with automatic line feed. */\n+#define DRV_LOG(level, ...) \\\n+\tPMD_DRV_LOG_(level, mlx5_compress_logtype, MLX5_COMPRESS_LOG_PREFIX, \\\n+\t\t__VA_ARGS__ PMD_DRV_LOG_STRIP PMD_DRV_LOG_OPAREN, \\\n+\t\tPMD_DRV_LOG_CPAREN)\n+\n+#endif /* RTE_PMD_MLX5_COMPRESS_UTILS_H_ */\ndiff --git a/drivers/compress/mlx5/version.map b/drivers/compress/mlx5/version.map\nnew file mode 100644\nindex 0000000..4a76d1d\n--- /dev/null\n+++ b/drivers/compress/mlx5/version.map\n@@ -0,0 +1,3 @@\n+DPDK_21 {\n+\tlocal: *;\n+};\n",
    "prefixes": [
        "02/10"
    ]
}