get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96028,
    "url": "http://patchwork.dpdk.org/api/patches/96028/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210719025410.15483-5-xuemingl@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": "<20210719025410.15483-5-xuemingl@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210719025410.15483-5-xuemingl@nvidia.com",
    "date": "2021-07-19T02:53:59",
    "name": "[v3,04/15] common/mlx5: support auxiliary bus",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "19777a11a3f6a8376e3f8f2439c2f8bbe95c5e9f",
    "submitter": {
        "id": 1904,
        "url": "http://patchwork.dpdk.org/api/people/1904/?format=api",
        "name": "Xueming Li",
        "email": "xuemingl@nvidia.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210719025410.15483-5-xuemingl@nvidia.com/mbox/",
    "series": [
        {
            "id": 17884,
            "url": "http://patchwork.dpdk.org/api/series/17884/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=17884",
            "date": "2021-07-19T02:53:55",
            "name": "net/mlx5: support Sub-Function",
            "version": 3,
            "mbox": "http://patchwork.dpdk.org/series/17884/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/96028/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/96028/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 64217A0C45;\n\tMon, 19 Jul 2021 04:55:21 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 73AC041199;\n\tMon, 19 Jul 2021 04:55:06 +0200 (CEST)",
            "from NAM10-DM6-obe.outbound.protection.outlook.com\n (mail-dm6nam10on2076.outbound.protection.outlook.com [40.107.93.76])\n by mails.dpdk.org (Postfix) with ESMTP id BDE1A4119C\n for <dev@dpdk.org>; Mon, 19 Jul 2021 04:55:04 +0200 (CEST)",
            "from MW2PR16CA0069.namprd16.prod.outlook.com (2603:10b6:907:1::46)\n by BYAPR12MB3254.namprd12.prod.outlook.com (2603:10b6:a03:137::23) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.26; Mon, 19 Jul\n 2021 02:55:02 +0000",
            "from CO1NAM11FT048.eop-nam11.prod.protection.outlook.com\n (2603:10b6:907:1:cafe::c2) by MW2PR16CA0069.outlook.office365.com\n (2603:10b6:907:1::46) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend\n Transport; Mon, 19 Jul 2021 02:55:02 +0000",
            "from mail.nvidia.com (216.228.112.34) by\n CO1NAM11FT048.mail.protection.outlook.com (10.13.175.148) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.4331.21 via Frontend Transport; Mon, 19 Jul 2021 02:55:02 +0000",
            "from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com\n (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 19 Jul\n 2021 02:54:58 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=NYQL8d3nJlU0hjBCau+ZhLO+vg9s+FzWgPhNJLSSyDWbf1wYP6CSvMeJ6PHDcnFETAgKsByndUg/x6u1oW3As+P2z5YPWyuvGfRqr7U+ntMPgQF7AOntUT0i7SVctI9X7qi+89OpCSjB5EJa6fFtp4h6ep/jPjPG+b8qK8kmAwprnFC87jAe7TfhWxqt0Z+qEWZvy6T8ZKKgAu6HeC4P4XYw5dNV8kcI+vqjR5MK4QqWNGZu6rAhUU6POHx88YBjjhCto/LwdxNf4414PyPkJTMaPUH48LwG0XEutVZdQhLOs2sJEoJUCKBGlOwHXYEJSGnwqRKrFXlhjwZrurl/OA==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=6q7tff9/j+ZivvJzKw7BZKSxggEbum7bOF5gIDJfzYs=;\n b=MgEkygb9jGENHWBMvwFZ2igSU2bNXowaoXpupmdvodFFwKl0zM7KsZlT+PoKRGbrGhWx9M89L989XWk0inVI9h3ax+KC/EcWYVRtDMvmWkvhJ+p8anc8rmsx0RzfTdG5j9EzG+iIz0+RePQO/bK1Tjl2NNPY+jz76WiU8iGRquf+5VdF6xMWAyxrcfnPCuBfUlWuvztSteOk6EVUR7Pk2b3OmHCPE9yNksHTzxnw1+gfD6ZC3FTnA66yfi3tOpHSl8u17h9RVE0o/bpmW0VofWvIgi9lipIG90PZdObuTnBW4gAU3D6xbcgaU9USsM1vzqRxrQ4+vMplhuySCPiZuw==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.112.34) smtp.rcpttodomain=ashroe.eu smtp.mailfrom=nvidia.com;\n dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com;\n dkim=none (message not signed); arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=6q7tff9/j+ZivvJzKw7BZKSxggEbum7bOF5gIDJfzYs=;\n b=Qp6VVPnKr3/wfgGuxK7ZusmnpSJFcxHh6ySm76dc9vy/xWQtIV0kLB704srEJcZ9Vnb8HnjXcV0YyT8WKPwMJcTgbsw1pi7aLzdVvTuXqgPF0qJvzBUA9lTwWs8pBOlm9byXR+Tas1Mp4w484/cXxupbgzRk6ZgC4LwNOzV+mF6ytiymGTFsTWtFJpYOnruf97exntYtDaE/RTLHSo1rzOmeX5j/HjVk8jNR7In746N6A3IkRZVBTPsX/rAWdso3fXSTINIPNmNtJuGz9LZKBy7E23l3qy/GnunFKSD61++6aycx9tHMzuSC5o7LkWlwmRMtT9bgRlGOf4mPSCT5hw==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 216.228.112.34)\n smtp.mailfrom=nvidia.com; ashroe.eu; dkim=none (message not signed)\n header.d=none;ashroe.eu; dmarc=pass action=none header.from=nvidia.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 216.228.112.34 as permitted sender) receiver=protection.outlook.com;\n client-ip=216.228.112.34; helo=mail.nvidia.com;",
        "From": "Xueming Li <xuemingl@nvidia.com>",
        "To": "Viacheslav Ovsiienko <viacheslavo@nvidia.com>",
        "CC": "<dev@dpdk.org>, <xuemingl@nvidia.com>, Matan Azrad <matan@nvidia.com>,\n Shahaf Shuler <shahafs@nvidia.com>, Ray Kinsella <mdr@ashroe.eu>",
        "Date": "Mon, 19 Jul 2021 10:53:59 +0800",
        "Message-ID": "<20210719025410.15483-5-xuemingl@nvidia.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210713131437.30170-2-xuemingl@nvidia.com>",
        "References": "<20210713131437.30170-2-xuemingl@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[172.20.187.5]",
        "X-ClientProxiedBy": "HQMAIL105.nvidia.com (172.20.187.12) To\n HQMAIL107.nvidia.com (172.20.187.13)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "920456b3-3123-45d3-e9ee-08d94a609af0",
        "X-MS-TrafficTypeDiagnostic": "BYAPR12MB3254:",
        "X-Microsoft-Antispam-PRVS": "\n <BYAPR12MB3254C1DA91582A45F8C5E956A1E19@BYAPR12MB3254.namprd12.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:147;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n cA9Q7M74ZqgU8qyEGUhWFWaYN9aN5DE/vYHbwlkzUj2XWueUen1kuTuLcnymRLbXNeUkmmKnOWlmWTeDtzOce9IwwmD/a+NwAwyMUaCkajQ9C8RT68AoQChlwjGjkwK+ETz3wogjwsMHBWKx4TcTyrFOX9szukyrXSGVfvWLXDYn2vy0PMRVrq3KYa9EET5lBa10ERhXadEpeLCdx8aR6sONwIDTfkMrr2E+pBU2Bb6OPAsPC4fcnoHXbN2AynhPUc9ke5iIBSEiM+v2KaultFbBc+98YkD8/Y3X7xt0rKd341bqA/JhWMRvOEdApdnnuW/Zh0kgtSir0TeHxcxC/r1lLSRI/Q1sCtsCEo3ekvf0E2Sqk/lvcEAbdb1rzwfizRY4yck8ItaQvvJY8l9USsVLmrt5J2NdCjjyrfy0v06IhtsM7ulJdPs2O2HUitbrWnnrNa7tTKtqNK0vDtpy8hrwaA8yUh6tyG5+o9LengtyPs+voby791Xe717Fp6hENAZakokvcimb8dd6czSCkQ7eOPZLIYBTdPMHx78sKzAHbbYZvDjJCl6lrMZ5ajWZtbjZRSxJJ697+snA5+wIuGmUDcJyvZG+WJBt6IcnlGdvziJ68d61B+yalvZrQN0Qt1yzifPXKXHm3flweU91BYxbpZKc2CPG4LUZSDI6N43gfMm19lJh0jYqxGpQIYurp0fuyT28norVSvhskUi+IA==",
        "X-Forefront-Antispam-Report": "CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1;\n SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE;\n SFS:(4636009)(36840700001)(46966006)(47076005)(2616005)(426003)(336012)(186003)(6286002)(54906003)(7636003)(16526019)(55016002)(508600001)(356005)(8936002)(5660300002)(83380400001)(316002)(2906002)(36756003)(37006003)(1076003)(26005)(36906005)(70586007)(36860700001)(4326008)(6862004)(86362001)(7696005)(6636002)(8676002)(82310400003)(70206006);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "19 Jul 2021 02:55:02.5372 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 920456b3-3123-45d3-e9ee-08d94a609af0",
        "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n CO1NAM11FT048.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "BYAPR12MB3254",
        "Subject": "[dpdk-dev] [PATCH v3 04/15] common/mlx5: support auxiliary bus",
        "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": "This patch adds auxiliary bus driver and delegate to\nregistered internal mlx5 common device drivers, i.e. eth, vdpa...\n\nCurrent major target is to support SubFunction on auxiliary bus.\n\nAs a limitation of current driver, numa node of device is detected from\nPCI bus of device symbol link, will remove once numa node file available\non sysfs.\n\nSigned-off-by: Xueming Li <xuemingl@nvidia.com>\n---\n drivers/common/mlx5/linux/meson.build         |   3 +\n .../common/mlx5/linux/mlx5_common_auxiliary.c | 173 ++++++++++++++++++\n drivers/common/mlx5/linux/mlx5_common_verbs.c |   5 +-\n drivers/common/mlx5/meson.build               |   2 +-\n drivers/common/mlx5/mlx5_common.c             |   3 +\n drivers/common/mlx5/mlx5_common.h             |   6 +\n drivers/common/mlx5/mlx5_common_private.h     |   6 +\n drivers/common/mlx5/version.map               |   2 +\n 8 files changed, 198 insertions(+), 2 deletions(-)\n create mode 100644 drivers/common/mlx5/linux/mlx5_common_auxiliary.c",
    "diff": "diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build\nindex 686df26909..44446e2743 100644\n--- a/drivers/common/mlx5/linux/meson.build\n+++ b/drivers/common/mlx5/linux/meson.build\n@@ -48,10 +48,13 @@ endif\n sources += files('mlx5_nl.c')\n sources += files('mlx5_common_os.c')\n sources += files('mlx5_common_verbs.c')\n+sources += files('mlx5_common_auxiliary.c')\n if not dlopen_ibverbs\n     sources += files('mlx5_glue.c')\n endif\n \n+deps += ['bus_auxiliary']\n+\n # To maintain the compatibility with the make build system\n # mlx5_autoconf.h file is still generated.\n # input array for meson member search:\ndiff --git a/drivers/common/mlx5/linux/mlx5_common_auxiliary.c b/drivers/common/mlx5/linux/mlx5_common_auxiliary.c\nnew file mode 100644\nindex 0000000000..4ca27cd281\n--- /dev/null\n+++ b/drivers/common/mlx5/linux/mlx5_common_auxiliary.c\n@@ -0,0 +1,173 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020 Mellanox Technologies Ltd\n+ */\n+\n+#include <stdlib.h>\n+#include <dirent.h>\n+#include <rte_malloc.h>\n+#include <rte_errno.h>\n+#include <rte_bus_auxiliary.h>\n+#include <rte_common.h>\n+#include \"eal_filesystem.h\"\n+\n+#include \"mlx5_common_utils.h\"\n+#include \"mlx5_common_private.h\"\n+\n+#define AUXILIARY_SYSFS_PATH \"/sys/bus/auxiliary/devices\"\n+#define MLX5_AUXILIARY_PREFIX \"mlx5_core.sf.\"\n+\n+int\n+mlx5_auxiliary_get_child_name(const char *dev, const char *node,\n+\t\t\t      char *child, size_t size)\n+{\n+\tDIR *dir;\n+\tstruct dirent *dent;\n+\tMKSTR(path, \"%s/%s%s\", AUXILIARY_SYSFS_PATH, dev, node);\n+\n+\tdir = opendir(path);\n+\tif (dir == NULL) {\n+\t\trte_errno = errno;\n+\t\treturn -rte_errno;\n+\t}\n+\t/* Get the first file name. */\n+\twhile ((dent = readdir(dir)) != NULL) {\n+\t\tif (dent->d_name[0] != '.')\n+\t\t\tbreak;\n+\t}\n+\tclosedir(dir);\n+\tif (dent == NULL) {\n+\t\trte_errno = ENOENT;\n+\t\treturn -rte_errno;\n+\t}\n+\tif (rte_strscpy(child, dent->d_name, size) < 0)\n+\t\treturn -rte_errno;\n+\treturn 0;\n+}\n+\n+static int\n+mlx5_auxiliary_get_pci_path(const struct rte_auxiliary_device *dev,\n+\t\t\t    char *sysfs_pci, size_t size)\n+{\n+\tchar sysfs_real[PATH_MAX] = { 0 };\n+\tMKSTR(sysfs_aux, \"%s/%s\", AUXILIARY_SYSFS_PATH, dev->name);\n+\tchar *dir;\n+\n+\tif (realpath(sysfs_aux, sysfs_real) == NULL) {\n+\t\trte_errno = errno;\n+\t\treturn -rte_errno;\n+\t}\n+\tdir = dirname(sysfs_real);\n+\tif (dir == NULL) {\n+\t\trte_errno = errno;\n+\t\treturn -rte_errno;\n+\t}\n+\tif (rte_strscpy(sysfs_pci, dir, size) < 0)\n+\t\treturn -rte_errno;\n+\treturn 0;\n+}\n+\n+static int\n+mlx5_auxiliary_get_numa(const struct rte_auxiliary_device *dev)\n+{\n+\tunsigned long numa;\n+\tchar numa_path[PATH_MAX];\n+\n+\tif (mlx5_auxiliary_get_pci_path(dev, numa_path, sizeof(numa_path)) != 0)\n+\t\treturn SOCKET_ID_ANY;\n+\tif (strcat(numa_path, \"/numa_node\") == NULL) {\n+\t\trte_errno = ENAMETOOLONG;\n+\t\treturn SOCKET_ID_ANY;\n+\t}\n+\tif (eal_parse_sysfs_value(numa_path, &numa) != 0) {\n+\t\trte_errno = EINVAL;\n+\t\treturn SOCKET_ID_ANY;\n+\t}\n+\treturn (int)numa;\n+}\n+\n+struct ibv_device *\n+mlx5_get_aux_ibv_device(const struct rte_auxiliary_device *dev)\n+{\n+\tint n;\n+\tchar ib_name[64] = { 0 };\n+\tstruct ibv_device **ibv_list = mlx5_glue->get_device_list(&n);\n+\tstruct ibv_device *ibv_match = NULL;\n+\n+\tif (!ibv_list) {\n+\t\trte_errno = ENOSYS;\n+\t\treturn NULL;\n+\t}\n+\tif (mlx5_auxiliary_get_child_name(dev->name, \"/infiniband\",\n+\t\t\t\t\t  ib_name, sizeof(ib_name)) != 0)\n+\t\tgoto out;\n+\twhile (n-- > 0) {\n+\t\tif (strcmp(ibv_list[n]->name, ib_name) != 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+out:\n+\tmlx5_glue->free_device_list(ibv_list);\n+\treturn ibv_match;\n+}\n+\n+static bool\n+mlx5_common_auxiliary_match(const char *name)\n+{\n+\treturn strncmp(name, MLX5_AUXILIARY_PREFIX,\n+\t\t       strlen(MLX5_AUXILIARY_PREFIX)) == 0;\n+}\n+\n+static int\n+mlx5_common_auxiliary_probe(struct rte_auxiliary_driver *drv __rte_unused,\n+\t\t\t    struct rte_auxiliary_device *dev)\n+{\n+\tdev->device.numa_node = mlx5_auxiliary_get_numa(dev);\n+\treturn mlx5_common_dev_probe(&dev->device);\n+}\n+\n+static int\n+mlx5_common_auxiliary_remove(struct rte_auxiliary_device *auxiliary_dev)\n+{\n+\treturn mlx5_common_dev_remove(&auxiliary_dev->device);\n+}\n+\n+static int\n+mlx5_common_auxiliary_dma_map(struct rte_auxiliary_device *auxiliary_dev,\n+\t\t\t      void *addr, uint64_t iova, size_t len)\n+{\n+\treturn mlx5_common_dev_dma_map(&auxiliary_dev->device, addr, iova, len);\n+}\n+\n+static int\n+mlx5_common_auxiliary_dma_unmap(struct rte_auxiliary_device *auxiliary_dev,\n+\t\t\t\tvoid *addr, uint64_t iova, size_t len)\n+{\n+\treturn mlx5_common_dev_dma_unmap(&auxiliary_dev->device, addr, iova,\n+\t\t\t\t\t len);\n+}\n+\n+static struct rte_auxiliary_driver mlx5_auxiliary_driver = {\n+\t.driver = {\n+\t\t   .name = MLX5_AUXILIARY_DRIVER_NAME,\n+\t},\n+\t.match = mlx5_common_auxiliary_match,\n+\t.probe = mlx5_common_auxiliary_probe,\n+\t.remove = mlx5_common_auxiliary_remove,\n+\t.dma_map = mlx5_common_auxiliary_dma_map,\n+\t.dma_unmap = mlx5_common_auxiliary_dma_unmap,\n+};\n+\n+void mlx5_common_auxiliary_init(void)\n+{\n+\tif (mlx5_auxiliary_driver.bus == NULL)\n+\t\trte_auxiliary_register(&mlx5_auxiliary_driver);\n+}\n+\n+RTE_FINI(mlx5_common_auxiliary_driver_finish)\n+{\n+\tif (mlx5_auxiliary_driver.bus != NULL)\n+\t\trte_auxiliary_unregister(&mlx5_auxiliary_driver);\n+}\ndiff --git a/drivers/common/mlx5/linux/mlx5_common_verbs.c b/drivers/common/mlx5/linux/mlx5_common_verbs.c\nindex 6a6ab7a7a2..9080bd3e87 100644\n--- a/drivers/common/mlx5/linux/mlx5_common_verbs.c\n+++ b/drivers/common/mlx5/linux/mlx5_common_verbs.c\n@@ -12,6 +12,7 @@\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@@ -24,10 +25,12 @@\n struct ibv_device *\n mlx5_os_get_ibv_dev(const struct rte_device *dev)\n {\n-\tstruct ibv_device *ibv = NULL;\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);\ndiff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build\nindex fa2b8b9834..6ddbde7e8f 100644\n--- a/drivers/common/mlx5/meson.build\n+++ b/drivers/common/mlx5/meson.build\n@@ -7,7 +7,7 @@ if not (is_linux or (is_windows and is_ms_linker))\n     subdir_done()\n endif\n \n-deps += ['hash', 'pci', 'bus_pci', 'net', 'eal', 'kvargs']\n+deps += ['hash', 'pci', 'bus_pci', 'bus_auxiliary', 'net', 'eal', 'kvargs']\n sources += files(\n         'mlx5_devx_cmds.c',\n         'mlx5_common.c',\ndiff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c\nindex 8734081a6e..6544e664ce 100644\n--- a/drivers/common/mlx5/mlx5_common.c\n+++ b/drivers/common/mlx5/mlx5_common.c\n@@ -397,6 +397,9 @@ mlx5_class_driver_register(struct mlx5_class_driver *driver)\n static void mlx5_common_driver_init(void)\n {\n \tmlx5_common_pci_init();\n+#ifdef RTE_EXEC_ENV_LINUX\n+\tmlx5_common_auxiliary_init();\n+#endif\n }\n \n static bool mlx5_common_initialized;\ndiff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h\nindex b83fdc204d..5a027903b3 100644\n--- a/drivers/common/mlx5/mlx5_common.h\n+++ b/drivers/common/mlx5/mlx5_common.h\n@@ -24,6 +24,7 @@\n \n /* Reported driver name. */\n #define MLX5_PCI_DRIVER_NAME \"mlx5_pci\"\n+#define MLX5_AUXILIARY_DRIVER_NAME \"mlx5_auxiliary\"\n \n /* Bit-field manipulation. */\n #define BITFIELD_DECLARE(bf, type, size) \\\n@@ -109,6 +110,7 @@ pmd_drv_log_basename(const char *s)\n \tint mkstr_size_##name = snprintf(NULL, 0, \"\" __VA_ARGS__); \\\n \tchar name[mkstr_size_##name + 1]; \\\n \t\\\n+\tmemset(name, 0, mkstr_size_##name + 1); \\\n \tsnprintf(name, sizeof(name), \"\" __VA_ARGS__)\n \n enum {\n@@ -136,6 +138,10 @@ enum {\n \tPCI_DEVICE_ID_MELLANOX_CONNECTX7BF = 0Xa2dc,\n };\n \n+\n+__rte_internal\n+int mlx5_auxiliary_get_child_name(const char *dev, const char *node,\n+\t\t\t\t  char *child, size_t size);\n /* Maximum number of simultaneous unicast MAC addresses. */\n #define MLX5_MAX_UC_MAC_ADDRESSES 128\n /* Maximum number of simultaneous Multicast MAC addresses. */\ndiff --git a/drivers/common/mlx5/mlx5_common_private.h b/drivers/common/mlx5/mlx5_common_private.h\nindex 791eb3cd77..9f00a6c54d 100644\n--- a/drivers/common/mlx5/mlx5_common_private.h\n+++ b/drivers/common/mlx5/mlx5_common_private.h\n@@ -6,6 +6,7 @@\n #define _MLX5_COMMON_PRIVATE_H_\n \n #include <rte_pci.h>\n+#include <rte_bus_auxiliary.h>\n \n #include \"mlx5_common.h\"\n \n@@ -34,6 +35,11 @@ void mlx5_common_driver_on_register_pci(struct mlx5_class_driver *driver);\n bool mlx5_dev_pci_match(const struct mlx5_class_driver *drv,\n \t\t\tconst struct rte_device *dev);\n \n+/* Common auxiliary bus driver: */\n+void mlx5_common_auxiliary_init(void);\n+struct ibv_device *mlx5_get_aux_ibv_device(\n+\t\tconst struct rte_auxiliary_device *dev);\n+\n #ifdef __cplusplus\n }\n #endif /* __cplusplus */\ndiff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map\nindex e9d43dc1e5..b47d73b425 100644\n--- a/drivers/common/mlx5/version.map\n+++ b/drivers/common/mlx5/version.map\n@@ -3,6 +3,8 @@ INTERNAL {\n \n \thaswell_broadwell_cpu;\n \n+\tmlx5_auxiliary_get_child_name; # WINDOWS_NO_EXPORT\n+\n \tmlx5_class_driver_register;\n \n \tmlx5_common_init;\n",
    "prefixes": [
        "v3",
        "04/15"
    ]
}