get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 99798,
    "url": "http://patches.dpdk.org/api/patches/99798/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210927133450.10653-2-srikanth.k@oneconvergence.com/",
    "project": {
        "id": 1,
        "url": "http://patches.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": "<20210927133450.10653-2-srikanth.k@oneconvergence.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210927133450.10653-2-srikanth.k@oneconvergence.com",
    "date": "2021-09-27T13:34:32",
    "name": "[01/19] common/mlx5: stub for FreeBSD",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "922c0ea98caaca7c41dc26f5758332834a116b24",
    "submitter": {
        "id": 2368,
        "url": "http://patches.dpdk.org/api/people/2368/?format=api",
        "name": "Srikanth Kaka",
        "email": "srikanth.k@oneconvergence.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210927133450.10653-2-srikanth.k@oneconvergence.com/mbox/",
    "series": [
        {
            "id": 19193,
            "url": "http://patches.dpdk.org/api/series/19193/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19193",
            "date": "2021-09-27T13:34:31",
            "name": "MLX5 FreeBSD support",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/19193/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/99798/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/99798/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 9FA5AA0C46;\n\tMon, 27 Sep 2021 16:58:14 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A6A72410EE;\n\tMon, 27 Sep 2021 16:58:09 +0200 (CEST)",
            "from mail-pf1-f172.google.com (mail-pf1-f172.google.com\n [209.85.210.172])\n by mails.dpdk.org (Postfix) with ESMTP id A5DAF40E3C\n for <dev@dpdk.org>; Mon, 27 Sep 2021 15:35:40 +0200 (CEST)",
            "by mail-pf1-f172.google.com with SMTP id s16so15950999pfk.0\n for <dev@dpdk.org>; Mon, 27 Sep 2021 06:35:40 -0700 (PDT)",
            "from srikanth-ThinkPad-T450.domain.name ([223.178.22.200])\n by smtp.gmail.com with ESMTPSA id t6sm17342274pfh.63.2021.09.27.06.35.36\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 27 Sep 2021 06:35:38 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oneconvergence.com; s=google;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=oBxdK0bg66uM7KgwhWyw9h6XWX6tWqXEtaQGZkBwbdk=;\n b=UPFOm2EmIMH7OZ/q6RbGCSODbc9YjKLUMvllC+rHk61kn4LFB6I6nZ4aq2BSRKs4bI\n lZcEEBN9M7scJMXiFvlgwgZgtnZ1gjN2rt+DD7/ys3OgF6iMojY66CIuH3iAgc/YZL6F\n UV0nVsZzIaWzECoS5jTYGK1re69c7D21RYWQ8=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=oBxdK0bg66uM7KgwhWyw9h6XWX6tWqXEtaQGZkBwbdk=;\n b=wnFYIKzVsd+dozZ0OXjAQXPsD+FZ7FvoGuFk1e0U3Fqmjy4FWsoqFPeYVJcw5Eg4W2\n bN3IKj0Ga2gs2VClEg5euD7uqQD6ie6tKteOpWZbrB7nI2jd9EyzA2awofpPydewc62z\n CUj0GROQqTMQhDeFOeVnLiSNe2JCMXLmnGVGYBtSUA7VC1h+D3DYBE3MQ8aneav57mxh\n tgxWzSvrg9aL5ozwtrtl6/YaRV2i/2SjgI7cqMmUeNZM43WQFMiGjv7Pm+0uJJN7NFnb\n vvAtriHilqTtmRnXH6pqH8EfQxq4WAZ9L7y+Fuxz50vIV97o5bMn/zXTYW+kDYvK75Yb\n WNrw==",
        "X-Gm-Message-State": "AOAM530QStN8SmGM4o3zZFcbaSSFDQc3C0yuz2tHwQIso0HgfkvshW31\n 645g81EZdgmqXQz47uti7ZPLCmfx7AGPjQ==",
        "X-Google-Smtp-Source": "\n ABdhPJy76u2bNggHPfpQzJVuLpYKucJou3HnghOZ7eanqRyoxGkwPr26TdXyxERLig4h3qa8utgVbQ==",
        "X-Received": "by 2002:a62:7a11:0:b0:443:937:9fd1 with SMTP id\n v17-20020a627a11000000b0044309379fd1mr36483pfc.47.1632749739223;\n Mon, 27 Sep 2021 06:35:39 -0700 (PDT)",
        "From": "Srikanth Kaka <srikanth.k@oneconvergence.com>",
        "To": "Matan Azrad <matan@nvidia.com>,\n Viacheslav Ovsiienko <viacheslavo@nvidia.com>",
        "Cc": "dev@dpdk.org, Vag Singh <vag.singh@oneconvergence.com>,\n Anand Thulasiram <avelu@juniper.net>,\n Srikanth Kaka <srikanth.k@oneconvergence.com>",
        "Date": "Mon, 27 Sep 2021 19:04:32 +0530",
        "Message-Id": "<20210927133450.10653-2-srikanth.k@oneconvergence.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20210927133450.10653-1-srikanth.k@oneconvergence.com>",
        "References": "<20210927133450.10653-1-srikanth.k@oneconvergence.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Approved-At": "Mon, 27 Sep 2021 16:58:07 +0200",
        "Subject": "[dpdk-dev] [PATCH 01/19] common/mlx5: stub for FreeBSD",
        "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": "These files are a copy of their Linux equivalents.\nThey will be ported to FreeBSD.\n\nSigned-off-by: Srikanth Kaka <srikanth.k@oneconvergence.com>\nSigned-off-by: Vag Singh <vag.singh@oneconvergence.com>\nSigned-off-by: Anand Thulasiram <avelu@juniper.net>\n---\n drivers/common/mlx5/freebsd/mlx5_common_os.c  |  430 +++++\n drivers/common/mlx5/freebsd/mlx5_common_os.h  |  299 ++++\n .../common/mlx5/freebsd/mlx5_common_verbs.c   |   93 +\n drivers/common/mlx5/freebsd/mlx5_glue.c       | 1505 +++++++++++++++++\n drivers/common/mlx5/freebsd/mlx5_glue.h       |  373 ++++\n 5 files changed, 2700 insertions(+)\n create mode 100644 drivers/common/mlx5/freebsd/mlx5_common_os.c\n create mode 100644 drivers/common/mlx5/freebsd/mlx5_common_os.h\n create mode 100644 drivers/common/mlx5/freebsd/mlx5_common_verbs.c\n create mode 100644 drivers/common/mlx5/freebsd/mlx5_glue.c\n create mode 100644 drivers/common/mlx5/freebsd/mlx5_glue.h",
    "diff": "diff --git a/drivers/common/mlx5/freebsd/mlx5_common_os.c b/drivers/common/mlx5/freebsd/mlx5_common_os.c\nnew file mode 100644\nindex 0000000000..9e0c823c97\n--- /dev/null\n+++ b/drivers/common/mlx5/freebsd/mlx5_common_os.c\n@@ -0,0 +1,430 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#include <unistd.h>\n+#include <string.h>\n+#include <stdio.h>\n+#ifdef RTE_IBVERBS_LINK_DLOPEN\n+#include <dlfcn.h>\n+#endif\n+#include <dirent.h>\n+#include <net/if.h>\n+\n+#include <rte_errno.h>\n+#include <rte_string_fns.h>\n+\n+#include \"mlx5_common.h\"\n+#include \"mlx5_common_log.h\"\n+#include \"mlx5_common_os.h\"\n+#include \"mlx5_glue.h\"\n+\n+#ifdef MLX5_GLUE\n+const struct mlx5_glue *mlx5_glue;\n+#endif\n+\n+int\n+mlx5_get_pci_addr(const char *dev_path, struct rte_pci_addr *pci_addr)\n+{\n+\tFILE *file;\n+\tchar line[32];\n+\tint rc = -ENOENT;\n+\tMKSTR(path, \"%s/device/uevent\", dev_path);\n+\n+\tfile = fopen(path, \"rb\");\n+\tif (file == NULL) {\n+\t\trte_errno = errno;\n+\t\treturn -rte_errno;\n+\t}\n+\twhile (fgets(line, sizeof(line), file) == line) {\n+\t\tsize_t len = strlen(line);\n+\n+\t\t/* Truncate long lines. */\n+\t\tif (len == (sizeof(line) - 1)) {\n+\t\t\twhile (line[(len - 1)] != '\\n') {\n+\t\t\t\tint ret = fgetc(file);\n+\n+\t\t\t\tif (ret == EOF)\n+\t\t\t\t\tgoto exit;\n+\t\t\t\tline[(len - 1)] = ret;\n+\t\t\t}\n+\t\t\t/* No match for long lines. */\n+\t\t\tcontinue;\n+\t\t}\n+\t\t/* Extract information. */\n+\t\tif (sscanf(line,\n+\t\t\t   \"PCI_SLOT_NAME=\"\n+\t\t\t   \"%\" SCNx32 \":%\" SCNx8 \":%\" SCNx8 \".%\" SCNx8 \"\\n\",\n+\t\t\t   &pci_addr->domain,\n+\t\t\t   &pci_addr->bus,\n+\t\t\t   &pci_addr->devid,\n+\t\t\t   &pci_addr->function) == 4) {\n+\t\t\trc = 0;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+exit:\n+\tfclose(file);\n+\tif (rc)\n+\t\trte_errno = -rc;\n+\treturn rc;\n+}\n+\n+/**\n+ * Extract port name, as a number, from sysfs or netlink information.\n+ *\n+ * @param[in] port_name_in\n+ *   String representing the port name.\n+ * @param[out] port_info_out\n+ *   Port information, including port name as a number and port name\n+ *   type if recognized\n+ *\n+ * @return\n+ *   port_name field set according to recognized name format.\n+ */\n+void\n+mlx5_translate_port_name(const char *port_name_in,\n+\t\t\t struct mlx5_switch_info *port_info_out)\n+{\n+\tchar ctrl = 0, pf_c1, pf_c2, vf_c1, vf_c2, eol;\n+\tchar *end;\n+\tint sc_items;\n+\n+\tsc_items = sscanf(port_name_in, \"%c%d\",\n+\t\t\t  &ctrl, &port_info_out->ctrl_num);\n+\tif (sc_items == 2 && ctrl == 'c') {\n+\t\tport_name_in++; /* 'c' */\n+\t\tport_name_in += snprintf(NULL, 0, \"%d\",\n+\t\t\t\t\t  port_info_out->ctrl_num);\n+\t}\n+\t/* Check for port-name as a string of the form pf0vf0 or pf0sf0 */\n+\tsc_items = sscanf(port_name_in, \"%c%c%d%c%c%d%c\",\n+\t\t\t  &pf_c1, &pf_c2, &port_info_out->pf_num,\n+\t\t\t  &vf_c1, &vf_c2, &port_info_out->port_name, &eol);\n+\tif (sc_items == 6 && pf_c1 == 'p' && pf_c2 == 'f') {\n+\t\tif (vf_c1 == 'v' && vf_c2 == 'f') {\n+\t\t\t/* Kernel ver >= 5.0 or OFED ver >= 4.6 */\n+\t\t\tport_info_out->name_type =\n+\t\t\t\t\tMLX5_PHYS_PORT_NAME_TYPE_PFVF;\n+\t\t\treturn;\n+\t\t}\n+\t\tif (vf_c1 == 's' && vf_c2 == 'f') {\n+\t\t\t/* Kernel ver >= 5.11 or OFED ver >= 5.1 */\n+\t\t\tport_info_out->name_type =\n+\t\t\t\t\tMLX5_PHYS_PORT_NAME_TYPE_PFSF;\n+\t\t\treturn;\n+\t\t}\n+\t}\n+\t/*\n+\t * Check for port-name as a string of the form p0\n+\t * (support kernel ver >= 5.0, or OFED ver >= 4.6).\n+\t */\n+\tsc_items = sscanf(port_name_in, \"%c%d%c\",\n+\t\t\t  &pf_c1, &port_info_out->port_name, &eol);\n+\tif (sc_items == 2 && pf_c1 == 'p') {\n+\t\tport_info_out->name_type = MLX5_PHYS_PORT_NAME_TYPE_UPLINK;\n+\t\treturn;\n+\t}\n+\t/*\n+\t * Check for port-name as a string of the form pf0\n+\t * (support kernel ver >= 5.7 for HPF representor on BF).\n+\t */\n+\tsc_items = sscanf(port_name_in, \"%c%c%d%c\",\n+\t\t\t  &pf_c1, &pf_c2, &port_info_out->pf_num, &eol);\n+\tif (sc_items == 3 && pf_c1 == 'p' && pf_c2 == 'f') {\n+\t\tport_info_out->port_name = -1;\n+\t\tport_info_out->name_type = MLX5_PHYS_PORT_NAME_TYPE_PFHPF;\n+\t\treturn;\n+\t}\n+\t/* Check for port-name as a number (support kernel ver < 5.0 */\n+\terrno = 0;\n+\tport_info_out->port_name = strtol(port_name_in, &end, 0);\n+\tif (!errno &&\n+\t    (size_t)(end - port_name_in) == strlen(port_name_in)) {\n+\t\tport_info_out->name_type = MLX5_PHYS_PORT_NAME_TYPE_LEGACY;\n+\t\treturn;\n+\t}\n+\tport_info_out->name_type = MLX5_PHYS_PORT_NAME_TYPE_UNKNOWN;\n+}\n+\n+int\n+mlx5_get_ifname_sysfs(const char *ibdev_path, char *ifname)\n+{\n+\tDIR *dir;\n+\tstruct dirent *dent;\n+\tunsigned int dev_type = 0;\n+\tunsigned int dev_port_prev = ~0u;\n+\tchar match[IF_NAMESIZE] = \"\";\n+\n+\tMLX5_ASSERT(ibdev_path);\n+\t{\n+\t\tMKSTR(path, \"%s/device/net\", ibdev_path);\n+\n+\t\tdir = opendir(path);\n+\t\tif (dir == NULL) {\n+\t\t\trte_errno = errno;\n+\t\t\treturn -rte_errno;\n+\t\t}\n+\t}\n+\twhile ((dent = readdir(dir)) != NULL) {\n+\t\tchar *name = dent->d_name;\n+\t\tFILE *file;\n+\t\tunsigned int dev_port;\n+\t\tint r;\n+\n+\t\tif ((name[0] == '.') &&\n+\t\t    ((name[1] == '\\0') ||\n+\t\t     ((name[1] == '.') && (name[2] == '\\0'))))\n+\t\t\tcontinue;\n+\n+\t\tMKSTR(path, \"%s/device/net/%s/%s\",\n+\t\t      ibdev_path, name,\n+\t\t      (dev_type ? \"dev_id\" : \"dev_port\"));\n+\n+\t\tfile = fopen(path, \"rb\");\n+\t\tif (file == NULL) {\n+\t\t\tif (errno != ENOENT)\n+\t\t\t\tcontinue;\n+\t\t\t/*\n+\t\t\t * Switch to dev_id when dev_port does not exist as\n+\t\t\t * is the case with Linux kernel versions < 3.15.\n+\t\t\t */\n+try_dev_id:\n+\t\t\tmatch[0] = '\\0';\n+\t\t\tif (dev_type)\n+\t\t\t\tbreak;\n+\t\t\tdev_type = 1;\n+\t\t\tdev_port_prev = ~0u;\n+\t\t\trewinddir(dir);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tr = fscanf(file, (dev_type ? \"%x\" : \"%u\"), &dev_port);\n+\t\tfclose(file);\n+\t\tif (r != 1)\n+\t\t\tcontinue;\n+\t\t/*\n+\t\t * Switch to dev_id when dev_port returns the same value for\n+\t\t * all ports. May happen when using a MOFED release older than\n+\t\t * 3.0 with a Linux kernel >= 3.15.\n+\t\t */\n+\t\tif (dev_port == dev_port_prev)\n+\t\t\tgoto try_dev_id;\n+\t\tdev_port_prev = dev_port;\n+\t\tif (dev_port == 0)\n+\t\t\tstrlcpy(match, name, IF_NAMESIZE);\n+\t}\n+\tclosedir(dir);\n+\tif (match[0] == '\\0') {\n+\t\trte_errno = ENOENT;\n+\t\treturn -rte_errno;\n+\t}\n+\tstrncpy(ifname, match, IF_NAMESIZE);\n+\treturn 0;\n+}\n+\n+#ifdef MLX5_GLUE\n+\n+/**\n+ * Suffix RTE_EAL_PMD_PATH with \"-glue\".\n+ *\n+ * This function performs a sanity check on RTE_EAL_PMD_PATH before\n+ * suffixing its last component.\n+ *\n+ * @param buf[out]\n+ *   Output buffer, should be large enough otherwise NULL is returned.\n+ * @param size\n+ *   Size of @p out.\n+ *\n+ * @return\n+ *   Pointer to @p buf or @p NULL in case suffix cannot be appended.\n+ */\n+static char *\n+mlx5_glue_path(char *buf, size_t size)\n+{\n+\tstatic const char *const bad[] = { \"/\", \".\", \"..\", NULL };\n+\tconst char *path = RTE_EAL_PMD_PATH;\n+\tsize_t len = strlen(path);\n+\tsize_t off;\n+\tint i;\n+\n+\twhile (len && path[len - 1] == '/')\n+\t\t--len;\n+\tfor (off = len; off && path[off - 1] != '/'; --off)\n+\t\t;\n+\tfor (i = 0; bad[i]; ++i)\n+\t\tif (!strncmp(path + off, bad[i], (int)(len - off)))\n+\t\t\tgoto error;\n+\ti = snprintf(buf, size, \"%.*s-glue\", (int)len, path);\n+\tif (i == -1 || (size_t)i >= size)\n+\t\tgoto error;\n+\treturn buf;\n+error:\n+\tRTE_LOG(ERR, PMD, \"unable to append \\\"-glue\\\" to last component of\"\n+\t\t\" RTE_EAL_PMD_PATH (\\\"\" RTE_EAL_PMD_PATH \"\\\"), please\"\n+\t\t\" re-configure DPDK\");\n+\treturn NULL;\n+}\n+\n+static int\n+mlx5_glue_dlopen(void)\n+{\n+\tchar glue_path[sizeof(RTE_EAL_PMD_PATH) - 1 + sizeof(\"-glue\")];\n+\tvoid *handle = NULL;\n+\n+\tchar const *path[] = {\n+\t\t/*\n+\t\t * A basic security check is necessary before trusting\n+\t\t * MLX5_GLUE_PATH, which may override RTE_EAL_PMD_PATH.\n+\t\t */\n+\t\t(geteuid() == getuid() && getegid() == getgid() ?\n+\t\t getenv(\"MLX5_GLUE_PATH\") : NULL),\n+\t\t/*\n+\t\t * When RTE_EAL_PMD_PATH is set, use its glue-suffixed\n+\t\t * variant, otherwise let dlopen() look up libraries on its\n+\t\t * own.\n+\t\t */\n+\t\t(*RTE_EAL_PMD_PATH ?\n+\t\t mlx5_glue_path(glue_path, sizeof(glue_path)) : \"\"),\n+\t};\n+\tunsigned int i = 0;\n+\tvoid **sym;\n+\tconst char *dlmsg;\n+\n+\twhile (!handle && i != RTE_DIM(path)) {\n+\t\tconst char *end;\n+\t\tsize_t len;\n+\t\tint ret;\n+\n+\t\tif (!path[i]) {\n+\t\t\t++i;\n+\t\t\tcontinue;\n+\t\t}\n+\t\tend = strpbrk(path[i], \":;\");\n+\t\tif (!end)\n+\t\t\tend = path[i] + strlen(path[i]);\n+\t\tlen = end - path[i];\n+\t\tret = 0;\n+\t\tdo {\n+\t\t\tchar name[ret + 1];\n+\n+\t\t\tret = snprintf(name, sizeof(name), \"%.*s%s\" MLX5_GLUE,\n+\t\t\t\t       (int)len, path[i],\n+\t\t\t\t       (!len || *(end - 1) == '/') ? \"\" : \"/\");\n+\t\t\tif (ret == -1)\n+\t\t\t\tbreak;\n+\t\t\tif (sizeof(name) != (size_t)ret + 1)\n+\t\t\t\tcontinue;\n+\t\t\tDRV_LOG(DEBUG, \"Looking for rdma-core glue as \"\n+\t\t\t\t\"\\\"%s\\\"\", name);\n+\t\t\thandle = dlopen(name, RTLD_LAZY);\n+\t\t\tbreak;\n+\t\t} while (1);\n+\t\tpath[i] = end + 1;\n+\t\tif (!*end)\n+\t\t\t++i;\n+\t}\n+\tif (!handle) {\n+\t\trte_errno = EINVAL;\n+\t\tdlmsg = dlerror();\n+\t\tif (dlmsg)\n+\t\t\tDRV_LOG(WARNING, \"Cannot load glue library: %s\", dlmsg);\n+\t\tgoto glue_error;\n+\t}\n+\tsym = dlsym(handle, \"mlx5_glue\");\n+\tif (!sym || !*sym) {\n+\t\trte_errno = EINVAL;\n+\t\tdlmsg = dlerror();\n+\t\tif (dlmsg)\n+\t\t\tDRV_LOG(ERR, \"Cannot resolve glue symbol: %s\", dlmsg);\n+\t\tgoto glue_error;\n+\t}\n+\tmlx5_glue = *sym;\n+\treturn 0;\n+\n+glue_error:\n+\tif (handle)\n+\t\tdlclose(handle);\n+\treturn -1;\n+}\n+\n+#endif\n+\n+/**\n+ * Initialization routine for run-time dependency on rdma-core.\n+ */\n+void\n+mlx5_glue_constructor(void)\n+{\n+\t/*\n+\t * RDMAV_HUGEPAGES_SAFE tells ibv_fork_init() we intend to use\n+\t * huge pages. Calling ibv_fork_init() during init allows\n+\t * applications to use fork() safely for purposes other than\n+\t * using this PMD, which is not supported in forked processes.\n+\t */\n+\tsetenv(\"RDMAV_HUGEPAGES_SAFE\", \"1\", 1);\n+\t/* Match the size of Rx completion entry to the size of a cacheline. */\n+\tif (RTE_CACHE_LINE_SIZE == 128)\n+\t\tsetenv(\"MLX5_CQE_SIZE\", \"128\", 0);\n+\t/*\n+\t * MLX5_DEVICE_FATAL_CLEANUP tells ibv_destroy functions to\n+\t * cleanup all the Verbs resources even when the device was removed.\n+\t */\n+\tsetenv(\"MLX5_DEVICE_FATAL_CLEANUP\", \"1\", 1);\n+\n+#ifdef MLX5_GLUE\n+\tif (mlx5_glue_dlopen() != 0)\n+\t\tgoto glue_error;\n+#endif\n+\n+#ifdef RTE_LIBRTE_MLX5_DEBUG\n+\t/* Glue structure must not contain any NULL pointers. */\n+\t{\n+\t\tunsigned int i;\n+\n+\t\tfor (i = 0; i != sizeof(*mlx5_glue) / sizeof(void *); ++i)\n+\t\t\tMLX5_ASSERT(((const void *const *)mlx5_glue)[i]);\n+\t}\n+#endif\n+\tif (strcmp(mlx5_glue->version, MLX5_GLUE_VERSION)) {\n+\t\trte_errno = EINVAL;\n+\t\tDRV_LOG(ERR, \"rdma-core glue \\\"%s\\\" mismatch: \\\"%s\\\" is \"\n+\t\t\t\"required\", mlx5_glue->version, MLX5_GLUE_VERSION);\n+\t\tgoto glue_error;\n+\t}\n+\tmlx5_glue->fork_init();\n+\treturn;\n+\n+glue_error:\n+\tDRV_LOG(WARNING, \"Cannot initialize MLX5 common due to missing\"\n+\t\t\" run-time dependency on rdma-core libraries (libibverbs,\"\n+\t\t\" libmlx5)\");\n+\tmlx5_glue = NULL;\n+}\n+\n+struct ibv_device *\n+mlx5_os_get_ibv_device(const 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_get_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+}\ndiff --git a/drivers/common/mlx5/freebsd/mlx5_common_os.h b/drivers/common/mlx5/freebsd/mlx5_common_os.h\nnew file mode 100644\nindex 0000000000..c3202b6786\n--- /dev/null\n+++ b/drivers/common/mlx5/freebsd/mlx5_common_os.h\n@@ -0,0 +1,299 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#ifndef RTE_PMD_MLX5_COMMON_OS_H_\n+#define RTE_PMD_MLX5_COMMON_OS_H_\n+\n+#include <stdio.h>\n+#include <malloc.h>\n+\n+#include <rte_pci.h>\n+#include <rte_debug.h>\n+#include <rte_atomic.h>\n+#include <rte_log.h>\n+#include <rte_kvargs.h>\n+#include <rte_devargs.h>\n+\n+#include \"mlx5_autoconf.h\"\n+#include \"mlx5_glue.h\"\n+#include \"mlx5_malloc.h\"\n+\n+/**\n+ * Get device name. Given an ibv_device pointer - return a\n+ * pointer to the corresponding device name.\n+ *\n+ * @param[in] dev\n+ *   Pointer to ibv device.\n+ *\n+ * @return\n+ *   Pointer to device name if dev is valid, NULL otherwise.\n+ */\n+static inline const char *\n+mlx5_os_get_dev_device_name(void *dev)\n+{\n+\tif (!dev)\n+\t\treturn NULL;\n+\treturn ((struct ibv_device *)dev)->name;\n+}\n+\n+/**\n+ * Get ibv device name. Given an ibv_context pointer - return a\n+ * pointer to the corresponding device name.\n+ *\n+ * @param[in] ctx\n+ *   Pointer to ibv context.\n+ *\n+ * @return\n+ *   Pointer to device name if ctx is valid, NULL otherwise.\n+ */\n+static inline const char *\n+mlx5_os_get_ctx_device_name(void *ctx)\n+{\n+\tif (!ctx)\n+\t\treturn NULL;\n+\treturn ((struct ibv_context *)ctx)->device->name;\n+}\n+\n+/**\n+ * Get ibv device path name. Given an ibv_context pointer - return a\n+ * pointer to the corresponding device path name.\n+ *\n+ * @param[in] ctx\n+ *   Pointer to ibv context.\n+ *\n+ * @return\n+ *   Pointer to device path name if ctx is valid, NULL otherwise.\n+ */\n+\n+static inline const char *\n+mlx5_os_get_ctx_device_path(void *ctx)\n+{\n+\tif (!ctx)\n+\t\treturn NULL;\n+\n+\treturn ((struct ibv_context *)ctx)->device->ibdev_path;\n+}\n+\n+/**\n+ * Get umem id. Given a pointer to umem object of type\n+ * 'struct mlx5dv_devx_umem *' - return its id.\n+ *\n+ * @param[in] umem\n+ *    Pointer to umem object.\n+ *\n+ * @return\n+ *    The umem id if umem is valid, 0 otherwise.\n+ */\n+static inline uint32_t\n+mlx5_os_get_umem_id(void *umem)\n+{\n+\tif (!umem)\n+\t\treturn 0;\n+\treturn ((struct mlx5dv_devx_umem *)umem)->umem_id;\n+}\n+\n+/**\n+ * Get fd. Given a pointer to DevX channel object of type\n+ * 'struct mlx5dv_devx_event_channel*' - return its fd.\n+ *\n+ * @param[in] channel\n+ *    Pointer to channel object.\n+ *\n+ * @return\n+ *    The fd if channel is valid, 0 otherwise.\n+ */\n+static inline int\n+mlx5_os_get_devx_channel_fd(void *channel)\n+{\n+\tif (!channel)\n+\t\treturn 0;\n+\treturn ((struct mlx5dv_devx_event_channel *)channel)->fd;\n+}\n+\n+/**\n+ * Get mmap offset. Given a pointer to an DevX UAR object of type\n+ * 'struct mlx5dv_devx_uar *' - return its mmap offset.\n+ *\n+ * @param[in] uar\n+ *    Pointer to UAR object.\n+ *\n+ * @return\n+ *    The mmap offset if uar is valid, 0 otherwise.\n+ */\n+static inline off_t\n+mlx5_os_get_devx_uar_mmap_offset(void *uar)\n+{\n+#ifdef HAVE_MLX5DV_DEVX_UAR_OFFSET\n+\tif (!uar)\n+\t\treturn 0;\n+\treturn ((struct mlx5dv_devx_uar *)uar)->mmap_off;\n+#else\n+\tRTE_SET_USED(uar);\n+\treturn 0;\n+#endif\n+}\n+\n+/**\n+ * Get base addr pointer. Given a pointer to an UAR object of type\n+ * 'struct mlx5dv_devx_uar *' - return its base address.\n+ *\n+ * @param[in] uar\n+ *    Pointer to an UAR object.\n+ *\n+ * @return\n+ *    The base address if UAR is valid, 0 otherwise.\n+ */\n+static inline void *\n+mlx5_os_get_devx_uar_base_addr(void *uar)\n+{\n+#ifdef HAVE_MLX5DV_DEVX_UAR_OFFSET\n+\tif (!uar)\n+\t\treturn NULL;\n+\treturn ((struct mlx5dv_devx_uar *)uar)->base_addr;\n+#else\n+\tRTE_SET_USED(uar);\n+\treturn NULL;\n+#endif\n+}\n+\n+/**\n+ * Get reg addr pointer. Given a pointer to an UAR object of type\n+ * 'struct mlx5dv_devx_uar *' - return its reg address.\n+ *\n+ * @param[in] uar\n+ *    Pointer to an UAR object.\n+ *\n+ * @return\n+ *    The reg address if UAR is valid, 0 otherwise.\n+ */\n+static inline void *\n+mlx5_os_get_devx_uar_reg_addr(void *uar)\n+{\n+#ifdef HAVE_MLX5DV_DEVX_UAR_OFFSET\n+\tif (!uar)\n+\t\treturn NULL;\n+\treturn ((struct mlx5dv_devx_uar *)uar)->reg_addr;\n+#else\n+\tRTE_SET_USED(uar);\n+\treturn NULL;\n+#endif\n+}\n+\n+/**\n+ * Get page id. Given a pointer to an UAR object of type\n+ * 'struct mlx5dv_devx_uar *' - return its page id.\n+ *\n+ * @param[in] uar\n+ *    Pointer to an UAR object.\n+ *\n+ * @return\n+ *    The page id if UAR is valid, 0 otherwise.\n+ */\n+static inline uint32_t\n+mlx5_os_get_devx_uar_page_id(void *uar)\n+{\n+#ifdef HAVE_MLX5DV_DEVX_UAR_OFFSET\n+\tif (!uar)\n+\t\treturn 0;\n+\treturn ((struct mlx5dv_devx_uar *)uar)->page_id;\n+#else\n+\tRTE_SET_USED(uar);\n+\treturn 0;\n+#endif\n+}\n+\n+__rte_internal\n+static inline void *\n+mlx5_os_alloc_pd(void *ctx)\n+{\n+\treturn mlx5_glue->alloc_pd(ctx);\n+}\n+\n+__rte_internal\n+static inline int\n+mlx5_os_dealloc_pd(void *pd)\n+{\n+\treturn mlx5_glue->dealloc_pd(pd);\n+}\n+\n+__rte_internal\n+static inline void *\n+mlx5_os_umem_reg(void *ctx, void *addr, size_t size, uint32_t access)\n+{\n+\treturn mlx5_glue->devx_umem_reg(ctx, addr, size, access);\n+}\n+\n+__rte_internal\n+static inline int\n+mlx5_os_umem_dereg(void *pumem)\n+{\n+\treturn mlx5_glue->devx_umem_dereg(pumem);\n+}\n+\n+static inline void *\n+mlx5_os_devx_create_event_channel(void *ctx, int flags)\n+{\n+\treturn mlx5_glue->devx_create_event_channel(ctx, flags);\n+}\n+\n+static inline void\n+mlx5_os_devx_destroy_event_channel(void *eventc)\n+{\n+\tmlx5_glue->devx_destroy_event_channel(eventc);\n+}\n+\n+static inline int\n+mlx5_os_devx_subscribe_devx_event(void *eventc,\n+\t\t\t\t  void *obj,\n+\t\t\t\t  uint16_t events_sz, uint16_t events_num[],\n+\t\t\t\t  uint64_t cookie)\n+{\n+\treturn mlx5_glue->devx_subscribe_devx_event(eventc, obj, events_sz,\n+\t\t\t\t\t\t    events_num, cookie);\n+}\n+\n+/**\n+ * Memory allocation optionally with alignment.\n+ *\n+ * @param[in] align\n+ *    Alignment size (may be zero)\n+ * @param[in] size\n+ *    Size in bytes to allocate\n+ *\n+ * @return\n+ *    Valid pointer to allocated memory, NULL in case of failure\n+ */\n+static inline void *\n+mlx5_os_malloc(size_t align, size_t size)\n+{\n+\tvoid *buf;\n+\n+\tif (posix_memalign(&buf, align, size))\n+\t\treturn NULL;\n+\treturn buf;\n+}\n+\n+/**\n+ * This API de-allocates a memory that originally could have been\n+ * allocated aligned or non-aligned. In Linux it is a wrapper\n+ * around free().\n+ *\n+ * @param[in] addr\n+ *    Pointer to address to free\n+ *\n+ */\n+static inline void\n+mlx5_os_free(void *addr)\n+{\n+\tfree(addr);\n+}\n+\n+struct ibv_device *\n+mlx5_os_get_ibv_device(const struct rte_pci_addr *addr);\n+\n+__rte_internal\n+struct ibv_device *\n+mlx5_os_get_ibv_dev(const struct rte_device *dev);\n+\n+#endif /* RTE_PMD_MLX5_COMMON_OS_H_ */\ndiff --git a/drivers/common/mlx5/freebsd/mlx5_common_verbs.c b/drivers/common/mlx5/freebsd/mlx5_common_verbs.c\nnew file mode 100644\nindex 0000000000..9080bd3e87\n--- /dev/null\n+++ b/drivers/common/mlx5/freebsd/mlx5_common_verbs.c\n@@ -0,0 +1,93 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#include <stddef.h>\n+#include <errno.h>\n+#include <string.h>\n+#include <stdint.h>\n+#include <unistd.h>\n+#include <sys/mman.h>\n+#include <inttypes.h>\n+\n+#include <rte_errno.h>\n+#include <rte_bus_pci.h>\n+#include <rte_bus_auxiliary.h>\n+\n+#include \"mlx5_common_utils.h\"\n+#include \"mlx5_common_log.h\"\n+#include \"mlx5_common_private.h\"\n+#include \"mlx5_autoconf.h\"\n+#include <mlx5_glue.h>\n+#include <mlx5_common.h>\n+#include <mlx5_common_mr.h>\n+\n+struct ibv_device *\n+mlx5_os_get_ibv_dev(const struct rte_device *dev)\n+{\n+\tstruct ibv_device *ibv;\n+\n+\tif (mlx5_dev_is_pci(dev))\n+\t\tibv = mlx5_os_get_ibv_device(&RTE_DEV_TO_PCI_CONST(dev)->addr);\n+\telse\n+\t\tibv = mlx5_get_aux_ibv_device(RTE_DEV_TO_AUXILIARY_CONST(dev));\n+\tif (ibv == NULL) {\n+\t\trte_errno = ENODEV;\n+\t\tDRV_LOG(ERR, \"Verbs device not found: %s\", dev->name);\n+\t}\n+\treturn ibv;\n+}\n+\n+/**\n+ * Register mr. Given protection domain pointer, pointer to addr and length\n+ * register the memory region.\n+ *\n+ * @param[in] pd\n+ *   Pointer to protection domain context.\n+ * @param[in] addr\n+ *   Pointer to memory start address.\n+ * @param[in] length\n+ *   Length of the memory to register.\n+ * @param[out] pmd_mr\n+ *   pmd_mr struct set with lkey, address, length and pointer to mr object\n+ *\n+ * @return\n+ *   0 on successful registration, -1 otherwise\n+ */\n+int\n+mlx5_common_verbs_reg_mr(void *pd, void *addr, size_t length,\n+\t\t\t struct mlx5_pmd_mr *pmd_mr)\n+{\n+\tstruct ibv_mr *ibv_mr;\n+\n+\tibv_mr = mlx5_glue->reg_mr(pd, addr, length,\n+\t\t\t\t   IBV_ACCESS_LOCAL_WRITE |\n+\t\t\t\t   (haswell_broadwell_cpu ? 0 :\n+\t\t\t\t   IBV_ACCESS_RELAXED_ORDERING));\n+\tif (!ibv_mr)\n+\t\treturn -1;\n+\n+\t*pmd_mr = (struct mlx5_pmd_mr){\n+\t\t.lkey = ibv_mr->lkey,\n+\t\t.addr = ibv_mr->addr,\n+\t\t.len = ibv_mr->length,\n+\t\t.obj = (void *)ibv_mr,\n+\t};\n+\treturn 0;\n+}\n+\n+/**\n+ * Deregister mr. Given the mlx5 pmd MR - deregister the MR\n+ *\n+ * @param[in] pmd_mr\n+ *   pmd_mr struct set with lkey, address, length and pointer to mr object\n+ *\n+ */\n+void\n+mlx5_common_verbs_dereg_mr(struct mlx5_pmd_mr *pmd_mr)\n+{\n+\tif (pmd_mr && pmd_mr->obj != NULL) {\n+\t\tclaim_zero(mlx5_glue->dereg_mr(pmd_mr->obj));\n+\t\tmemset(pmd_mr, 0, sizeof(*pmd_mr));\n+\t}\n+}\ndiff --git a/drivers/common/mlx5/freebsd/mlx5_glue.c b/drivers/common/mlx5/freebsd/mlx5_glue.c\nnew file mode 100644\nindex 0000000000..037ca961a0\n--- /dev/null\n+++ b/drivers/common/mlx5/freebsd/mlx5_glue.c\n@@ -0,0 +1,1505 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2018 6WIND S.A.\n+ * Copyright 2018 Mellanox Technologies, Ltd\n+ */\n+\n+#include <errno.h>\n+#include <stdalign.h>\n+#include <stddef.h>\n+#include <stdint.h>\n+#include <stdlib.h>\n+/*\n+ * Not needed by this file; included to work around the lack of off_t\n+ * definition for mlx5dv.h with unpatched rdma-core versions.\n+ */\n+#include <sys/types.h>\n+\n+#include \"mlx5_glue.h\"\n+\n+static int\n+mlx5_glue_fork_init(void)\n+{\n+\treturn ibv_fork_init();\n+}\n+\n+static struct ibv_pd *\n+mlx5_glue_alloc_pd(struct ibv_context *context)\n+{\n+\treturn ibv_alloc_pd(context);\n+}\n+\n+static int\n+mlx5_glue_dealloc_pd(struct ibv_pd *pd)\n+{\n+\treturn ibv_dealloc_pd(pd);\n+}\n+\n+static struct ibv_device **\n+mlx5_glue_get_device_list(int *num_devices)\n+{\n+\treturn ibv_get_device_list(num_devices);\n+}\n+\n+static void\n+mlx5_glue_free_device_list(struct ibv_device **list)\n+{\n+\tibv_free_device_list(list);\n+}\n+\n+static struct ibv_context *\n+mlx5_glue_open_device(struct ibv_device *device)\n+{\n+\treturn ibv_open_device(device);\n+}\n+\n+static int\n+mlx5_glue_close_device(struct ibv_context *context)\n+{\n+\treturn ibv_close_device(context);\n+}\n+\n+static int\n+mlx5_glue_query_device(struct ibv_context *context,\n+\t\t       struct ibv_device_attr *device_attr)\n+{\n+\treturn ibv_query_device(context, device_attr);\n+}\n+\n+static int\n+mlx5_glue_query_device_ex(struct ibv_context *context,\n+\t\t\t  const struct ibv_query_device_ex_input *input,\n+\t\t\t  struct ibv_device_attr_ex *attr)\n+{\n+\treturn ibv_query_device_ex(context, input, attr);\n+}\n+\n+static int\n+mlx5_glue_query_rt_values_ex(struct ibv_context *context,\n+\t\t\t  struct ibv_values_ex *values)\n+{\n+\treturn ibv_query_rt_values_ex(context, values);\n+}\n+\n+static int\n+mlx5_glue_query_port(struct ibv_context *context, uint8_t port_num,\n+\t\t     struct ibv_port_attr *port_attr)\n+{\n+\treturn ibv_query_port(context, port_num, port_attr);\n+}\n+\n+static struct ibv_comp_channel *\n+mlx5_glue_create_comp_channel(struct ibv_context *context)\n+{\n+\treturn ibv_create_comp_channel(context);\n+}\n+\n+static int\n+mlx5_glue_destroy_comp_channel(struct ibv_comp_channel *channel)\n+{\n+\treturn ibv_destroy_comp_channel(channel);\n+}\n+\n+static struct ibv_cq *\n+mlx5_glue_create_cq(struct ibv_context *context, int cqe, void *cq_context,\n+\t\t    struct ibv_comp_channel *channel, int comp_vector)\n+{\n+\treturn ibv_create_cq(context, cqe, cq_context, channel, comp_vector);\n+}\n+\n+static int\n+mlx5_glue_destroy_cq(struct ibv_cq *cq)\n+{\n+\treturn ibv_destroy_cq(cq);\n+}\n+\n+static int\n+mlx5_glue_get_cq_event(struct ibv_comp_channel *channel, struct ibv_cq **cq,\n+\t\t       void **cq_context)\n+{\n+\treturn ibv_get_cq_event(channel, cq, cq_context);\n+}\n+\n+static void\n+mlx5_glue_ack_cq_events(struct ibv_cq *cq, unsigned int nevents)\n+{\n+\tibv_ack_cq_events(cq, nevents);\n+}\n+\n+static struct ibv_rwq_ind_table *\n+mlx5_glue_create_rwq_ind_table(struct ibv_context *context,\n+\t\t\t       struct ibv_rwq_ind_table_init_attr *init_attr)\n+{\n+\treturn ibv_create_rwq_ind_table(context, init_attr);\n+}\n+\n+static int\n+mlx5_glue_destroy_rwq_ind_table(struct ibv_rwq_ind_table *rwq_ind_table)\n+{\n+\treturn ibv_destroy_rwq_ind_table(rwq_ind_table);\n+}\n+\n+static struct ibv_wq *\n+mlx5_glue_create_wq(struct ibv_context *context,\n+\t\t    struct ibv_wq_init_attr *wq_init_attr)\n+{\n+\treturn ibv_create_wq(context, wq_init_attr);\n+}\n+\n+static int\n+mlx5_glue_destroy_wq(struct ibv_wq *wq)\n+{\n+\treturn ibv_destroy_wq(wq);\n+}\n+static int\n+mlx5_glue_modify_wq(struct ibv_wq *wq, struct ibv_wq_attr *wq_attr)\n+{\n+\treturn ibv_modify_wq(wq, wq_attr);\n+}\n+\n+static struct ibv_flow *\n+mlx5_glue_create_flow(struct ibv_qp *qp, struct ibv_flow_attr *flow)\n+{\n+\treturn ibv_create_flow(qp, flow);\n+}\n+\n+static int\n+mlx5_glue_destroy_flow(struct ibv_flow *flow_id)\n+{\n+\treturn ibv_destroy_flow(flow_id);\n+}\n+\n+static int\n+mlx5_glue_destroy_flow_action(void *action)\n+{\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_action_destroy(action);\n+#else\n+\tstruct mlx5dv_flow_action_attr *attr = action;\n+\tint res = 0;\n+\tswitch (attr->type) {\n+\tcase MLX5DV_FLOW_ACTION_TAG:\n+\t\tbreak;\n+\tdefault:\n+\t\tres = ibv_destroy_flow_action(attr->action);\n+\t\tbreak;\n+\t}\n+\tfree(action);\n+\treturn res;\n+#endif\n+#else\n+\t(void)action;\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n+static struct ibv_qp *\n+mlx5_glue_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *qp_init_attr)\n+{\n+\treturn ibv_create_qp(pd, qp_init_attr);\n+}\n+\n+static struct ibv_qp *\n+mlx5_glue_create_qp_ex(struct ibv_context *context,\n+\t\t       struct ibv_qp_init_attr_ex *qp_init_attr_ex)\n+{\n+\treturn ibv_create_qp_ex(context, qp_init_attr_ex);\n+}\n+\n+static int\n+mlx5_glue_destroy_qp(struct ibv_qp *qp)\n+{\n+\treturn ibv_destroy_qp(qp);\n+}\n+\n+static int\n+mlx5_glue_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, int attr_mask)\n+{\n+\treturn ibv_modify_qp(qp, attr, attr_mask);\n+}\n+\n+static struct ibv_mr *\n+mlx5_glue_reg_mr(struct ibv_pd *pd, void *addr, size_t length, int access)\n+{\n+\treturn ibv_reg_mr(pd, addr, length, access);\n+}\n+\n+static struct ibv_mr *\n+mlx5_glue_alloc_null_mr(struct ibv_pd *pd)\n+{\n+#ifdef HAVE_IBV_DEVX_OBJ\n+\treturn ibv_alloc_null_mr(pd);\n+#else\n+\t(void)pd;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_dereg_mr(struct ibv_mr *mr)\n+{\n+\treturn ibv_dereg_mr(mr);\n+}\n+\n+static struct ibv_counter_set *\n+mlx5_glue_create_counter_set(struct ibv_context *context,\n+\t\t\t     struct ibv_counter_set_init_attr *init_attr)\n+{\n+#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42\n+\t(void)context;\n+\t(void)init_attr;\n+\treturn NULL;\n+#else\n+\treturn ibv_create_counter_set(context, init_attr);\n+#endif\n+}\n+\n+static int\n+mlx5_glue_destroy_counter_set(struct ibv_counter_set *cs)\n+{\n+#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42\n+\t(void)cs;\n+\treturn -ENOTSUP;\n+#else\n+\treturn ibv_destroy_counter_set(cs);\n+#endif\n+}\n+\n+static int\n+mlx5_glue_describe_counter_set(struct ibv_context *context,\n+\t\t\t       uint16_t counter_set_id,\n+\t\t\t       struct ibv_counter_set_description *cs_desc)\n+{\n+#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42\n+\t(void)context;\n+\t(void)counter_set_id;\n+\t(void)cs_desc;\n+\treturn -ENOTSUP;\n+#else\n+\treturn ibv_describe_counter_set(context, counter_set_id, cs_desc);\n+#endif\n+}\n+\n+static int\n+mlx5_glue_query_counter_set(struct ibv_query_counter_set_attr *query_attr,\n+\t\t\t    struct ibv_counter_set_data *cs_data)\n+{\n+#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42\n+\t(void)query_attr;\n+\t(void)cs_data;\n+\treturn -ENOTSUP;\n+#else\n+\treturn ibv_query_counter_set(query_attr, cs_data);\n+#endif\n+}\n+\n+static struct ibv_counters *\n+mlx5_glue_create_counters(struct ibv_context *context,\n+\t\t\t  struct ibv_counters_init_attr *init_attr)\n+{\n+#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V45\n+\t(void)context;\n+\t(void)init_attr;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#else\n+\treturn ibv_create_counters(context, init_attr);\n+#endif\n+}\n+\n+static int\n+mlx5_glue_destroy_counters(struct ibv_counters *counters)\n+{\n+#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V45\n+\t(void)counters;\n+\treturn -ENOTSUP;\n+#else\n+\treturn ibv_destroy_counters(counters);\n+#endif\n+}\n+\n+static int\n+mlx5_glue_attach_counters(struct ibv_counters *counters,\n+\t\t\t  struct ibv_counter_attach_attr *attr,\n+\t\t\t  struct ibv_flow *flow)\n+{\n+#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V45\n+\t(void)counters;\n+\t(void)attr;\n+\t(void)flow;\n+\treturn -ENOTSUP;\n+#else\n+\treturn ibv_attach_counters_point_flow(counters, attr, flow);\n+#endif\n+}\n+\n+static int\n+mlx5_glue_query_counters(struct ibv_counters *counters,\n+\t\t\t uint64_t *counters_value,\n+\t\t\t uint32_t ncounters,\n+\t\t\t uint32_t flags)\n+{\n+#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V45\n+\t(void)counters;\n+\t(void)counters_value;\n+\t(void)ncounters;\n+\t(void)flags;\n+\treturn -ENOTSUP;\n+#else\n+\treturn ibv_read_counters(counters, counters_value, ncounters, flags);\n+#endif\n+}\n+\n+static void\n+mlx5_glue_ack_async_event(struct ibv_async_event *event)\n+{\n+\tibv_ack_async_event(event);\n+}\n+\n+static int\n+mlx5_glue_get_async_event(struct ibv_context *context,\n+\t\t\t  struct ibv_async_event *event)\n+{\n+\treturn ibv_get_async_event(context, event);\n+}\n+\n+static const char *\n+mlx5_glue_port_state_str(enum ibv_port_state port_state)\n+{\n+\treturn ibv_port_state_str(port_state);\n+}\n+\n+static struct ibv_cq *\n+mlx5_glue_cq_ex_to_cq(struct ibv_cq_ex *cq)\n+{\n+\treturn ibv_cq_ex_to_cq(cq);\n+}\n+\n+static void *\n+mlx5_glue_dr_create_flow_action_dest_flow_tbl(void *tbl)\n+{\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_action_create_dest_table(tbl);\n+#else\n+\t(void)tbl;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dr_create_flow_action_dest_port(void *domain, uint32_t port)\n+{\n+#ifdef HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT\n+\treturn mlx5dv_dr_action_create_dest_ib_port(domain, port);\n+#else\n+#ifdef HAVE_MLX5DV_DR_ESWITCH\n+\treturn mlx5dv_dr_action_create_dest_vport(domain, port);\n+#else\n+\t(void)domain;\n+\t(void)port;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dr_create_flow_action_drop(void)\n+{\n+#ifdef HAVE_MLX5DV_DR_ESWITCH\n+\treturn mlx5dv_dr_action_create_drop();\n+#else\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dr_create_flow_action_push_vlan(struct mlx5dv_dr_domain *domain,\n+\t\t\t\t\t  rte_be32_t vlan_tag)\n+{\n+#ifdef HAVE_MLX5DV_DR_VLAN\n+\treturn mlx5dv_dr_action_create_push_vlan(domain, vlan_tag);\n+#else\n+\t(void)domain;\n+\t(void)vlan_tag;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dr_create_flow_action_pop_vlan(void)\n+{\n+#ifdef HAVE_MLX5DV_DR_VLAN\n+\treturn mlx5dv_dr_action_create_pop_vlan();\n+#else\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dr_create_flow_tbl(void *domain, uint32_t level)\n+{\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_table_create(domain, level);\n+#else\n+\t(void)domain;\n+\t(void)level;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_dr_destroy_flow_tbl(void *tbl)\n+{\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_table_destroy(tbl);\n+#else\n+\t(void)tbl;\n+\terrno = ENOTSUP;\n+\treturn errno;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dr_create_domain(struct ibv_context *ctx,\n+\t\t\t   enum  mlx5dv_dr_domain_type domain)\n+{\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_domain_create(ctx, domain);\n+#else\n+\t(void)ctx;\n+\t(void)domain;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_dr_destroy_domain(void *domain)\n+{\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_domain_destroy(domain);\n+#else\n+\t(void)domain;\n+\terrno = ENOTSUP;\n+\treturn errno;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_dr_sync_domain(void *domain, uint32_t flags)\n+{\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_domain_sync(domain, flags);\n+#else\n+\t(void)domain;\n+\t(void)flags;\n+\terrno = ENOTSUP;\n+\treturn errno;\n+#endif\n+}\n+\n+static struct ibv_cq_ex *\n+mlx5_glue_dv_create_cq(struct ibv_context *context,\n+\t\t       struct ibv_cq_init_attr_ex *cq_attr,\n+\t\t       struct mlx5dv_cq_init_attr *mlx5_cq_attr)\n+{\n+\treturn mlx5dv_create_cq(context, cq_attr, mlx5_cq_attr);\n+}\n+\n+static struct ibv_wq *\n+mlx5_glue_dv_create_wq(struct ibv_context *context,\n+\t\t       struct ibv_wq_init_attr *wq_attr,\n+\t\t       struct mlx5dv_wq_init_attr *mlx5_wq_attr)\n+{\n+#ifndef HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT\n+\t(void)context;\n+\t(void)wq_attr;\n+\t(void)mlx5_wq_attr;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#else\n+\treturn mlx5dv_create_wq(context, wq_attr, mlx5_wq_attr);\n+#endif\n+}\n+\n+static int\n+mlx5_glue_dv_query_device(struct ibv_context *ctx,\n+\t\t\t  struct mlx5dv_context *attrs_out)\n+{\n+\treturn mlx5dv_query_device(ctx, attrs_out);\n+}\n+\n+static int\n+mlx5_glue_dv_set_context_attr(struct ibv_context *ibv_ctx,\n+\t\t\t      enum mlx5dv_set_ctx_attr_type type, void *attr)\n+{\n+\treturn mlx5dv_set_context_attr(ibv_ctx, type, attr);\n+}\n+\n+static int\n+mlx5_glue_dv_init_obj(struct mlx5dv_obj *obj, uint64_t obj_type)\n+{\n+\treturn mlx5dv_init_obj(obj, obj_type);\n+}\n+\n+static struct ibv_qp *\n+mlx5_glue_dv_create_qp(struct ibv_context *context,\n+\t\t       struct ibv_qp_init_attr_ex *qp_init_attr_ex,\n+\t\t       struct mlx5dv_qp_init_attr *dv_qp_init_attr)\n+{\n+#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT\n+\treturn mlx5dv_create_qp(context, qp_init_attr_ex, dv_qp_init_attr);\n+#else\n+\t(void)context;\n+\t(void)qp_init_attr_ex;\n+\t(void)dv_qp_init_attr;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dv_create_flow_matcher(struct ibv_context *context,\n+\t\t\t\t struct mlx5dv_flow_matcher_attr *matcher_attr,\n+\t\t\t\t void *tbl)\n+{\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\t(void)context;\n+\treturn mlx5dv_dr_matcher_create(tbl, matcher_attr->priority,\n+\t\t\t\t\tmatcher_attr->match_criteria_enable,\n+\t\t\t\t\tmatcher_attr->match_mask);\n+#else\n+\t(void)tbl;\n+\treturn mlx5dv_create_flow_matcher(context, matcher_attr);\n+#endif\n+#else\n+\t(void)context;\n+\t(void)matcher_attr;\n+\t(void)tbl;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dv_create_flow(void *matcher,\n+\t\t\t void *match_value,\n+\t\t\t size_t num_actions,\n+\t\t\t void *actions[])\n+{\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_rule_create(matcher, match_value, num_actions,\n+\t\t\t\t     (struct mlx5dv_dr_action **)actions);\n+#else\n+\tsize_t i;\n+\tstruct mlx5dv_flow_action_attr actions_attr[8];\n+\n+\tif (num_actions > 8)\n+\t\treturn NULL;\n+\tfor (i = 0; i < num_actions; i++)\n+\t\tactions_attr[i] =\n+\t\t\t*((struct mlx5dv_flow_action_attr *)(actions[i]));\n+\treturn mlx5dv_create_flow(matcher, match_value,\n+\t\t\t\t  num_actions, actions_attr);\n+#endif\n+#else\n+\t(void)matcher;\n+\t(void)match_value;\n+\t(void)num_actions;\n+\t(void)actions;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dv_create_flow_action_counter(void *counter_obj, uint32_t offset)\n+{\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_action_create_flow_counter(counter_obj, offset);\n+#else\n+\tstruct mlx5dv_flow_action_attr *action;\n+\n+\t(void)offset;\n+\taction = malloc(sizeof(*action));\n+\tif (!action)\n+\t\treturn NULL;\n+\taction->type = MLX5DV_FLOW_ACTION_COUNTERS_DEVX;\n+\taction->obj = counter_obj;\n+\treturn action;\n+#endif\n+#else\n+\t(void)counter_obj;\n+\t(void)offset;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dv_create_flow_action_dest_ibv_qp(void *qp)\n+{\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_action_create_dest_ibv_qp(qp);\n+#else\n+\tstruct mlx5dv_flow_action_attr *action;\n+\n+\taction = malloc(sizeof(*action));\n+\tif (!action)\n+\t\treturn NULL;\n+\taction->type = MLX5DV_FLOW_ACTION_DEST_IBV_QP;\n+\taction->obj = qp;\n+\treturn action;\n+#endif\n+#else\n+\t(void)qp;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dv_create_flow_action_dest_devx_tir(void *tir)\n+{\n+#ifdef HAVE_MLX5DV_DR_ACTION_DEST_DEVX_TIR\n+\treturn mlx5dv_dr_action_create_dest_devx_tir(tir);\n+#else\n+\t(void)tir;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dv_create_flow_action_modify_header\n+\t\t\t\t\t(struct ibv_context *ctx,\n+\t\t\t\t\t enum mlx5dv_flow_table_type ft_type,\n+\t\t\t\t\t void *domain, uint64_t flags,\n+\t\t\t\t\t size_t actions_sz,\n+\t\t\t\t\t uint64_t actions[])\n+{\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\t(void)ctx;\n+\t(void)ft_type;\n+\treturn mlx5dv_dr_action_create_modify_header(domain, flags, actions_sz,\n+\t\t\t\t\t\t     (__be64 *)actions);\n+#else\n+\tstruct mlx5dv_flow_action_attr *action;\n+\n+\t(void)domain;\n+\t(void)flags;\n+\taction = malloc(sizeof(*action));\n+\tif (!action)\n+\t\treturn NULL;\n+\taction->type = MLX5DV_FLOW_ACTION_IBV_FLOW_ACTION;\n+\taction->action = mlx5dv_create_flow_action_modify_header\n+\t\t(ctx, actions_sz, actions, ft_type);\n+\treturn action;\n+#endif\n+#else\n+\t(void)ctx;\n+\t(void)ft_type;\n+\t(void)domain;\n+\t(void)flags;\n+\t(void)actions_sz;\n+\t(void)actions;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dv_create_flow_action_packet_reformat\n+\t\t(struct ibv_context *ctx,\n+\t\t enum mlx5dv_flow_action_packet_reformat_type reformat_type,\n+\t\t enum mlx5dv_flow_table_type ft_type,\n+\t\t struct mlx5dv_dr_domain *domain,\n+\t\t uint32_t flags, size_t data_sz, void *data)\n+{\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\t(void)ctx;\n+\t(void)ft_type;\n+\treturn mlx5dv_dr_action_create_packet_reformat(domain, flags,\n+\t\t\t\t\t\t       reformat_type, data_sz,\n+\t\t\t\t\t\t       data);\n+#else\n+\t(void)domain;\n+\t(void)flags;\n+\tstruct mlx5dv_flow_action_attr *action;\n+\n+\taction = malloc(sizeof(*action));\n+\tif (!action)\n+\t\treturn NULL;\n+\taction->type = MLX5DV_FLOW_ACTION_IBV_FLOW_ACTION;\n+\taction->action = mlx5dv_create_flow_action_packet_reformat\n+\t\t(ctx, data_sz, data, reformat_type, ft_type);\n+\treturn action;\n+#endif\n+#else\n+\t(void)ctx;\n+\t(void)reformat_type;\n+\t(void)ft_type;\n+\t(void)domain;\n+\t(void)flags;\n+\t(void)data_sz;\n+\t(void)data;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dv_create_flow_action_tag(uint32_t tag)\n+{\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_action_create_tag(tag);\n+#else /* HAVE_MLX5DV_DR */\n+\tstruct mlx5dv_flow_action_attr *action;\n+\n+\taction = malloc(sizeof(*action));\n+\tif (!action)\n+\t\treturn NULL;\n+\taction->type = MLX5DV_FLOW_ACTION_TAG;\n+\taction->tag_value = tag;\n+\treturn action;\n+#endif /* HAVE_MLX5DV_DR */\n+#else /* HAVE_IBV_FLOW_DV_SUPPORT */\n+\t(void)tag;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif /* HAVE_IBV_FLOW_DV_SUPPORT */\n+}\n+\n+static void *\n+mlx5_glue_dv_create_flow_action_meter(struct mlx5dv_dr_flow_meter_attr *attr)\n+{\n+#if defined(HAVE_MLX5DV_DR) && defined(HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER)\n+\treturn mlx5dv_dr_action_create_flow_meter(attr);\n+#else\n+\t(void)attr;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_dv_modify_flow_action_meter(void *action,\n+\t\t\t\t      struct mlx5dv_dr_flow_meter_attr *attr,\n+\t\t\t\t      uint64_t modify_bits)\n+{\n+#if defined(HAVE_MLX5DV_DR) && defined(HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER)\n+\treturn mlx5dv_dr_action_modify_flow_meter(action, attr, modify_bits);\n+#else\n+\t(void)action;\n+\t(void)attr;\n+\t(void)modify_bits;\n+\terrno = ENOTSUP;\n+\treturn errno;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dv_create_flow_action_aso(struct mlx5dv_dr_domain *domain,\n+\t\t\t\t    void *aso_obj,\n+\t\t\t\t    uint32_t offset,\n+\t\t\t\t    uint32_t flags,\n+\t\t\t\t    uint8_t return_reg_c)\n+{\n+#if defined(HAVE_MLX5DV_DR) && defined(HAVE_MLX5_DR_CREATE_ACTION_ASO)\n+\treturn mlx5dv_dr_action_create_aso(domain, aso_obj, offset,\n+\t\t\t\t\t   flags, return_reg_c);\n+#else\n+\t(void)domain;\n+\t(void)aso_obj;\n+\t(void)offset;\n+\t(void)flags;\n+\t(void)return_reg_c;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dr_create_flow_action_default_miss(void)\n+{\n+#if defined(HAVE_MLX5DV_DR) && defined(HAVE_MLX5_DR_CREATE_ACTION_DEFAULT_MISS)\n+\treturn mlx5dv_dr_action_create_default_miss();\n+#else\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_dv_destroy_flow(void *flow_id)\n+{\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_rule_destroy(flow_id);\n+#else\n+\treturn ibv_destroy_flow(flow_id);\n+#endif\n+}\n+\n+static int\n+mlx5_glue_dv_destroy_flow_matcher(void *matcher)\n+{\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_matcher_destroy(matcher);\n+#else\n+\treturn mlx5dv_destroy_flow_matcher(matcher);\n+#endif\n+#else\n+\t(void)matcher;\n+\terrno = ENOTSUP;\n+\treturn errno;\n+#endif\n+}\n+\n+static struct ibv_context *\n+mlx5_glue_dv_open_device(struct ibv_device *device)\n+{\n+#ifdef HAVE_IBV_DEVX_OBJ\n+\treturn mlx5dv_open_device(device,\n+\t\t\t\t  &(struct mlx5dv_context_attr){\n+\t\t\t\t\t.flags = MLX5DV_CONTEXT_FLAGS_DEVX,\n+\t\t\t\t  });\n+#else\n+\t(void)device;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static struct mlx5dv_devx_obj *\n+mlx5_glue_devx_obj_create(struct ibv_context *ctx,\n+\t\t\t  const void *in, size_t inlen,\n+\t\t\t  void *out, size_t outlen)\n+{\n+#ifdef HAVE_IBV_DEVX_OBJ\n+\treturn mlx5dv_devx_obj_create(ctx, in, inlen, out, outlen);\n+#else\n+\t(void)ctx;\n+\t(void)in;\n+\t(void)inlen;\n+\t(void)out;\n+\t(void)outlen;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_devx_obj_destroy(struct mlx5dv_devx_obj *obj)\n+{\n+#ifdef HAVE_IBV_DEVX_OBJ\n+\treturn mlx5dv_devx_obj_destroy(obj);\n+#else\n+\t(void)obj;\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_devx_obj_query(struct mlx5dv_devx_obj *obj,\n+\t\t\t const void *in, size_t inlen,\n+\t\t\t void *out, size_t outlen)\n+{\n+#ifdef HAVE_IBV_DEVX_OBJ\n+\treturn mlx5dv_devx_obj_query(obj, in, inlen, out, outlen);\n+#else\n+\t(void)obj;\n+\t(void)in;\n+\t(void)inlen;\n+\t(void)out;\n+\t(void)outlen;\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_devx_obj_modify(struct mlx5dv_devx_obj *obj,\n+\t\t\t  const void *in, size_t inlen,\n+\t\t\t  void *out, size_t outlen)\n+{\n+#ifdef HAVE_IBV_DEVX_OBJ\n+\treturn mlx5dv_devx_obj_modify(obj, in, inlen, out, outlen);\n+#else\n+\t(void)obj;\n+\t(void)in;\n+\t(void)inlen;\n+\t(void)out;\n+\t(void)outlen;\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_devx_general_cmd(struct ibv_context *ctx,\n+\t\t\t   const void *in, size_t inlen,\n+\t\t\t   void *out, size_t outlen)\n+{\n+#ifdef HAVE_IBV_DEVX_OBJ\n+\treturn mlx5dv_devx_general_cmd(ctx, in, inlen, out, outlen);\n+#else\n+\t(void)ctx;\n+\t(void)in;\n+\t(void)inlen;\n+\t(void)out;\n+\t(void)outlen;\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n+static struct mlx5dv_devx_cmd_comp *\n+mlx5_glue_devx_create_cmd_comp(struct ibv_context *ctx)\n+{\n+#ifdef HAVE_IBV_DEVX_ASYNC\n+\treturn mlx5dv_devx_create_cmd_comp(ctx);\n+#else\n+\t(void)ctx;\n+\terrno = -ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void\n+mlx5_glue_devx_destroy_cmd_comp(struct mlx5dv_devx_cmd_comp *cmd_comp)\n+{\n+#ifdef HAVE_IBV_DEVX_ASYNC\n+\tmlx5dv_devx_destroy_cmd_comp(cmd_comp);\n+#else\n+\t(void)cmd_comp;\n+\terrno = -ENOTSUP;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_devx_obj_query_async(struct mlx5dv_devx_obj *obj, const void *in,\n+\t\t\t       size_t inlen, size_t outlen, uint64_t wr_id,\n+\t\t\t       struct mlx5dv_devx_cmd_comp *cmd_comp)\n+{\n+#ifdef HAVE_IBV_DEVX_ASYNC\n+\treturn mlx5dv_devx_obj_query_async(obj, in, inlen, outlen, wr_id,\n+\t\t\t\t\t   cmd_comp);\n+#else\n+\t(void)obj;\n+\t(void)in;\n+\t(void)inlen;\n+\t(void)outlen;\n+\t(void)wr_id;\n+\t(void)cmd_comp;\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_devx_get_async_cmd_comp(struct mlx5dv_devx_cmd_comp *cmd_comp,\n+\t\t\t\t  struct mlx5dv_devx_async_cmd_hdr *cmd_resp,\n+\t\t\t\t  size_t cmd_resp_len)\n+{\n+#ifdef HAVE_IBV_DEVX_ASYNC\n+\treturn mlx5dv_devx_get_async_cmd_comp(cmd_comp, cmd_resp,\n+\t\t\t\t\t      cmd_resp_len);\n+#else\n+\t(void)cmd_comp;\n+\t(void)cmd_resp;\n+\t(void)cmd_resp_len;\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n+static struct mlx5dv_devx_umem *\n+mlx5_glue_devx_umem_reg(struct ibv_context *context, void *addr, size_t size,\n+\t\t\tuint32_t access)\n+{\n+#ifdef HAVE_IBV_DEVX_OBJ\n+\treturn mlx5dv_devx_umem_reg(context, addr, size, access);\n+#else\n+\t(void)context;\n+\t(void)addr;\n+\t(void)size;\n+\t(void)access;\n+\terrno = -ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_devx_umem_dereg(struct mlx5dv_devx_umem *dv_devx_umem)\n+{\n+#ifdef HAVE_IBV_DEVX_OBJ\n+\treturn mlx5dv_devx_umem_dereg(dv_devx_umem);\n+#else\n+\t(void)dv_devx_umem;\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_devx_qp_query(struct ibv_qp *qp,\n+\t\t\tconst void *in, size_t inlen,\n+\t\t\tvoid *out, size_t outlen)\n+{\n+#ifdef HAVE_IBV_DEVX_QP\n+\treturn mlx5dv_devx_qp_query(qp, in, inlen, out, outlen);\n+#else\n+\t(void)qp;\n+\t(void)in;\n+\t(void)inlen;\n+\t(void)out;\n+\t(void)outlen;\n+\terrno = ENOTSUP;\n+\treturn errno;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_devx_wq_query(struct ibv_wq *wq, const void *in, size_t inlen,\n+\t\t\tvoid *out, size_t outlen)\n+{\n+#ifdef HAVE_IBV_DEVX_QP\n+\treturn mlx5dv_devx_wq_query(wq, in, inlen, out, outlen);\n+#else\n+\t(void)wq;\n+\t(void)in;\n+\t(void)inlen;\n+\t(void)out;\n+\t(void)outlen;\n+\terrno = ENOTSUP;\n+\treturn errno;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_devx_port_query(struct ibv_context *ctx,\n+\t\t\t  uint32_t port_num,\n+\t\t\t  struct mlx5_port_info *info)\n+{\n+\tint err = 0;\n+\n+\tinfo->query_flags = 0;\n+#ifdef HAVE_MLX5DV_DR_DEVX_PORT_V35\n+\t/* The DevX port query API is implemented (rdma-core v35 and above). */\n+\tstruct mlx5_ib_uapi_query_port devx_port;\n+\n+\tmemset(&devx_port, 0, sizeof(devx_port));\n+\terr = mlx5dv_query_port(ctx, port_num, &devx_port);\n+\tif (err)\n+\t\treturn err;\n+\tif (devx_port.flags & MLX5DV_QUERY_PORT_VPORT_REG_C0) {\n+\t\tinfo->vport_meta_tag = devx_port.reg_c0.value;\n+\t\tinfo->vport_meta_mask = devx_port.reg_c0.mask;\n+\t\tinfo->query_flags |= MLX5_PORT_QUERY_REG_C0;\n+\t}\n+\tif (devx_port.flags & MLX5DV_QUERY_PORT_VPORT) {\n+\t\tinfo->vport_id = devx_port.vport;\n+\t\tinfo->query_flags |= MLX5_PORT_QUERY_VPORT;\n+\t}\n+#else\n+#ifdef HAVE_MLX5DV_DR_DEVX_PORT\n+\t/* The legacy DevX port query API is implemented (prior v35). */\n+\tstruct mlx5dv_devx_port devx_port = {\n+\t\t.comp_mask = MLX5DV_DEVX_PORT_VPORT |\n+\t\t\t     MLX5DV_DEVX_PORT_MATCH_REG_C_0\n+\t};\n+\n+\terr = mlx5dv_query_devx_port(ctx, port_num, &devx_port);\n+\tif (err)\n+\t\treturn err;\n+\tif (devx_port.comp_mask & MLX5DV_DEVX_PORT_MATCH_REG_C_0) {\n+\t\tinfo->vport_meta_tag = devx_port.reg_c_0.value;\n+\t\tinfo->vport_meta_mask = devx_port.reg_c_0.mask;\n+\t\tinfo->query_flags |= MLX5_PORT_QUERY_REG_C0;\n+\t}\n+\tif (devx_port.comp_mask & MLX5DV_DEVX_PORT_VPORT) {\n+\t\tinfo->vport_id = devx_port.vport_num;\n+\t\tinfo->query_flags |= MLX5_PORT_QUERY_VPORT;\n+\t}\n+#else\n+\tRTE_SET_USED(ctx);\n+\tRTE_SET_USED(port_num);\n+#endif /* HAVE_MLX5DV_DR_DEVX_PORT */\n+#endif /* HAVE_MLX5DV_DR_DEVX_PORT_V35 */\n+\treturn err;\n+}\n+\n+static int\n+mlx5_glue_dr_dump_single_rule(FILE *file, void *rule)\n+{\n+#ifdef HAVE_MLX5_DR_FLOW_DUMP_RULE\n+\treturn mlx5dv_dump_dr_rule(file, rule);\n+#else\n+\tRTE_SET_USED(file);\n+\tRTE_SET_USED(rule);\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_dr_dump_domain(FILE *file, void *domain)\n+{\n+#ifdef HAVE_MLX5_DR_FLOW_DUMP\n+\treturn mlx5dv_dump_dr_domain(file, domain);\n+#else\n+\tRTE_SET_USED(file);\n+\tRTE_SET_USED(domain);\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dr_create_flow_action_sampler\n+\t\t\t(struct mlx5dv_dr_flow_sampler_attr *attr)\n+{\n+#ifdef HAVE_MLX5_DR_CREATE_ACTION_FLOW_SAMPLE\n+\treturn mlx5dv_dr_action_create_flow_sampler(attr);\n+#else\n+\t(void)attr;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dr_action_create_dest_array\n+\t\t\t(void *domain,\n+\t\t\t size_t num_dest,\n+\t\t\t struct mlx5dv_dr_action_dest_attr *dests[])\n+{\n+#ifdef HAVE_MLX5_DR_CREATE_ACTION_DEST_ARRAY\n+\treturn mlx5dv_dr_action_create_dest_array\n+\t\t\t\t(domain,\n+\t\t\t\tnum_dest,\n+\t\t\t\tdests);\n+#else\n+\t(void)domain;\n+\t(void)num_dest;\n+\t(void)dests;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_devx_query_eqn(struct ibv_context *ctx, uint32_t cpus,\n+\t\t\t uint32_t *eqn)\n+{\n+#ifdef HAVE_IBV_DEVX_OBJ\n+\treturn mlx5dv_devx_query_eqn(ctx, cpus, eqn);\n+#else\n+\t(void)ctx;\n+\t(void)cpus;\n+\t(void)eqn;\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n+static struct mlx5dv_devx_event_channel *\n+mlx5_glue_devx_create_event_channel(struct ibv_context *ctx, int flags)\n+{\n+#ifdef HAVE_IBV_DEVX_EVENT\n+\treturn mlx5dv_devx_create_event_channel(ctx, flags);\n+#else\n+\t(void)ctx;\n+\t(void)flags;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void\n+mlx5_glue_devx_destroy_event_channel(struct mlx5dv_devx_event_channel *eventc)\n+{\n+#ifdef HAVE_IBV_DEVX_EVENT\n+\tmlx5dv_devx_destroy_event_channel(eventc);\n+#else\n+\t(void)eventc;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_devx_subscribe_devx_event(struct mlx5dv_devx_event_channel *eventc,\n+\t\t\t\t    struct mlx5dv_devx_obj *obj,\n+\t\t\t\t    uint16_t events_sz, uint16_t events_num[],\n+\t\t\t\t    uint64_t cookie)\n+{\n+#ifdef HAVE_IBV_DEVX_EVENT\n+\treturn mlx5dv_devx_subscribe_devx_event(eventc, obj, events_sz,\n+\t\t\t\t\t\tevents_num, cookie);\n+#else\n+\t(void)eventc;\n+\t(void)obj;\n+\t(void)events_sz;\n+\t(void)events_num;\n+\t(void)cookie;\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_devx_subscribe_devx_event_fd(struct mlx5dv_devx_event_channel *eventc,\n+\t\t\t\t       int fd, struct mlx5dv_devx_obj *obj,\n+\t\t\t\t       uint16_t event_num)\n+{\n+#ifdef HAVE_IBV_DEVX_EVENT\n+\treturn mlx5dv_devx_subscribe_devx_event_fd(eventc, fd, obj, event_num);\n+#else\n+\t(void)eventc;\n+\t(void)fd;\n+\t(void)obj;\n+\t(void)event_num;\n+\treturn -ENOTSUP;\n+#endif\n+}\n+\n+static ssize_t\n+mlx5_glue_devx_get_event(struct mlx5dv_devx_event_channel *eventc,\n+\t\t\t struct mlx5dv_devx_async_event_hdr *event_data,\n+\t\t\t size_t event_resp_len)\n+{\n+#ifdef HAVE_IBV_DEVX_EVENT\n+\treturn mlx5dv_devx_get_event(eventc, event_data, event_resp_len);\n+#else\n+\t(void)eventc;\n+\t(void)event_data;\n+\t(void)event_resp_len;\n+\terrno = ENOTSUP;\n+\treturn -1;\n+#endif\n+}\n+\n+static struct mlx5dv_devx_uar *\n+mlx5_glue_devx_alloc_uar(struct ibv_context *context, uint32_t flags)\n+{\n+#ifdef HAVE_IBV_DEVX_OBJ\n+\treturn mlx5dv_devx_alloc_uar(context, flags);\n+#else\n+\t(void)context;\n+\t(void)flags;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void\n+mlx5_glue_devx_free_uar(struct mlx5dv_devx_uar *devx_uar)\n+{\n+#ifdef HAVE_IBV_DEVX_OBJ\n+\tmlx5dv_devx_free_uar(devx_uar);\n+#else\n+\t(void)devx_uar;\n+#endif\n+}\n+\n+static struct mlx5dv_var *\n+mlx5_glue_dv_alloc_var(struct ibv_context *context, uint32_t flags)\n+{\n+#ifdef HAVE_IBV_VAR\n+\treturn mlx5dv_alloc_var(context, flags);\n+#else\n+\t(void)context;\n+\t(void)flags;\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void\n+mlx5_glue_dv_free_var(struct mlx5dv_var *var)\n+{\n+#ifdef HAVE_IBV_VAR\n+\tmlx5dv_free_var(var);\n+#else\n+\t(void)var;\n+\terrno = ENOTSUP;\n+#endif\n+}\n+\n+static void\n+mlx5_glue_dr_reclaim_domain_memory(void *domain, uint32_t enable)\n+{\n+#ifdef HAVE_MLX5DV_DR_MEM_RECLAIM\n+\tmlx5dv_dr_domain_set_reclaim_device_memory(domain, enable);\n+#else\n+\t(void)(enable);\n+\t(void)(domain);\n+#endif\n+}\n+\n+static struct mlx5dv_pp *\n+mlx5_glue_dv_alloc_pp(struct ibv_context *context,\n+\t\t      size_t pp_context_sz,\n+\t\t      const void *pp_context,\n+\t\t      uint32_t flags)\n+{\n+#ifdef HAVE_MLX5DV_PP_ALLOC\n+\treturn mlx5dv_pp_alloc(context, pp_context_sz, pp_context, flags);\n+#else\n+\tRTE_SET_USED(context);\n+\tRTE_SET_USED(pp_context_sz);\n+\tRTE_SET_USED(pp_context);\n+\tRTE_SET_USED(flags);\n+\terrno = ENOTSUP;\n+\treturn NULL;\n+#endif\n+}\n+\n+static void\n+mlx5_glue_dr_allow_duplicate_rules(void *domain, uint32_t allow)\n+{\n+#ifdef HAVE_MLX5_DR_ALLOW_DUPLICATE\n+\tmlx5dv_dr_domain_allow_duplicate_rules(domain, allow);\n+#else\n+\t(void)(allow);\n+\t(void)(domain);\n+#endif\n+}\n+\n+static void\n+mlx5_glue_dv_free_pp(struct mlx5dv_pp *pp)\n+{\n+#ifdef HAVE_MLX5DV_PP_ALLOC\n+\tmlx5dv_pp_free(pp);\n+#else\n+\tRTE_SET_USED(pp);\n+#endif\n+}\n+\n+__rte_cache_aligned\n+const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue) {\n+\t.version = MLX5_GLUE_VERSION,\n+\t.fork_init = mlx5_glue_fork_init,\n+\t.alloc_pd = mlx5_glue_alloc_pd,\n+\t.dealloc_pd = mlx5_glue_dealloc_pd,\n+\t.get_device_list = mlx5_glue_get_device_list,\n+\t.free_device_list = mlx5_glue_free_device_list,\n+\t.open_device = mlx5_glue_open_device,\n+\t.close_device = mlx5_glue_close_device,\n+\t.query_device = mlx5_glue_query_device,\n+\t.query_device_ex = mlx5_glue_query_device_ex,\n+\t.query_rt_values_ex = mlx5_glue_query_rt_values_ex,\n+\t.query_port = mlx5_glue_query_port,\n+\t.create_comp_channel = mlx5_glue_create_comp_channel,\n+\t.destroy_comp_channel = mlx5_glue_destroy_comp_channel,\n+\t.create_cq = mlx5_glue_create_cq,\n+\t.destroy_cq = mlx5_glue_destroy_cq,\n+\t.get_cq_event = mlx5_glue_get_cq_event,\n+\t.ack_cq_events = mlx5_glue_ack_cq_events,\n+\t.create_rwq_ind_table = mlx5_glue_create_rwq_ind_table,\n+\t.destroy_rwq_ind_table = mlx5_glue_destroy_rwq_ind_table,\n+\t.create_wq = mlx5_glue_create_wq,\n+\t.destroy_wq = mlx5_glue_destroy_wq,\n+\t.modify_wq = mlx5_glue_modify_wq,\n+\t.create_flow = mlx5_glue_create_flow,\n+\t.destroy_flow = mlx5_glue_destroy_flow,\n+\t.destroy_flow_action = mlx5_glue_destroy_flow_action,\n+\t.create_qp = mlx5_glue_create_qp,\n+\t.create_qp_ex = mlx5_glue_create_qp_ex,\n+\t.destroy_qp = mlx5_glue_destroy_qp,\n+\t.modify_qp = mlx5_glue_modify_qp,\n+\t.reg_mr = mlx5_glue_reg_mr,\n+\t.alloc_null_mr = mlx5_glue_alloc_null_mr,\n+\t.dereg_mr = mlx5_glue_dereg_mr,\n+\t.create_counter_set = mlx5_glue_create_counter_set,\n+\t.destroy_counter_set = mlx5_glue_destroy_counter_set,\n+\t.describe_counter_set = mlx5_glue_describe_counter_set,\n+\t.query_counter_set = mlx5_glue_query_counter_set,\n+\t.create_counters = mlx5_glue_create_counters,\n+\t.destroy_counters = mlx5_glue_destroy_counters,\n+\t.attach_counters = mlx5_glue_attach_counters,\n+\t.query_counters = mlx5_glue_query_counters,\n+\t.ack_async_event = mlx5_glue_ack_async_event,\n+\t.get_async_event = mlx5_glue_get_async_event,\n+\t.port_state_str = mlx5_glue_port_state_str,\n+\t.cq_ex_to_cq = mlx5_glue_cq_ex_to_cq,\n+\t.dr_create_flow_action_dest_flow_tbl =\n+\t\tmlx5_glue_dr_create_flow_action_dest_flow_tbl,\n+\t.dr_create_flow_action_dest_port =\n+\t\tmlx5_glue_dr_create_flow_action_dest_port,\n+\t.dr_create_flow_action_drop =\n+\t\tmlx5_glue_dr_create_flow_action_drop,\n+\t.dr_create_flow_action_push_vlan =\n+\t\tmlx5_glue_dr_create_flow_action_push_vlan,\n+\t.dr_create_flow_action_pop_vlan =\n+\t\tmlx5_glue_dr_create_flow_action_pop_vlan,\n+\t.dr_create_flow_tbl = mlx5_glue_dr_create_flow_tbl,\n+\t.dr_destroy_flow_tbl = mlx5_glue_dr_destroy_flow_tbl,\n+\t.dr_create_domain = mlx5_glue_dr_create_domain,\n+\t.dr_destroy_domain = mlx5_glue_dr_destroy_domain,\n+\t.dr_sync_domain = mlx5_glue_dr_sync_domain,\n+\t.dv_create_cq = mlx5_glue_dv_create_cq,\n+\t.dv_create_wq = mlx5_glue_dv_create_wq,\n+\t.dv_query_device = mlx5_glue_dv_query_device,\n+\t.dv_set_context_attr = mlx5_glue_dv_set_context_attr,\n+\t.dv_init_obj = mlx5_glue_dv_init_obj,\n+\t.dv_create_qp = mlx5_glue_dv_create_qp,\n+\t.dv_create_flow_matcher = mlx5_glue_dv_create_flow_matcher,\n+\t.dv_create_flow = mlx5_glue_dv_create_flow,\n+\t.dv_create_flow_action_counter =\n+\t\tmlx5_glue_dv_create_flow_action_counter,\n+\t.dv_create_flow_action_dest_ibv_qp =\n+\t\tmlx5_glue_dv_create_flow_action_dest_ibv_qp,\n+\t.dv_create_flow_action_dest_devx_tir =\n+\t\tmlx5_glue_dv_create_flow_action_dest_devx_tir,\n+\t.dv_create_flow_action_modify_header =\n+\t\tmlx5_glue_dv_create_flow_action_modify_header,\n+\t.dv_create_flow_action_packet_reformat =\n+\t\tmlx5_glue_dv_create_flow_action_packet_reformat,\n+\t.dv_create_flow_action_tag =  mlx5_glue_dv_create_flow_action_tag,\n+\t.dv_create_flow_action_meter = mlx5_glue_dv_create_flow_action_meter,\n+\t.dv_modify_flow_action_meter = mlx5_glue_dv_modify_flow_action_meter,\n+\t.dv_create_flow_action_aso = mlx5_glue_dv_create_flow_action_aso,\n+\t.dr_create_flow_action_default_miss =\n+\t\tmlx5_glue_dr_create_flow_action_default_miss,\n+\t.dv_destroy_flow = mlx5_glue_dv_destroy_flow,\n+\t.dv_destroy_flow_matcher = mlx5_glue_dv_destroy_flow_matcher,\n+\t.dv_open_device = mlx5_glue_dv_open_device,\n+\t.devx_obj_create = mlx5_glue_devx_obj_create,\n+\t.devx_obj_destroy = mlx5_glue_devx_obj_destroy,\n+\t.devx_obj_query = mlx5_glue_devx_obj_query,\n+\t.devx_obj_modify = mlx5_glue_devx_obj_modify,\n+\t.devx_general_cmd = mlx5_glue_devx_general_cmd,\n+\t.devx_create_cmd_comp = mlx5_glue_devx_create_cmd_comp,\n+\t.devx_destroy_cmd_comp = mlx5_glue_devx_destroy_cmd_comp,\n+\t.devx_obj_query_async = mlx5_glue_devx_obj_query_async,\n+\t.devx_get_async_cmd_comp = mlx5_glue_devx_get_async_cmd_comp,\n+\t.devx_umem_reg = mlx5_glue_devx_umem_reg,\n+\t.devx_umem_dereg = mlx5_glue_devx_umem_dereg,\n+\t.devx_qp_query = mlx5_glue_devx_qp_query,\n+\t.devx_wq_query = mlx5_glue_devx_wq_query,\n+\t.devx_port_query = mlx5_glue_devx_port_query,\n+\t.dr_dump_domain = mlx5_glue_dr_dump_domain,\n+\t.dr_dump_rule = mlx5_glue_dr_dump_single_rule,\n+\t.dr_reclaim_domain_memory = mlx5_glue_dr_reclaim_domain_memory,\n+\t.dr_create_flow_action_sampler =\n+\t\tmlx5_glue_dr_create_flow_action_sampler,\n+\t.dr_create_flow_action_dest_array =\n+\t\tmlx5_glue_dr_action_create_dest_array,\n+\t.dr_allow_duplicate_rules = mlx5_glue_dr_allow_duplicate_rules,\n+\t.devx_query_eqn = mlx5_glue_devx_query_eqn,\n+\t.devx_create_event_channel = mlx5_glue_devx_create_event_channel,\n+\t.devx_destroy_event_channel = mlx5_glue_devx_destroy_event_channel,\n+\t.devx_subscribe_devx_event = mlx5_glue_devx_subscribe_devx_event,\n+\t.devx_subscribe_devx_event_fd = mlx5_glue_devx_subscribe_devx_event_fd,\n+\t.devx_get_event = mlx5_glue_devx_get_event,\n+\t.devx_alloc_uar = mlx5_glue_devx_alloc_uar,\n+\t.devx_free_uar = mlx5_glue_devx_free_uar,\n+\t.dv_alloc_var = mlx5_glue_dv_alloc_var,\n+\t.dv_free_var = mlx5_glue_dv_free_var,\n+\t.dv_alloc_pp = mlx5_glue_dv_alloc_pp,\n+\t.dv_free_pp = mlx5_glue_dv_free_pp,\n+};\ndiff --git a/drivers/common/mlx5/freebsd/mlx5_glue.h b/drivers/common/mlx5/freebsd/mlx5_glue.h\nnew file mode 100644\nindex 0000000000..f39ef2dac7\n--- /dev/null\n+++ b/drivers/common/mlx5/freebsd/mlx5_glue.h\n@@ -0,0 +1,373 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2018 6WIND S.A.\n+ * Copyright 2018 Mellanox Technologies, Ltd\n+ */\n+\n+#ifndef MLX5_GLUE_H_\n+#define MLX5_GLUE_H_\n+\n+#include <stddef.h>\n+#include <stdint.h>\n+/* Verbs headers do not support -pedantic. */\n+#ifdef PEDANTIC\n+#pragma GCC diagnostic ignored \"-Wpedantic\"\n+#endif\n+#include <infiniband/mlx5dv.h>\n+#include <infiniband/verbs.h>\n+#ifdef PEDANTIC\n+#pragma GCC diagnostic error \"-Wpedantic\"\n+#endif\n+\n+#include <rte_byteorder.h>\n+\n+#include \"mlx5_autoconf.h\"\n+\n+#ifndef MLX5_GLUE_VERSION\n+#define MLX5_GLUE_VERSION \"\"\n+#endif\n+\n+#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42\n+struct ibv_counter_set;\n+struct ibv_counter_set_data;\n+struct ibv_counter_set_description;\n+struct ibv_counter_set_init_attr;\n+struct ibv_query_counter_set_attr;\n+#endif\n+\n+#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V45\n+struct ibv_counters;\n+struct ibv_counters_init_attr;\n+struct ibv_counter_attach_attr;\n+#endif\n+\n+#ifndef HAVE_IBV_DEVICE_TUNNEL_SUPPORT\n+struct mlx5dv_qp_init_attr;\n+#endif\n+\n+#ifndef HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT\n+struct mlx5dv_wq_init_attr;\n+#endif\n+\n+#ifndef HAVE_IBV_FLOW_DV_SUPPORT\n+struct mlx5dv_flow_matcher;\n+struct mlx5dv_flow_matcher_attr;\n+struct mlx5dv_flow_action_attr;\n+struct mlx5dv_flow_match_parameters;\n+struct mlx5dv_dr_flow_meter_attr;\n+struct ibv_flow_action;\n+enum mlx5dv_flow_action_packet_reformat_type { packet_reformat_type = 0, };\n+enum mlx5dv_flow_table_type { flow_table_type = 0, };\n+#endif\n+\n+#ifndef HAVE_IBV_FLOW_DEVX_COUNTERS\n+#define MLX5DV_FLOW_ACTION_COUNTERS_DEVX 0\n+#endif\n+\n+#ifndef HAVE_IBV_DEVX_OBJ\n+struct mlx5dv_devx_obj;\n+struct mlx5dv_devx_umem { uint32_t umem_id; };\n+struct mlx5dv_devx_uar { void *reg_addr; void *base_addr; uint32_t page_id; };\n+#endif\n+\n+#ifndef HAVE_IBV_DEVX_ASYNC\n+struct mlx5dv_devx_cmd_comp;\n+struct mlx5dv_devx_async_cmd_hdr;\n+#endif\n+\n+#ifndef HAVE_MLX5DV_DR\n+enum  mlx5dv_dr_domain_type { unused, };\n+struct mlx5dv_dr_domain;\n+struct mlx5dv_dr_action;\n+#define MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL 1\n+#endif\n+\n+#ifndef HAVE_MLX5DV_DR_DEVX_PORT\n+struct mlx5dv_devx_port;\n+#endif\n+\n+#ifndef HAVE_MLX5DV_DR_DEVX_PORT_V35\n+struct mlx5dv_port;\n+#endif\n+\n+#define MLX5_PORT_QUERY_VPORT (1u << 0)\n+#define MLX5_PORT_QUERY_REG_C0 (1u << 1)\n+\n+struct mlx5_port_info {\n+\tuint16_t query_flags;\n+\tuint16_t vport_id; /* Associated VF vport index (if any). */\n+\tuint32_t vport_meta_tag; /* Used for vport index match ove VF LAG. */\n+\tuint32_t vport_meta_mask; /* Used for vport index field match mask. */\n+};\n+\n+#ifndef HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER\n+struct mlx5dv_dr_flow_meter_attr;\n+#endif\n+\n+#ifndef HAVE_MLX5_DR_CREATE_ACTION_FLOW_SAMPLE\n+struct mlx5dv_dr_flow_sampler_attr {\n+\tuint32_t sample_ratio;\n+\tvoid *default_next_table;\n+\tsize_t num_sample_actions;\n+\tstruct mlx5dv_dr_action **sample_actions;\n+\tuint64_t action;\n+};\n+#endif\n+\n+#ifndef HAVE_MLX5_DR_CREATE_ACTION_DEST_ARRAY\n+enum mlx5dv_dr_action_dest_type {\n+\tMLX5DV_DR_ACTION_DEST,\n+\tMLX5DV_DR_ACTION_DEST_REFORMAT,\n+};\n+struct mlx5dv_dr_action_dest_reformat {\n+\tstruct mlx5dv_dr_action *reformat;\n+\tstruct mlx5dv_dr_action *dest;\n+};\n+struct mlx5dv_dr_action_dest_attr {\n+\tenum mlx5dv_dr_action_dest_type type;\n+\tunion {\n+\t\tstruct mlx5dv_dr_action *dest;\n+\t\tstruct mlx5dv_dr_action_dest_reformat *dest_reformat;\n+\t};\n+};\n+#endif\n+\n+#ifndef HAVE_IBV_DEVX_EVENT\n+struct mlx5dv_devx_event_channel { int fd; };\n+struct mlx5dv_devx_async_event_hdr;\n+#define MLX5DV_DEVX_CREATE_EVENT_CHANNEL_FLAGS_OMIT_EV_DATA 1\n+#endif\n+\n+#ifndef HAVE_IBV_VAR\n+struct mlx5dv_var { uint32_t page_id; uint32_t length; off_t mmap_off;\n+\t\t\tuint64_t comp_mask; };\n+#endif\n+\n+#ifndef HAVE_IBV_RELAXED_ORDERING\n+#define IBV_ACCESS_RELAXED_ORDERING 0\n+#endif\n+\n+struct mlx5_glue {\n+\tconst char *version;\n+\tint (*fork_init)(void);\n+\tstruct ibv_pd *(*alloc_pd)(struct ibv_context *context);\n+\tint (*dealloc_pd)(struct ibv_pd *pd);\n+\tstruct ibv_device **(*get_device_list)(int *num_devices);\n+\tvoid (*free_device_list)(struct ibv_device **list);\n+\tstruct ibv_context *(*open_device)(struct ibv_device *device);\n+\tint (*close_device)(struct ibv_context *context);\n+\tint (*query_device)(struct ibv_context *context,\n+\t\t\t    struct ibv_device_attr *device_attr);\n+\tint (*query_device_ex)(struct ibv_context *context,\n+\t\t\t       const struct ibv_query_device_ex_input *input,\n+\t\t\t       struct ibv_device_attr_ex *attr);\n+\tint (*query_rt_values_ex)(struct ibv_context *context,\n+\t\t\t       struct ibv_values_ex *values);\n+\tint (*query_port)(struct ibv_context *context, uint8_t port_num,\n+\t\t\t  struct ibv_port_attr *port_attr);\n+\tstruct ibv_comp_channel *(*create_comp_channel)\n+\t\t(struct ibv_context *context);\n+\tint (*destroy_comp_channel)(struct ibv_comp_channel *channel);\n+\tstruct ibv_cq *(*create_cq)(struct ibv_context *context, int cqe,\n+\t\t\t\t    void *cq_context,\n+\t\t\t\t    struct ibv_comp_channel *channel,\n+\t\t\t\t    int comp_vector);\n+\tint (*destroy_cq)(struct ibv_cq *cq);\n+\tint (*get_cq_event)(struct ibv_comp_channel *channel,\n+\t\t\t    struct ibv_cq **cq, void **cq_context);\n+\tvoid (*ack_cq_events)(struct ibv_cq *cq, unsigned int nevents);\n+\tstruct ibv_rwq_ind_table *(*create_rwq_ind_table)\n+\t\t(struct ibv_context *context,\n+\t\t struct ibv_rwq_ind_table_init_attr *init_attr);\n+\tint (*destroy_rwq_ind_table)(struct ibv_rwq_ind_table *rwq_ind_table);\n+\tstruct ibv_wq *(*create_wq)(struct ibv_context *context,\n+\t\t\t\t    struct ibv_wq_init_attr *wq_init_attr);\n+\tint (*destroy_wq)(struct ibv_wq *wq);\n+\tint (*modify_wq)(struct ibv_wq *wq, struct ibv_wq_attr *wq_attr);\n+\tstruct ibv_flow *(*create_flow)(struct ibv_qp *qp,\n+\t\t\t\t\tstruct ibv_flow_attr *flow);\n+\tint (*destroy_flow)(struct ibv_flow *flow_id);\n+\tint (*destroy_flow_action)(void *action);\n+\tstruct ibv_qp *(*create_qp)(struct ibv_pd *pd,\n+\t\t\t\t    struct ibv_qp_init_attr *qp_init_attr);\n+\tstruct ibv_qp *(*create_qp_ex)\n+\t\t(struct ibv_context *context,\n+\t\t struct ibv_qp_init_attr_ex *qp_init_attr_ex);\n+\tint (*destroy_qp)(struct ibv_qp *qp);\n+\tint (*modify_qp)(struct ibv_qp *qp, struct ibv_qp_attr *attr,\n+\t\t\t int attr_mask);\n+\tstruct ibv_mr *(*reg_mr)(struct ibv_pd *pd, void *addr,\n+\t\t\t\t size_t length, int access);\n+\tstruct ibv_mr *(*alloc_null_mr)(struct ibv_pd *pd);\n+\tint (*dereg_mr)(struct ibv_mr *mr);\n+\tstruct ibv_counter_set *(*create_counter_set)\n+\t\t(struct ibv_context *context,\n+\t\t struct ibv_counter_set_init_attr *init_attr);\n+\tint (*destroy_counter_set)(struct ibv_counter_set *cs);\n+\tint (*describe_counter_set)\n+\t\t(struct ibv_context *context,\n+\t\t uint16_t counter_set_id,\n+\t\t struct ibv_counter_set_description *cs_desc);\n+\tint (*query_counter_set)(struct ibv_query_counter_set_attr *query_attr,\n+\t\t\t\t struct ibv_counter_set_data *cs_data);\n+\tstruct ibv_counters *(*create_counters)\n+\t\t(struct ibv_context *context,\n+\t\t struct ibv_counters_init_attr *init_attr);\n+\tint (*destroy_counters)(struct ibv_counters *counters);\n+\tint (*attach_counters)(struct ibv_counters *counters,\n+\t\t\t       struct ibv_counter_attach_attr *attr,\n+\t\t\t       struct ibv_flow *flow);\n+\tint (*query_counters)(struct ibv_counters *counters,\n+\t\t\t      uint64_t *counters_value,\n+\t\t\t      uint32_t ncounters,\n+\t\t\t      uint32_t flags);\n+\tvoid (*ack_async_event)(struct ibv_async_event *event);\n+\tint (*get_async_event)(struct ibv_context *context,\n+\t\t\t       struct ibv_async_event *event);\n+\tconst char *(*port_state_str)(enum ibv_port_state port_state);\n+\tstruct ibv_cq *(*cq_ex_to_cq)(struct ibv_cq_ex *cq);\n+\tvoid *(*dr_create_flow_action_dest_flow_tbl)(void *tbl);\n+\tvoid *(*dr_create_flow_action_dest_port)(void *domain,\n+\t\t\t\t\t\t uint32_t port);\n+\tvoid *(*dr_create_flow_action_drop)(void);\n+\tvoid *(*dr_create_flow_action_push_vlan)\n+\t\t\t\t\t(struct mlx5dv_dr_domain *domain,\n+\t\t\t\t\t rte_be32_t vlan_tag);\n+\tvoid *(*dr_create_flow_action_pop_vlan)(void);\n+\tvoid *(*dr_create_flow_tbl)(void *domain, uint32_t level);\n+\tint (*dr_destroy_flow_tbl)(void *tbl);\n+\tvoid *(*dr_create_domain)(struct ibv_context *ctx,\n+\t\t\t\t  enum mlx5dv_dr_domain_type domain);\n+\tint (*dr_destroy_domain)(void *domain);\n+\tint (*dr_sync_domain)(void *domain, uint32_t flags);\n+\tstruct ibv_cq_ex *(*dv_create_cq)\n+\t\t(struct ibv_context *context,\n+\t\t struct ibv_cq_init_attr_ex *cq_attr,\n+\t\t struct mlx5dv_cq_init_attr *mlx5_cq_attr);\n+\tstruct ibv_wq *(*dv_create_wq)\n+\t\t(struct ibv_context *context,\n+\t\t struct ibv_wq_init_attr *wq_attr,\n+\t\t struct mlx5dv_wq_init_attr *mlx5_wq_attr);\n+\tint (*dv_query_device)(struct ibv_context *ctx_in,\n+\t\t\t       struct mlx5dv_context *attrs_out);\n+\tint (*dv_set_context_attr)(struct ibv_context *ibv_ctx,\n+\t\t\t\t   enum mlx5dv_set_ctx_attr_type type,\n+\t\t\t\t   void *attr);\n+\tint (*dv_init_obj)(struct mlx5dv_obj *obj, uint64_t obj_type);\n+\tstruct ibv_qp *(*dv_create_qp)\n+\t\t(struct ibv_context *context,\n+\t\t struct ibv_qp_init_attr_ex *qp_init_attr_ex,\n+\t\t struct mlx5dv_qp_init_attr *dv_qp_init_attr);\n+\tvoid *(*dv_create_flow_matcher)\n+\t\t(struct ibv_context *context,\n+\t\t struct mlx5dv_flow_matcher_attr *matcher_attr,\n+\t\t void *tbl);\n+\tvoid *(*dv_create_flow)(void *matcher, void *match_value,\n+\t\t\t  size_t num_actions, void *actions[]);\n+\tvoid *(*dv_create_flow_action_counter)(void *obj, uint32_t  offset);\n+\tvoid *(*dv_create_flow_action_dest_ibv_qp)(void *qp);\n+\tvoid *(*dv_create_flow_action_dest_devx_tir)(void *tir);\n+\tvoid *(*dv_create_flow_action_modify_header)\n+\t\t(struct ibv_context *ctx, enum mlx5dv_flow_table_type ft_type,\n+\t\t void *domain, uint64_t flags, size_t actions_sz,\n+\t\t uint64_t actions[]);\n+\tvoid *(*dv_create_flow_action_packet_reformat)\n+\t\t(struct ibv_context *ctx,\n+\t\t enum mlx5dv_flow_action_packet_reformat_type reformat_type,\n+\t\t enum mlx5dv_flow_table_type ft_type,\n+\t\t struct mlx5dv_dr_domain *domain,\n+\t\t uint32_t flags, size_t data_sz, void *data);\n+\tvoid *(*dv_create_flow_action_tag)(uint32_t tag);\n+\tvoid *(*dv_create_flow_action_meter)\n+\t\t(struct mlx5dv_dr_flow_meter_attr *attr);\n+\tint (*dv_modify_flow_action_meter)(void *action,\n+\t\tstruct mlx5dv_dr_flow_meter_attr *attr, uint64_t modify_bits);\n+\tvoid *(*dr_create_flow_action_default_miss)(void);\n+\tint (*dv_destroy_flow)(void *flow);\n+\tint (*dv_destroy_flow_matcher)(void *matcher);\n+\tstruct ibv_context *(*dv_open_device)(struct ibv_device *device);\n+\tstruct mlx5dv_var *(*dv_alloc_var)(struct ibv_context *context,\n+\t\t\t\t\t   uint32_t flags);\n+\tvoid (*dv_free_var)(struct mlx5dv_var *var);\n+\tstruct mlx5dv_devx_uar *(*devx_alloc_uar)(struct ibv_context *context,\n+\t\t\t\t\t\t  uint32_t flags);\n+\tvoid (*devx_free_uar)(struct mlx5dv_devx_uar *devx_uar);\n+\tstruct mlx5dv_devx_obj *(*devx_obj_create)\n+\t\t\t\t\t(struct ibv_context *ctx,\n+\t\t\t\t\t const void *in, size_t inlen,\n+\t\t\t\t\t void *out, size_t outlen);\n+\tint (*devx_obj_destroy)(struct mlx5dv_devx_obj *obj);\n+\tint (*devx_obj_query)(struct mlx5dv_devx_obj *obj,\n+\t\t\t      const void *in, size_t inlen,\n+\t\t\t      void *out, size_t outlen);\n+\tint (*devx_obj_modify)(struct mlx5dv_devx_obj *obj,\n+\t\t\t       const void *in, size_t inlen,\n+\t\t\t       void *out, size_t outlen);\n+\tint (*devx_general_cmd)(struct ibv_context *context,\n+\t\t\t\tconst void *in, size_t inlen,\n+\t\t\t\tvoid *out, size_t outlen);\n+\tstruct mlx5dv_devx_cmd_comp *(*devx_create_cmd_comp)\n+\t\t\t\t\t(struct ibv_context *context);\n+\tvoid (*devx_destroy_cmd_comp)(struct mlx5dv_devx_cmd_comp *cmd_comp);\n+\tint (*devx_obj_query_async)(struct mlx5dv_devx_obj *obj,\n+\t\t\t\t    const void *in, size_t inlen,\n+\t\t\t\t    size_t outlen, uint64_t wr_id,\n+\t\t\t\t    struct mlx5dv_devx_cmd_comp *cmd_comp);\n+\tint (*devx_get_async_cmd_comp)(struct mlx5dv_devx_cmd_comp *cmd_comp,\n+\t\t\t\t       struct mlx5dv_devx_async_cmd_hdr *resp,\n+\t\t\t\t       size_t cmd_resp_len);\n+\tstruct mlx5dv_devx_umem *(*devx_umem_reg)(struct ibv_context *context,\n+\t\t\t\t\t\t  void *addr, size_t size,\n+\t\t\t\t\t\t  uint32_t access);\n+\tint (*devx_umem_dereg)(struct mlx5dv_devx_umem *dv_devx_umem);\n+\tint (*devx_qp_query)(struct ibv_qp *qp,\n+\t\t\t     const void *in, size_t inlen,\n+\t\t\t     void *out, size_t outlen);\n+\tint (*devx_wq_query)(struct ibv_wq *wq, const void *in, size_t inlen,\n+\t\t\t     void *out, size_t outlen);\n+\tint (*devx_port_query)(struct ibv_context *ctx,\n+\t\t\t       uint32_t port_num,\n+\t\t\t       struct mlx5_port_info *info);\n+\tint (*dr_dump_domain)(FILE *file, void *domain);\n+\tint (*dr_dump_rule)(FILE *file, void *rule);\n+\tint (*devx_query_eqn)(struct ibv_context *context, uint32_t cpus,\n+\t\t\t      uint32_t *eqn);\n+\tstruct mlx5dv_devx_event_channel *(*devx_create_event_channel)\n+\t\t\t\t(struct ibv_context *context, int flags);\n+\tvoid (*devx_destroy_event_channel)\n+\t\t\t(struct mlx5dv_devx_event_channel *event_channel);\n+\tint (*devx_subscribe_devx_event)\n+\t\t\t(struct mlx5dv_devx_event_channel *event_channel,\n+\t\t\t struct mlx5dv_devx_obj *obj,\n+\t\t\t uint16_t events_sz,\n+\t\t\t uint16_t events_num[],\n+\t\t\t uint64_t cookie);\n+\tint (*devx_subscribe_devx_event_fd)\n+\t\t\t(struct mlx5dv_devx_event_channel *event_channel,\n+\t\t\t int fd,\n+\t\t\t struct mlx5dv_devx_obj *obj,\n+\t\t\t uint16_t event_num);\n+\tssize_t (*devx_get_event)\n+\t\t\t(struct mlx5dv_devx_event_channel *event_channel,\n+\t\t\t struct mlx5dv_devx_async_event_hdr *event_data,\n+\t\t\t size_t event_resp_len);\n+\tvoid (*dr_reclaim_domain_memory)(void *domain, uint32_t enable);\n+\tvoid (*dr_allow_duplicate_rules)(void *domain, uint32_t allow);\n+\tstruct mlx5dv_pp *(*dv_alloc_pp)(struct ibv_context *context,\n+\t\t\t\t\t size_t pp_context_sz,\n+\t\t\t\t\t const void *pp_context,\n+\t\t\t\t\t uint32_t flags);\n+\tvoid (*dv_free_pp)(struct mlx5dv_pp *pp);\n+\tvoid *(*dr_create_flow_action_sampler)\n+\t\t\t(struct mlx5dv_dr_flow_sampler_attr *attr);\n+\tvoid *(*dr_create_flow_action_dest_array)\n+\t\t\t(void *domain,\n+\t\t\t size_t num_dest,\n+\t\t\t struct mlx5dv_dr_action_dest_attr *dests[]);\n+\tvoid *(*dv_create_flow_action_aso)\n+\t\t\t(struct mlx5dv_dr_domain *domain, void *aso_obj,\n+\t\t\t uint32_t offset, uint32_t flags, uint8_t return_reg_c);\n+};\n+\n+extern const struct mlx5_glue *mlx5_glue;\n+\n+#endif /* MLX5_GLUE_H_ */\n",
    "prefixes": [
        "01/19"
    ]
}