get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 133835,
    "url": "http://patchwork.dpdk.org/api/patches/133835/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20231103112016.1945684-2-shubham.rohila@amd.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": "<20231103112016.1945684-2-shubham.rohila@amd.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231103112016.1945684-2-shubham.rohila@amd.com",
    "date": "2023-11-03T11:20:16",
    "name": "[v2,2/2] bus/cdx: add bus master enable/disable APIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "6c2bff39b5ef0e362f14625a3a3e9426c3e68d0a",
    "submitter": {
        "id": 3220,
        "url": "http://patchwork.dpdk.org/api/people/3220/?format=api",
        "name": "Shubham Rohila",
        "email": "shubham.rohila@amd.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/20231103112016.1945684-2-shubham.rohila@amd.com/mbox/",
    "series": [
        {
            "id": 30135,
            "url": "http://patchwork.dpdk.org/api/series/30135/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=30135",
            "date": "2023-11-03T11:20:15",
            "name": "[v2,1/2] bus/cdx: add support for devices without MSI",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/30135/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/133835/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/133835/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 8BB9443279;\n\tFri,  3 Nov 2023 12:20:41 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 733C840691;\n\tFri,  3 Nov 2023 12:20:40 +0100 (CET)",
            "from NAM12-DM6-obe.outbound.protection.outlook.com\n (mail-dm6nam12on2075.outbound.protection.outlook.com [40.107.243.75])\n by mails.dpdk.org (Postfix) with ESMTP id DF8574067D\n for <dev@dpdk.org>; Fri,  3 Nov 2023 12:20:38 +0100 (CET)",
            "from MN2PR19CA0031.namprd19.prod.outlook.com (2603:10b6:208:178::44)\n by SJ2PR12MB7964.namprd12.prod.outlook.com (2603:10b6:a03:4cf::7)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.24; Fri, 3 Nov\n 2023 11:20:36 +0000",
            "from BL6PEPF0001AB4A.namprd04.prod.outlook.com\n (2603:10b6:208:178:cafe::a4) by MN2PR19CA0031.outlook.office365.com\n (2603:10b6:208:178::44) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.22 via Frontend\n Transport; Fri, 3 Nov 2023 11:20:36 +0000",
            "from SATLEXMB04.amd.com (165.204.84.17) by\n BL6PEPF0001AB4A.mail.protection.outlook.com (10.167.242.68) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.20.6954.19 via Frontend Transport; Fri, 3 Nov 2023 11:20:35 +0000",
            "from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com\n (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Fri, 3 Nov\n 2023 06:20:35 -0500",
            "from xhdipdslab61.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com\n (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.32 via\n Frontend Transport; Fri, 3 Nov 2023 06:20:33 -0500"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=GVS96u8jUKbSbJkX5DhF5He6acjxA85qlDBELvC6PNORshSkFX1Jiac1yufCFHnncDkg/faYN01+AHByW0Zvv0/0QmDXUv8WQ4sXF+1zoA4WV+nwbM1jEMH4VyhK6lfzBAllE99Wn7eKbMS6vNJB6XJnxfiEexClkuUrPw803QPFJIkDM+EAEPR9+OV/60QBePeQI2iUpyXrU15hxO/w4EezGUZSdyGhKCTtWFmTjj2P5s1U5Vb/scGxDm6xHlY4KJndwPo4EFguvhegTU2+YyhHLXT5fkJ524IQOuFxPjYkT08aPE/xU9VlQp747d7ntSYtY5tIcU1BAd9NA7mbEg==",
        "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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=R6lmhbqBY/pzmgv1VGaKpQpMhXOUpjORDh1a5RMZqCE=;\n b=HeBlO5eUUDZy4aOKqfUAhmigGmgcDrQeJ2OoJa1zrTrXijWafyKS1Lsnr4eJQfxE///6HFEpbEZiTbFiaEsqPwnftwcWJl7H1V7x9vB+G4RvgY2szUhPHxbIbfbhepDYAnIYcUV4s/WU4fOzJ5LeB4lPeJ1EnDCLoSoLrylXjSzmCMDtVz1LYwEP1P1w2be4rdKHrNIOYzZC9yrVlgUKjEUUGKJbj9Q6EEolfUB/wlUwW350g/yH0ob3hWpNPQySDO4o9hHdzSBM3a71bBtmmDeRRi+BOGkDlV7X4rkPgW7BOMMrLA3zlSV9W7kaX8Dm0f+nez/wX1gvahDbmro6Jw==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass\n (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;\n dkim=none (message not signed); arc=none (0)",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=R6lmhbqBY/pzmgv1VGaKpQpMhXOUpjORDh1a5RMZqCE=;\n b=hHsiyD3JBQg9uAICoF1EkLuqsfbz8qhy18COpNf+uCa1U9pLj3efCO0aavQpNn3MLkQkrzoCD2Ht0pJbZtbfOzQ6geGJwpNqc5Wp7OXjfFkRPeqn1jbMXlUR5ZDv4EpwSVf7Afc3LKBfjoDljkJ763Y1EJnxYKVHlPrVsomsrbQ=",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 165.204.84.17)\n smtp.mailfrom=amd.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=amd.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of amd.com designates\n 165.204.84.17 as permitted sender) receiver=protection.outlook.com;\n client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C",
        "From": "Shubham Rohila <shubham.rohila@amd.com>",
        "To": "<nikhil.agarwal@amd.com>, <david.marchand@redhat.com>,\n <nipun.gupta@amd.com>, <dev@dpdk.org>",
        "CC": "<thomas@monjalon.net>, <ferruh.yigit@amd.com>,\n <anatoly.burakov@intel.com>, Shubham Rohila <shubham.rohila@amd.com>",
        "Subject": "[PATCH v2 2/2] bus/cdx: add bus master enable/disable APIs",
        "Date": "Fri, 3 Nov 2023 16:50:16 +0530",
        "Message-ID": "<20231103112016.1945684-2-shubham.rohila@amd.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20231103112016.1945684-1-shubham.rohila@amd.com>",
        "References": "<20231027162212.3353973-1-ferruh.yigit@amd.com>\n <20231103112016.1945684-1-shubham.rohila@amd.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "BL6PEPF0001AB4A:EE_|SJ2PR12MB7964:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "7b45d533-4ba6-491a-b894-08dbdc5ee6c7",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n StfUmH/LqGaTvf8xHmK6V4bMu4Wkon03ODfdh7C27mw6fNYcooFQNyhzlFKCyc67RynJhzNKg3BeeKPuA2PcaOZxOqljT5j5kHWYDdzh3OFlI3oq2UEjEu5xYYxShArqqV4Iqg4K6Cj5eLl53AhMLRTin04H3GfAKNDgWK8k38CVYvja2NSL3BmNHWj2lF7Iqkx+UISoOeDpFC9moT983TmQQjal5BFUcTgkoGcUlleqh2nBLUK6Nr6EMisBLL1BRr/AZQk8z3Bc1DHbhedq44BTnDFXxPeFgvjFPCsigB67+mhxs78p48C/MOXAEKqrnHZh9+XWH5Yct4vFHwSyTr32xgsXSlEjvN91Hh4X0tq4i4CTKzm/pbTCPllzo2DUhIdV/hrBRJrLA0+j2GP70pY3fDqKzLtEsW+1aEBnIoZNe3nwlUEh0FjJM6ClocCL0zKMXHtJxt6uemkmMhjMme58/5BmuAk3mrsH5CyNQ9ArH339talaZ+2iWfL9QRdy/zLiJ9E41pm9QdOrwb3/t9TPxOUDoRrpf/MuWnfdCGoaDOenuz40StuN2vClxKb19qS6mXIuFzmuBUySraExHmrrcuSBN0EBpp5uixJBc02UKTE73USW8YJxLWzdaqMVQmjzcOWX5CMbYaQCvi8Do2AB3OpPsCiIqUFlAByJ48dhC6Lxp6RDtGrCh3Cueq7R0FiMvkPATjMqIcQ0qqs0ZloxbffI8VFGrDPZAdEDTQ0+FfYQpGDUX6cNQdSwY8WbTLhoCywK7zLFXuYZ5WjcmA==",
        "X-Forefront-Antispam-Report": "CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE;\n SFS:(13230031)(4636009)(376002)(396003)(136003)(346002)(39860400002)(230922051799003)(82310400011)(186009)(451199024)(64100799003)(1800799009)(46966006)(36840700001)(40470700004)(47076005)(26005)(6666004)(478600001)(54906003)(2906002)(81166007)(40480700001)(70206006)(110136005)(70586007)(1076003)(82740400003)(2616005)(36756003)(336012)(426003)(40460700003)(41300700001)(44832011)(316002)(5660300002)(356005)(83380400001)(86362001)(36860700001)(4326008)(8676002)(8936002)(36900700001);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "amd.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "03 Nov 2023 11:20:35.9473 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 7b45d533-4ba6-491a-b894-08dbdc5ee6c7",
        "X-MS-Exchange-CrossTenant-Id": "3dd8961f-e488-4e60-8e11-a82d994e183d",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17];\n Helo=[SATLEXMB04.amd.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n BL6PEPF0001AB4A.namprd04.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "SJ2PR12MB7964",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Define rte_cdx_vfio_bm_enable and rte_cdx_vfio_bm_disable to\nenable or disable bus master functionality for cdx devices.\n\nSigned-off-by: Shubham Rohila <shubham.rohila@amd.com>\n---\n v2\n - Fix indentations and alphabetical orderings.\n - Wrap checks in parenthesis for readability\n - Assign argsz before using in rte_cdx_vfio_bm_disable\n - Remove unecessary variable initialisation\n\n drivers/bus/cdx/bus_cdx_driver.h |  25 ++++++++\n drivers/bus/cdx/cdx_vfio.c       | 103 +++++++++++++++++++++++++++++++\n drivers/bus/cdx/version.map      |   2 +\n lib/eal/include/rte_vfio.h       |  27 ++++++++\n 4 files changed, 157 insertions(+)",
    "diff": "diff --git a/drivers/bus/cdx/bus_cdx_driver.h b/drivers/bus/cdx/bus_cdx_driver.h\nindex 1c9a64c87a..211f8e406b 100644\n--- a/drivers/bus/cdx/bus_cdx_driver.h\n+++ b/drivers/bus/cdx/bus_cdx_driver.h\n@@ -16,6 +16,7 @@ extern \"C\" {\n \n #include <stdlib.h>\n #include <inttypes.h>\n+#include <linux/types.h>\n \n #include <bus_driver.h>\n #include <dev_driver.h>\n@@ -178,6 +179,30 @@ int rte_cdx_vfio_intr_enable(const struct rte_intr_handle *intr_handle);\n __rte_internal\n int rte_cdx_vfio_intr_disable(const struct rte_intr_handle *intr_handle);\n \n+/**\n+ * Enable Bus Mastering for CDX bus devices.\n+ *\n+ * @param dev\n+ *   Pointer to the cdx device.\n+ *\n+ * @return\n+ *   0 on success, -1 on error.\n+ */\n+__rte_internal\n+int rte_cdx_vfio_bm_enable(struct rte_cdx_device *dev);\n+\n+/**\n+ * Disable Bus Mastering for CDX bus devices.\n+ *\n+ * @param dev\n+ *   Pointer to the cdx device.\n+ *\n+ * @return\n+ *   0 on success, -1 on error.\n+ */\n+__rte_internal\n+int rte_cdx_vfio_bm_disable(struct rte_cdx_device *dev);\n+\n /**\n  * Unregister a CDX driver.\n  *\ndiff --git a/drivers/bus/cdx/cdx_vfio.c b/drivers/bus/cdx/cdx_vfio.c\nindex 8cac79782e..1481022f13 100644\n--- a/drivers/bus/cdx/cdx_vfio.c\n+++ b/drivers/bus/cdx/cdx_vfio.c\n@@ -102,6 +102,10 @@ cdx_vfio_unmap_resource_primary(struct rte_cdx_device *dev)\n \tint ret, vfio_dev_fd;\n \n \tif (rte_intr_fd_get(dev->intr_handle) >= 0) {\n+\t\tif (rte_cdx_vfio_bm_disable(dev) < 0)\n+\t\t\tCDX_BUS_ERR(\"Error when disabling bus master for %s\",\n+\t\t\t\t    dev->device.name);\n+\n \t\tif (close(rte_intr_fd_get(dev->intr_handle)) < 0) {\n \t\t\tCDX_BUS_ERR(\"Error when closing eventfd file descriptor for %s\",\n \t\t\t\tdev->device.name);\n@@ -255,6 +259,16 @@ cdx_vfio_setup_device(struct rte_cdx_device *dev, int vfio_dev_fd,\n \t\treturn -1;\n \t}\n \n+\t/*\n+\t * Enable Bus mastering for the device. errno is set as ENOTTY if\n+\t * device does not support configuring bus master.\n+\t */\n+\tif (rte_cdx_vfio_bm_enable(dev) && (errno != -ENOTTY)) {\n+\t\tCDX_BUS_ERR(\"Bus master enable failure! Error: %d (%s)\", errno,\n+\t\t\tstrerror(errno));\n+\t\treturn -1;\n+\t}\n+\n \treturn 0;\n }\n \n@@ -595,3 +609,92 @@ rte_cdx_vfio_intr_disable(const struct rte_intr_handle *intr_handle)\n \n \treturn ret;\n }\n+\n+/* enable Bus Mastering */\n+int\n+rte_cdx_vfio_bm_enable(struct rte_cdx_device *dev)\n+{\n+\tstruct vfio_device_info device_info = { .argsz = sizeof(device_info) };\n+\tstruct vfio_device_feature_bus_master *vfio_bm_feature;\n+\tstruct vfio_device_feature *feature;\n+\tint vfio_dev_fd, ret;\n+\tsize_t argsz;\n+\n+\tvfio_dev_fd = rte_intr_dev_fd_get(dev->intr_handle);\n+\tif (vfio_dev_fd < 0)\n+\t\treturn -1;\n+\n+\targsz = sizeof(struct vfio_device_feature) + sizeof(struct vfio_device_feature_bus_master);\n+\n+\tfeature = (struct vfio_device_feature *)malloc(argsz);\n+\tif (!feature)\n+\t\treturn -ENOMEM;\n+\n+\tvfio_bm_feature = (struct vfio_device_feature_bus_master *) feature->data;\n+\n+\tfeature->argsz = argsz;\n+\n+\tfeature->flags = RTE_VFIO_DEVICE_FEATURE_BUS_MASTER | VFIO_DEVICE_FEATURE_PROBE;\n+\tfeature->flags |= VFIO_DEVICE_FEATURE_SET;\n+\tret = ioctl(vfio_dev_fd, RTE_VFIO_DEVICE_FEATURE, feature);\n+\tif (ret) {\n+\t\tCDX_BUS_ERR(\"Bus Master configuring not supported for device: %s, error: %d (%s)\\n\",\n+\t\t\tdev->name, errno, strerror(errno));\n+\t\tfree(feature);\n+\t\treturn ret;\n+\t}\n+\n+\tfeature->flags = RTE_VFIO_DEVICE_FEATURE_BUS_MASTER | VFIO_DEVICE_FEATURE_SET;\n+\tvfio_bm_feature->op = VFIO_DEVICE_FEATURE_SET_MASTER;\n+\tret = ioctl(vfio_dev_fd, RTE_VFIO_DEVICE_FEATURE, feature);\n+\tif (ret < 0)\n+\t\tCDX_BUS_ERR(\"BM Enable Error for device: %s, Error: %d (%s)\\n\",\n+\t\t\tdev->name, errno, strerror(errno));\n+\n+\tfree(feature);\n+\treturn ret;\n+}\n+\n+/* Disable Bus Mastering */\n+int\n+rte_cdx_vfio_bm_disable(struct rte_cdx_device *dev)\n+{\n+\tstruct vfio_device_feature_bus_master *vfio_bm_feature;\n+\tstruct vfio_device_feature *feature;\n+\tint vfio_dev_fd, ret;\n+\tsize_t argsz;\n+\n+\tvfio_dev_fd = rte_intr_dev_fd_get(dev->intr_handle);\n+\tif (vfio_dev_fd < 0)\n+\t\treturn -1;\n+\n+\targsz = sizeof(struct vfio_device_feature) + sizeof(struct vfio_device_feature_bus_master);\n+\n+\tfeature = (struct vfio_device_feature *)malloc(argsz);\n+\tif (!feature)\n+\t\treturn -ENOMEM;\n+\n+\tvfio_bm_feature = (struct vfio_device_feature_bus_master *) feature->data;\n+\n+\tfeature->argsz = argsz;\n+\n+\tfeature->flags = RTE_VFIO_DEVICE_FEATURE_BUS_MASTER | VFIO_DEVICE_FEATURE_PROBE;\n+\tfeature->flags |= VFIO_DEVICE_FEATURE_SET;\n+\tret = ioctl(vfio_dev_fd, RTE_VFIO_DEVICE_FEATURE, feature);\n+\tif (ret) {\n+\t\tCDX_BUS_ERR(\"Bus Master configuring not supported for device: %s, Error: %d (%s)\\n\",\n+\t\t\tdev->name, errno, strerror(errno));\n+\t\tfree(feature);\n+\t\treturn ret;\n+\t}\n+\n+\tfeature->flags = RTE_VFIO_DEVICE_FEATURE_BUS_MASTER | VFIO_DEVICE_FEATURE_SET;\n+\tvfio_bm_feature->op = VFIO_DEVICE_FEATURE_CLEAR_MASTER;\n+\tret = ioctl(vfio_dev_fd, RTE_VFIO_DEVICE_FEATURE, feature);\n+\tif (ret < 0)\n+\t\tCDX_BUS_ERR(\"BM Disable Error for device: %s, Error: %d (%s)\\n\",\n+\t\t\tdev->name, errno, strerror(errno));\n+\n+\tfree(feature);\n+\treturn ret;\n+}\ndiff --git a/drivers/bus/cdx/version.map b/drivers/bus/cdx/version.map\nindex 0a15d39ae8..7a22cf5b4b 100644\n--- a/drivers/bus/cdx/version.map\n+++ b/drivers/bus/cdx/version.map\n@@ -5,6 +5,8 @@ INTERNAL {\n \trte_cdx_register;\n \trte_cdx_unmap_device;\n \trte_cdx_unregister;\n+\trte_cdx_vfio_bm_disable;\n+\trte_cdx_vfio_bm_enable;\n \trte_cdx_vfio_intr_disable;\n \trte_cdx_vfio_intr_enable;\n \ndiff --git a/lib/eal/include/rte_vfio.h b/lib/eal/include/rte_vfio.h\nindex 3487c4f2a2..22832afd0f 100644\n--- a/lib/eal/include/rte_vfio.h\n+++ b/lib/eal/include/rte_vfio.h\n@@ -73,6 +73,33 @@ struct vfio_info_cap_header {\n #define RTE_VFIO_CAP_MSIX_MAPPABLE 3\n #endif\n \n+/* VFIO_DEVICE_FEATURE is defined for kernel version 5.7 and newer. */\n+#ifdef\tVFIO_DEVICE_FEATURE\n+#define\tRTE_VFIO_DEVICE_FEATURE\tVFIO_DEVICE_FEATURE\n+#else\n+#define\tRTE_VFIO_DEVICE_FEATURE\t_IO(VFIO_TYPE, VFIO_BASE + 17)\n+struct vfio_device_feature {\n+\t__u32\targsz;\n+\t__u32\tflags;\n+#define\tVFIO_DEVICE_FEATURE_MASK\t(0xffff) /* 16-bit feature index */\n+#define\tVFIO_DEVICE_FEATURE_GET\t\t(1 << 16) /* Get feature into data[] */\n+#define\tVFIO_DEVICE_FEATURE_SET\t\t(1 << 17) /* Set feature from data[] */\n+#define\tVFIO_DEVICE_FEATURE_PROBE\t(1 << 18) /* Probe feature support */\n+\t__u8\tdata[];\n+};\n+#endif\n+\n+#ifdef\tVFIO_DEVICE_FEATURE_BUS_MASTER\n+#define\tRTE_VFIO_DEVICE_FEATURE_BUS_MASTER\tVFIO_DEVICE_FEATURE_BUS_MASTER\n+#else\n+#define\tRTE_VFIO_DEVICE_FEATURE_BUS_MASTER\t10\n+struct vfio_device_feature_bus_master {\n+\t__u32 op;\n+#define\tVFIO_DEVICE_FEATURE_CLEAR_MASTER\t0\t/* Clear Bus Master */\n+#define\tVFIO_DEVICE_FEATURE_SET_MASTER\t\t1\t/* Set Bus Master */\n+};\n+#endif\n+\n #else /* not VFIO_PRESENT */\n \n /* we don't need an actual definition, only pointer is used */\n",
    "prefixes": [
        "v2",
        "2/2"
    ]
}