get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 92562,
    "url": "http://patchwork.dpdk.org/api/patches/92562/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210430150637.362610-9-bruce.richardson@intel.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": "<20210430150637.362610-9-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210430150637.362610-9-bruce.richardson@intel.com",
    "date": "2021-04-30T15:06:33",
    "name": "[v4,08/12] raw/ioat: add bus driver for device scanning automatically",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7d9f65d30c16879bce6409e9fc682e48aeee1038",
    "submitter": {
        "id": 20,
        "url": "http://patchwork.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.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/20210430150637.362610-9-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 16778,
            "url": "http://patchwork.dpdk.org/api/series/16778/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=16778",
            "date": "2021-04-30T15:06:25",
            "name": "ioat driver updates",
            "version": 4,
            "mbox": "http://patchwork.dpdk.org/series/16778/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/92562/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/92562/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 052A3A0546;\n\tFri, 30 Apr 2021 17:07:51 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8447841200;\n\tFri, 30 Apr 2021 17:07:09 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by mails.dpdk.org (Postfix) with ESMTP id 9623D4014F\n for <dev@dpdk.org>; Fri, 30 Apr 2021 17:07:02 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 30 Apr 2021 08:07:01 -0700",
            "from silpixa00399126.ir.intel.com ([10.237.223.78])\n by FMSMGA003.fm.intel.com with ESMTP; 30 Apr 2021 08:07:00 -0700"
        ],
        "IronPort-SDR": [
            "\n TKghmpaaAK8Jt/DrslNtW4+ruPHi+ClF0O8RUBcDvXQzinGxyPB3bCE2I3OSwnqXsOpSkVFJt3\n R6pbwWRVtQNw==",
            "\n fexwztdwcHvlBxi7wxTdoqiM1+DG6hpXJKTITu+v4BBlgspihckLjVOFQYhJAP/MpPhLrGMjsV\n BK+AR+PKOYnw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,9970\"; a=\"261240847\"",
            "E=Sophos;i=\"5.82,263,1613462400\"; d=\"scan'208\";a=\"261240847\"",
            "E=Sophos;i=\"5.82,263,1613462400\"; d=\"scan'208\";a=\"456011368\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "kevin.laatz@intel.com, sunil.pai.g@intel.com, jiayu.hu@intel.com,\n Bruce Richardson <bruce.richardson@intel.com>",
        "Date": "Fri, 30 Apr 2021 16:06:33 +0100",
        "Message-Id": "<20210430150637.362610-9-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20210430150637.362610-1-bruce.richardson@intel.com>",
        "References": "<20210318182042.43658-1-bruce.richardson@intel.com>\n <20210430150637.362610-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v4 08/12] raw/ioat: add bus driver for device\n scanning automatically",
        "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": "Rather than using a vdev with args, DPDK can scan and initialize the\ndevices automatically using a bus-type driver. This bus does not need to\nworry about registering device drivers, rather it can initialize the\ndevices directly on probe.\n\nThe device instances (queues) to use are detected from /dev with the\nadditional info about them got from /sys.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n doc/guides/rawdevs/ioat.rst  |  23 ++-\n drivers/raw/ioat/idxd_bus.c  | 359 +++++++++++++++++++++++++++++++++++\n drivers/raw/ioat/idxd_vdev.c | 231 ----------------------\n drivers/raw/ioat/meson.build |   4 +-\n 4 files changed, 374 insertions(+), 243 deletions(-)\n create mode 100644 drivers/raw/ioat/idxd_bus.c\n delete mode 100644 drivers/raw/ioat/idxd_vdev.c",
    "diff": "diff --git a/doc/guides/rawdevs/ioat.rst b/doc/guides/rawdevs/ioat.rst\nindex 60438cc3bc..2ad13db294 100644\n--- a/doc/guides/rawdevs/ioat.rst\n+++ b/doc/guides/rawdevs/ioat.rst\n@@ -78,7 +78,7 @@ Example configuration for a work queue::\n \n         $ accel-config config-wq dsa0/wq0.0 --group-id=0 \\\n            --mode=dedicated --priority=10 --wq-size=8 \\\n-           --type=user --name=app1\n+           --type=user --name=dpdk_app1\n \n Once the devices have been configured, they need to be enabled::\n \n@@ -114,15 +114,18 @@ the device driver on the EAL commandline, via the ``allowlist`` or ``-a`` flag e\n \n \t$ dpdk-test -a <b:d:f>,max_queues=4\n \n-If the device is bound to the IDXD kernel driver (and previously configured with sysfs),\n-then a specific work queue needs to be passed to the application via a vdev parameter.\n-This vdev parameter take the driver name and work queue name as parameters.\n-For example, to use work queue 0 on Intel\\ |reg| DSA instance 0::\n-\n-        $ dpdk-test --no-pci --vdev=rawdev_idxd,wq=0.0\n-\n-Once probed successfully, the device will appear as a ``rawdev``, that is a\n-\"raw device type\" inside DPDK, and can be accessed using APIs from the\n+For devices bound to the IDXD kernel driver,\n+the DPDK ioat driver will automatically perform a scan for available workqueues to use.\n+Any workqueues found listed in ``/dev/dsa`` on the system will be checked in ``/sys``,\n+and any which have ``dpdk_`` prefix in their name will be automatically probed by the\n+driver to make them available to the application.\n+Alternatively, to support use by multiple DPDK processes simultaneously,\n+the value used as the DPDK ``--file-prefix`` parameter may be used as a workqueue name prefix,\n+instead of ``dpdk_``,\n+allowing each DPDK application instance to only use a subset of configured queues.\n+\n+Once probed successfully, irrespective of kernel driver, the device will appear as a ``rawdev``,\n+that is a \"raw device type\" inside DPDK, and can be accessed using APIs from the\n ``rte_rawdev`` library.\n \n Using IOAT Rawdev Devices\ndiff --git a/drivers/raw/ioat/idxd_bus.c b/drivers/raw/ioat/idxd_bus.c\nnew file mode 100644\nindex 0000000000..5b448d49de\n--- /dev/null\n+++ b/drivers/raw/ioat/idxd_bus.c\n@@ -0,0 +1,359 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2021 Intel Corporation\n+ */\n+\n+#include <dirent.h>\n+#include <libgen.h>\n+#include <string.h>\n+#include <errno.h>\n+#include <unistd.h>\n+#include <fcntl.h>\n+#include <sys/mman.h>\n+\n+#include <rte_bus.h>\n+#include <rte_log.h>\n+#include <rte_string_fns.h>\n+#include \"ioat_private.h\"\n+\n+/* default value for DSA paths, but allow override in environment for testing */\n+#define DSA_DEV_PATH \"/dev/dsa\"\n+#define DSA_SYSFS_PATH \"/sys/bus/dsa/devices\"\n+\n+/** unique identifier for a DSA device/WQ instance */\n+struct dsa_wq_addr {\n+\tuint16_t device_id;\n+\tuint16_t wq_id;\n+};\n+\n+/** a DSA device instance */\n+struct rte_dsa_device {\n+\tstruct rte_device device;           /**< Inherit core device */\n+\tTAILQ_ENTRY(rte_dsa_device) next;   /**< next dev in list */\n+\n+\tchar wq_name[32];                   /**< the workqueue name/number e.g. wq0.1 */\n+\tstruct dsa_wq_addr addr;            /**< Identifies the specific WQ */\n+};\n+\n+/* forward prototypes */\n+struct dsa_bus;\n+static int dsa_scan(void);\n+static int dsa_probe(void);\n+static struct rte_device *dsa_find_device(const struct rte_device *start,\n+\t\trte_dev_cmp_t cmp,  const void *data);\n+static enum rte_iova_mode dsa_get_iommu_class(void);\n+static int dsa_addr_parse(const char *name, void *addr);\n+\n+/** List of devices */\n+TAILQ_HEAD(dsa_device_list, rte_dsa_device);\n+\n+/**\n+ * Structure describing the DSA bus\n+ */\n+struct dsa_bus {\n+\tstruct rte_bus bus;               /**< Inherit the generic class */\n+\tstruct rte_driver driver;         /**< Driver struct for devices to point to */\n+\tstruct dsa_device_list device_list;  /**< List of PCI devices */\n+};\n+\n+struct dsa_bus dsa_bus = {\n+\t.bus = {\n+\t\t.scan = dsa_scan,\n+\t\t.probe = dsa_probe,\n+\t\t.find_device = dsa_find_device,\n+\t\t.get_iommu_class = dsa_get_iommu_class,\n+\t\t.parse = dsa_addr_parse,\n+\t},\n+\t.driver = {\n+\t\t.name = \"rawdev_idxd\"\n+\t},\n+\t.device_list = TAILQ_HEAD_INITIALIZER(dsa_bus.device_list),\n+};\n+\n+static inline const char *\n+dsa_get_dev_path(void)\n+{\n+\tconst char *path = getenv(\"DSA_DEV_PATH\");\n+\treturn path ? path : DSA_DEV_PATH;\n+}\n+\n+static inline const char *\n+dsa_get_sysfs_path(void)\n+{\n+\tconst char *path = getenv(\"DSA_SYSFS_PATH\");\n+\treturn path ? path : DSA_SYSFS_PATH;\n+}\n+\n+static const struct rte_rawdev_ops idxd_vdev_ops = {\n+\t\t.dev_close = idxd_rawdev_close,\n+\t\t.dev_selftest = ioat_rawdev_test,\n+\t\t.dump = idxd_dev_dump,\n+\t\t.dev_configure = idxd_dev_configure,\n+\t\t.dev_info_get = idxd_dev_info_get,\n+\t\t.xstats_get = ioat_xstats_get,\n+\t\t.xstats_get_names = ioat_xstats_get_names,\n+\t\t.xstats_reset = ioat_xstats_reset,\n+};\n+\n+static void *\n+idxd_vdev_mmap_wq(struct rte_dsa_device *dev)\n+{\n+\tvoid *addr;\n+\tchar path[PATH_MAX];\n+\tint fd;\n+\n+\tsnprintf(path, sizeof(path), \"%s/%s\", dsa_get_dev_path(), dev->wq_name);\n+\tfd = open(path, O_RDWR);\n+\tif (fd < 0) {\n+\t\tIOAT_PMD_ERR(\"Failed to open device path: %s\", path);\n+\t\treturn NULL;\n+\t}\n+\n+\taddr = mmap(NULL, 0x1000, PROT_WRITE, MAP_SHARED, fd, 0);\n+\tclose(fd);\n+\tif (addr == MAP_FAILED) {\n+\t\tIOAT_PMD_ERR(\"Failed to mmap device %s\", path);\n+\t\treturn NULL;\n+\t}\n+\n+\treturn addr;\n+}\n+\n+static int\n+read_wq_string(struct rte_dsa_device *dev, const char *filename,\n+\t\tchar *value, size_t valuelen)\n+{\n+\tchar sysfs_node[PATH_MAX];\n+\tint len;\n+\tint fd;\n+\n+\tsnprintf(sysfs_node, sizeof(sysfs_node), \"%s/%s/%s\",\n+\t\t\tdsa_get_sysfs_path(), dev->wq_name, filename);\n+\tfd = open(sysfs_node, O_RDONLY);\n+\tif (fd < 0) {\n+\t\tIOAT_PMD_ERR(\"%s(): opening file '%s' failed: %s\",\n+\t\t\t\t__func__, sysfs_node, strerror(errno));\n+\t\treturn -1;\n+\t}\n+\n+\tlen = read(fd, value, valuelen - 1);\n+\tclose(fd);\n+\tif (len < 0) {\n+\t\tIOAT_PMD_ERR(\"%s(): error reading file '%s': %s\",\n+\t\t\t\t__func__, sysfs_node, strerror(errno));\n+\t\treturn -1;\n+\t}\n+\tvalue[len] = '\\0';\n+\treturn 0;\n+}\n+\n+static int\n+read_wq_int(struct rte_dsa_device *dev, const char *filename,\n+\t\tint *value)\n+{\n+\tchar sysfs_node[PATH_MAX];\n+\tFILE *f;\n+\tint ret = 0;\n+\n+\tsnprintf(sysfs_node, sizeof(sysfs_node), \"%s/%s/%s\",\n+\t\t\tdsa_get_sysfs_path(), dev->wq_name, filename);\n+\tf = fopen(sysfs_node, \"r\");\n+\tif (f == NULL) {\n+\t\tIOAT_PMD_ERR(\"%s(): opening file '%s' failed: %s\",\n+\t\t\t\t__func__, sysfs_node, strerror(errno));\n+\t\treturn -1;\n+\t}\n+\n+\tif (fscanf(f, \"%d\", value) != 1) {\n+\t\tIOAT_PMD_ERR(\"%s(): error reading file '%s': %s\",\n+\t\t\t\t__func__, sysfs_node, strerror(errno));\n+\t\tret = -1;\n+\t}\n+\n+\tfclose(f);\n+\treturn ret;\n+}\n+\n+static int\n+read_device_int(struct rte_dsa_device *dev, const char *filename,\n+\t\tint *value)\n+{\n+\tchar sysfs_node[PATH_MAX];\n+\tFILE *f;\n+\tint ret = 0;\n+\n+\tsnprintf(sysfs_node, sizeof(sysfs_node), \"%s/dsa%d/%s\",\n+\t\t\tdsa_get_sysfs_path(), dev->addr.device_id, filename);\n+\tf = fopen(sysfs_node, \"r\");\n+\tif (f == NULL) {\n+\t\tIOAT_PMD_ERR(\"%s(): opening file '%s' failed: %s\",\n+\t\t\t\t__func__, sysfs_node, strerror(errno));\n+\t\treturn -1;\n+\t}\n+\n+\tif (fscanf(f, \"%d\", value) != 1) {\n+\t\tIOAT_PMD_ERR(\"%s(): error reading file '%s': %s\",\n+\t\t\t\t__func__, sysfs_node, strerror(errno));\n+\t\tret = -1;\n+\t}\n+\n+\tfclose(f);\n+\treturn ret;\n+}\n+\n+static int\n+idxd_rawdev_probe_dsa(struct rte_dsa_device *dev)\n+{\n+\tstruct idxd_rawdev idxd = {{0}}; /* double {} to avoid error on BSD12 */\n+\tint ret = 0;\n+\n+\tIOAT_PMD_INFO(\"Probing device %s on numa node %d\",\n+\t\t\tdev->wq_name, dev->device.numa_node);\n+\tif (read_wq_int(dev, \"size\", &ret) < 0)\n+\t\treturn -1;\n+\tidxd.max_batches = ret;\n+\tidxd.qid = dev->addr.wq_id;\n+\tidxd.u.vdev.dsa_id = dev->addr.device_id;\n+\n+\tidxd.public.portal = idxd_vdev_mmap_wq(dev);\n+\tif (idxd.public.portal == NULL) {\n+\t\tIOAT_PMD_ERR(\"WQ mmap failed\");\n+\t\treturn -ENOENT;\n+\t}\n+\n+\tret = idxd_rawdev_create(dev->wq_name, &dev->device, &idxd, &idxd_vdev_ops);\n+\tif (ret) {\n+\t\tIOAT_PMD_ERR(\"Failed to create rawdev %s\", dev->wq_name);\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+is_for_this_process_use(const char *name)\n+{\n+\tchar *runtime_dir = strdup(rte_eal_get_runtime_dir());\n+\tchar *prefix = basename(runtime_dir);\n+\tint prefixlen = strlen(prefix);\n+\tint retval = 0;\n+\n+\tif (strncmp(name, \"dpdk_\", 5) == 0)\n+\t\tretval = 1;\n+\tif (strncmp(name, prefix, prefixlen) == 0 && name[prefixlen] == '_')\n+\t\tretval = 1;\n+\n+\tfree(runtime_dir);\n+\treturn retval;\n+}\n+\n+static int\n+dsa_probe(void)\n+{\n+\tstruct rte_dsa_device *dev;\n+\n+\tTAILQ_FOREACH(dev, &dsa_bus.device_list, next) {\n+\t\tchar type[64], name[64];\n+\n+\t\tif (read_wq_string(dev, \"type\", type, sizeof(type)) < 0 ||\n+\t\t\t\tread_wq_string(dev, \"name\", name, sizeof(name)) < 0)\n+\t\t\tcontinue;\n+\n+\t\tif (strncmp(type, \"user\", 4) == 0 && is_for_this_process_use(name)) {\n+\t\t\tdev->device.driver = &dsa_bus.driver;\n+\t\t\tidxd_rawdev_probe_dsa(dev);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tIOAT_PMD_DEBUG(\"WQ '%s', not allocated to DPDK\", dev->wq_name);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+dsa_scan(void)\n+{\n+\tconst char *path = dsa_get_dev_path();\n+\tstruct dirent *wq;\n+\tDIR *dev_dir;\n+\n+\tdev_dir = opendir(path);\n+\tif (dev_dir == NULL) {\n+\t\tif (errno == ENOENT)\n+\t\t\treturn 0; /* no bus, return without error */\n+\t\tIOAT_PMD_ERR(\"%s(): opendir '%s' failed: %s\",\n+\t\t\t\t__func__, path, strerror(errno));\n+\t\treturn -1;\n+\t}\n+\n+\twhile ((wq = readdir(dev_dir)) != NULL) {\n+\t\tstruct rte_dsa_device *dev;\n+\t\tint numa_node = -1;\n+\n+\t\tif (strncmp(wq->d_name, \"wq\", 2) != 0)\n+\t\t\tcontinue;\n+\t\tif (strnlen(wq->d_name, sizeof(dev->wq_name)) == sizeof(dev->wq_name)) {\n+\t\t\tIOAT_PMD_ERR(\"%s(): wq name too long: '%s', skipping\",\n+\t\t\t\t\t__func__, wq->d_name);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tIOAT_PMD_DEBUG(\"%s(): found %s/%s\", __func__, path, wq->d_name);\n+\n+\t\tdev = malloc(sizeof(*dev));\n+\t\tif (dsa_addr_parse(wq->d_name, &dev->addr) < 0) {\n+\t\t\tIOAT_PMD_ERR(\"Error parsing WQ name: %s\", wq->d_name);\n+\t\t\tfree(dev);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tdev->device.bus = &dsa_bus.bus;\n+\t\tstrlcpy(dev->wq_name, wq->d_name, sizeof(dev->wq_name));\n+\t\tTAILQ_INSERT_TAIL(&dsa_bus.device_list, dev, next);\n+\n+\t\tread_device_int(dev, \"numa_node\", &numa_node);\n+\t\tdev->device.numa_node = numa_node;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static struct rte_device *\n+dsa_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,\n+\t\t\t const void *data)\n+{\n+\tstruct rte_dsa_device *dev = TAILQ_FIRST(&dsa_bus.device_list);\n+\n+\t/* the rte_device struct must be at start of dsa structure */\n+\tRTE_BUILD_BUG_ON(offsetof(struct rte_dsa_device, device) != 0);\n+\n+\tif (start != NULL) /* jump to start point if given */\n+\t\tdev = TAILQ_NEXT((const struct rte_dsa_device *)start, next);\n+\twhile (dev != NULL) {\n+\t\tif (cmp(&dev->device, data) == 0)\n+\t\t\treturn &dev->device;\n+\t\tdev = TAILQ_NEXT(dev, next);\n+\t}\n+\treturn NULL;\n+}\n+\n+static enum rte_iova_mode\n+dsa_get_iommu_class(void)\n+{\n+\treturn RTE_IOVA_VA;\n+}\n+\n+static int\n+dsa_addr_parse(const char *name, void *addr)\n+{\n+\tstruct dsa_wq_addr *wq = addr;\n+\tunsigned int device_id, wq_id;\n+\n+\tif (sscanf(name, \"wq%u.%u\", &device_id, &wq_id) != 2) {\n+\t\tIOAT_PMD_DEBUG(\"Parsing WQ name failed: %s\", name);\n+\t\treturn -1;\n+\t}\n+\n+\twq->device_id = device_id;\n+\twq->wq_id = wq_id;\n+\treturn 0;\n+}\n+\n+RTE_REGISTER_BUS(dsa, dsa_bus.bus);\ndiff --git a/drivers/raw/ioat/idxd_vdev.c b/drivers/raw/ioat/idxd_vdev.c\ndeleted file mode 100644\nindex 30a53b3b82..0000000000\n--- a/drivers/raw/ioat/idxd_vdev.c\n+++ /dev/null\n@@ -1,231 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2020 Intel Corporation\n- */\n-\n-#include <fcntl.h>\n-#include <unistd.h>\n-#include <limits.h>\n-#include <sys/mman.h>\n-\n-#include <rte_memzone.h>\n-#include <rte_bus_vdev.h>\n-#include <rte_kvargs.h>\n-#include <rte_string_fns.h>\n-#include <rte_rawdev_pmd.h>\n-\n-#include \"ioat_private.h\"\n-\n-/** Name of the device driver */\n-#define IDXD_PMD_RAWDEV_NAME rawdev_idxd\n-/* takes a work queue(WQ) as parameter */\n-#define IDXD_ARG_WQ\t\t\"wq\"\n-\n-static const char * const valid_args[] = {\n-\tIDXD_ARG_WQ,\n-\tNULL\n-};\n-\n-struct idxd_vdev_args {\n-\tuint8_t device_id;\n-\tuint8_t wq_id;\n-};\n-\n-static const struct rte_rawdev_ops idxd_vdev_ops = {\n-\t\t.dev_close = idxd_rawdev_close,\n-\t\t.dev_selftest = ioat_rawdev_test,\n-\t\t.dump = idxd_dev_dump,\n-\t\t.dev_configure = idxd_dev_configure,\n-\t\t.dev_info_get = idxd_dev_info_get,\n-\t\t.xstats_get = ioat_xstats_get,\n-\t\t.xstats_get_names = ioat_xstats_get_names,\n-\t\t.xstats_reset = ioat_xstats_reset,\n-};\n-\n-static void *\n-idxd_vdev_mmap_wq(struct idxd_vdev_args *args)\n-{\n-\tvoid *addr;\n-\tchar path[PATH_MAX];\n-\tint fd;\n-\n-\tsnprintf(path, sizeof(path), \"/dev/dsa/wq%u.%u\",\n-\t\t\targs->device_id, args->wq_id);\n-\tfd = open(path, O_RDWR);\n-\tif (fd < 0) {\n-\t\tIOAT_PMD_ERR(\"Failed to open device path\");\n-\t\treturn NULL;\n-\t}\n-\n-\taddr = mmap(NULL, 0x1000, PROT_WRITE, MAP_SHARED, fd, 0);\n-\tclose(fd);\n-\tif (addr == MAP_FAILED) {\n-\t\tIOAT_PMD_ERR(\"Failed to mmap device\");\n-\t\treturn NULL;\n-\t}\n-\n-\treturn addr;\n-}\n-\n-static int\n-idxd_rawdev_parse_wq(const char *key __rte_unused, const char *value,\n-\t\t\t  void *extra_args)\n-{\n-\tstruct idxd_vdev_args *args = (struct idxd_vdev_args *)extra_args;\n-\tint dev, wq, bytes = -1;\n-\tint read = sscanf(value, \"%d.%d%n\", &dev, &wq, &bytes);\n-\n-\tif (read != 2 || bytes != (int)strlen(value)) {\n-\t\tIOAT_PMD_ERR(\"Error parsing work-queue id. Must be in <dev_id>.<queue_id> format\");\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tif (dev >= UINT8_MAX || wq >= UINT8_MAX) {\n-\t\tIOAT_PMD_ERR(\"Device or work queue id out of range\");\n-\t\treturn -EINVAL;\n-\t}\n-\n-\targs->device_id = dev;\n-\targs->wq_id = wq;\n-\n-\treturn 0;\n-}\n-\n-static int\n-idxd_vdev_parse_params(struct rte_kvargs *kvlist, struct idxd_vdev_args *args)\n-{\n-\tint ret = 0;\n-\n-\tif (rte_kvargs_count(kvlist, IDXD_ARG_WQ) == 1) {\n-\t\tif (rte_kvargs_process(kvlist, IDXD_ARG_WQ,\n-\t\t\t\t&idxd_rawdev_parse_wq, args) < 0) {\n-\t\t\tIOAT_PMD_ERR(\"Error parsing %s\", IDXD_ARG_WQ);\n-\t\t\tret = -EINVAL;\n-\t\t}\n-\t} else {\n-\t\tIOAT_PMD_ERR(\"%s is a mandatory arg\", IDXD_ARG_WQ);\n-\t\tret = -EINVAL;\n-\t}\n-\n-\trte_kvargs_free(kvlist);\n-\treturn ret;\n-}\n-\n-static int\n-idxd_vdev_get_max_batches(struct idxd_vdev_args *args)\n-{\n-\tchar sysfs_path[PATH_MAX];\n-\tFILE *f;\n-\tint ret;\n-\n-\tsnprintf(sysfs_path, sizeof(sysfs_path),\n-\t\t\t\"/sys/bus/dsa/devices/wq%u.%u/size\",\n-\t\t\targs->device_id, args->wq_id);\n-\tf = fopen(sysfs_path, \"r\");\n-\tif (f == NULL)\n-\t\treturn -1;\n-\n-\tif (fscanf(f, \"%d\", &ret) != 1)\n-\t\tret = -1;\n-\n-\tfclose(f);\n-\treturn ret;\n-}\n-\n-static int\n-idxd_rawdev_probe_vdev(struct rte_vdev_device *vdev)\n-{\n-\tstruct rte_kvargs *kvlist;\n-\tstruct idxd_rawdev idxd = {{0}}; /* double {} to avoid error on BSD12 */\n-\tstruct idxd_vdev_args vdev_args;\n-\tconst char *name;\n-\tint ret = 0;\n-\n-\tname = rte_vdev_device_name(vdev);\n-\tif (name == NULL)\n-\t\treturn -EINVAL;\n-\n-\tIOAT_PMD_INFO(\"Initializing pmd_idxd for %s\", name);\n-\n-\tkvlist = rte_kvargs_parse(rte_vdev_device_args(vdev), valid_args);\n-\tif (kvlist == NULL) {\n-\t\tIOAT_PMD_ERR(\"Invalid kvargs key\");\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tret = idxd_vdev_parse_params(kvlist, &vdev_args);\n-\tif (ret) {\n-\t\tIOAT_PMD_ERR(\"Failed to parse kvargs\");\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tidxd.qid = vdev_args.wq_id;\n-\tidxd.u.vdev.dsa_id = vdev_args.device_id;\n-\tidxd.max_batches = idxd_vdev_get_max_batches(&vdev_args);\n-\n-\tidxd.public.portal = idxd_vdev_mmap_wq(&vdev_args);\n-\tif (idxd.public.portal == NULL) {\n-\t\tIOAT_PMD_ERR(\"WQ mmap failed\");\n-\t\treturn -ENOENT;\n-\t}\n-\n-\tret = idxd_rawdev_create(name, &vdev->device, &idxd, &idxd_vdev_ops);\n-\tif (ret) {\n-\t\tIOAT_PMD_ERR(\"Failed to create rawdev %s\", name);\n-\t\treturn ret;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-static int\n-idxd_rawdev_remove_vdev(struct rte_vdev_device *vdev)\n-{\n-\tstruct idxd_rawdev *idxd;\n-\tconst char *name;\n-\tstruct rte_rawdev *rdev;\n-\tint ret = 0;\n-\n-\tname = rte_vdev_device_name(vdev);\n-\tif (name == NULL)\n-\t\treturn -EINVAL;\n-\n-\tIOAT_PMD_INFO(\"Remove DSA vdev %p\", name);\n-\n-\trdev = rte_rawdev_pmd_get_named_dev(name);\n-\tif (!rdev) {\n-\t\tIOAT_PMD_ERR(\"Invalid device name (%s)\", name);\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tidxd = rdev->dev_private;\n-\n-\t/* free context and memory */\n-\tif (rdev->dev_private != NULL) {\n-\t\tIOAT_PMD_DEBUG(\"Freeing device driver memory\");\n-\t\trdev->dev_private = NULL;\n-\n-\t\tif (munmap(idxd->public.portal, 0x1000) < 0) {\n-\t\t\tIOAT_PMD_ERR(\"Error unmapping portal\");\n-\t\t\tret = -errno;\n-\t\t}\n-\n-\t\trte_free(idxd->public.batch_ring);\n-\t\trte_free(idxd->public.hdl_ring);\n-\n-\t\trte_memzone_free(idxd->mz);\n-\t}\n-\n-\tif (rte_rawdev_pmd_release(rdev))\n-\t\tIOAT_PMD_ERR(\"Device cleanup failed\");\n-\n-\treturn ret;\n-}\n-\n-struct rte_vdev_driver idxd_rawdev_drv_vdev = {\n-\t.probe = idxd_rawdev_probe_vdev,\n-\t.remove = idxd_rawdev_remove_vdev,\n-};\n-\n-RTE_PMD_REGISTER_VDEV(IDXD_PMD_RAWDEV_NAME, idxd_rawdev_drv_vdev);\n-RTE_PMD_REGISTER_PARAM_STRING(IDXD_PMD_RAWDEV_NAME,\n-\t\t\t      \"wq=<string>\");\ndiff --git a/drivers/raw/ioat/meson.build b/drivers/raw/ioat/meson.build\nindex 3b8ea65398..6382a826e7 100644\n--- a/drivers/raw/ioat/meson.build\n+++ b/drivers/raw/ioat/meson.build\n@@ -4,13 +4,13 @@\n build = dpdk_conf.has('RTE_ARCH_X86')\n reason = 'only supported on x86'\n sources = files(\n+        'idxd_bus.c',\n         'idxd_pci.c',\n-        'idxd_vdev.c',\n         'ioat_common.c',\n         'ioat_rawdev.c',\n         'ioat_rawdev_test.c',\n )\n-deps += ['bus_pci', 'bus_vdev', 'mbuf', 'rawdev']\n+deps += ['bus_pci', 'mbuf', 'rawdev']\n headers = files(\n         'rte_ioat_rawdev.h',\n         'rte_ioat_rawdev_fns.h',\n",
    "prefixes": [
        "v4",
        "08/12"
    ]
}