get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 98667,
    "url": "http://patches.dpdk.org/api/patches/98667/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210910172737.2561156-5-kevin.laatz@intel.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": "<20210910172737.2561156-5-kevin.laatz@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210910172737.2561156-5-kevin.laatz@intel.com",
    "date": "2021-09-10T17:27:35",
    "name": "[4/6] examples/ioat: port application to dmadev APIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d65b01a2bb3f678ce785d7056624cb14f033530a",
    "submitter": {
        "id": 921,
        "url": "http://patches.dpdk.org/api/people/921/?format=api",
        "name": "Kevin Laatz",
        "email": "kevin.laatz@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210910172737.2561156-5-kevin.laatz@intel.com/mbox/",
    "series": [
        {
            "id": 18845,
            "url": "http://patches.dpdk.org/api/series/18845/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=18845",
            "date": "2021-09-10T17:27:31",
            "name": "port ioatfwd app to dmadev",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/18845/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/98667/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/98667/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 7CEA0A0547;\n\tFri, 10 Sep 2021 19:28:09 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 57DE84114A;\n\tFri, 10 Sep 2021 19:27:51 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id CBFD44113C\n for <dev@dpdk.org>; Fri, 10 Sep 2021 19:27:48 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Sep 2021 10:27:48 -0700",
            "from silpixa00401122.ir.intel.com ([10.55.128.10])\n by fmsmga006.fm.intel.com with ESMTP; 10 Sep 2021 10:27:46 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10103\"; a=\"208363270\"",
            "E=Sophos;i=\"5.85,283,1624345200\"; d=\"scan'208\";a=\"208363270\"",
            "E=Sophos;i=\"5.85,283,1624345200\"; d=\"scan'208\";a=\"694959606\""
        ],
        "X-ExtLoop1": "1",
        "From": "Kevin Laatz <kevin.laatz@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "bruce.richardson@intel.com, fengchengwen@huawei.com,\n conor.walsh@intel.com,\n Kevin Laatz <kevin.laatz@intel.com>",
        "Date": "Fri, 10 Sep 2021 17:27:35 +0000",
        "Message-Id": "<20210910172737.2561156-5-kevin.laatz@intel.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20210910172737.2561156-1-kevin.laatz@intel.com>",
        "References": "<20210910172737.2561156-1-kevin.laatz@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 4/6] examples/ioat: port application to dmadev\n APIs",
        "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": "The dmadev library abstraction allows applications to use the same APIs for\nall DMA device drivers in DPDK. This patch updates the ioatfwd application\nto make use of the new dmadev APIs, in turn making it a generic application\nwhich can be used with any of the DMA device drivers.\n\nSigned-off-by: Kevin Laatz <kevin.laatz@intel.com>\n---\n examples/ioat/ioatfwd.c   | 240 +++++++++++++++++---------------------\n examples/ioat/meson.build |   8 +-\n 2 files changed, 106 insertions(+), 142 deletions(-)",
    "diff": "diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c\nindex 4cbcee6ac2..610cb1a5cb 100644\n--- a/examples/ioat/ioatfwd.c\n+++ b/examples/ioat/ioatfwd.c\n@@ -1,5 +1,5 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2019 Intel Corporation\n+ * Copyright(c) 2019-2021 Intel Corporation\n  */\n \n #include <stdint.h>\n@@ -10,11 +10,10 @@\n \n #include <rte_malloc.h>\n #include <rte_ethdev.h>\n-#include <rte_rawdev.h>\n-#include <rte_ioat_rawdev.h>\n+#include <rte_dmadev.h>\n \n /* size of ring used for software copying between rx and tx. */\n-#define RTE_LOGTYPE_IOAT RTE_LOGTYPE_USER1\n+#define RTE_LOGTYPE_DMA RTE_LOGTYPE_USER1\n #define MAX_PKT_BURST 32\n #define MEMPOOL_CACHE_SIZE 512\n #define MIN_POOL_SIZE 65536U\n@@ -40,8 +39,8 @@ struct rxtx_port_config {\n \tuint16_t nb_queues;\n \t/* for software copy mode */\n \tstruct rte_ring *rx_to_tx_ring;\n-\t/* for IOAT rawdev copy mode */\n-\tuint16_t ioat_ids[MAX_RX_QUEUES_COUNT];\n+\t/* for dmadev HW copy mode */\n+\tuint16_t dmadev_ids[MAX_RX_QUEUES_COUNT];\n };\n \n /* Configuring ports and number of assigned lcores in struct. 8< */\n@@ -60,13 +59,13 @@ struct ioat_port_statistics {\n \tuint64_t copy_dropped[RTE_MAX_ETHPORTS];\n };\n struct ioat_port_statistics port_statistics;\n-\n struct total_statistics {\n \tuint64_t total_packets_dropped;\n \tuint64_t total_packets_tx;\n \tuint64_t total_packets_rx;\n-\tuint64_t total_successful_enqueues;\n-\tuint64_t total_failed_enqueues;\n+\tuint64_t total_submitted;\n+\tuint64_t total_completed;\n+\tuint64_t total_failed;\n };\n \n typedef enum copy_mode_t {\n@@ -95,6 +94,17 @@ static copy_mode_t copy_mode = COPY_MODE_IOAT_NUM;\n  */\n static unsigned short ring_size = 2048;\n \n+/* global mbuf arrays for tracking DMA bufs */\n+#define MBUF_RING_SIZE\t1024\n+#define MBUF_RING_MASK\t(MBUF_RING_SIZE - 1)\n+#define MAX_DEVS\t\t64\t/* 64 is max number of DSA WQ's */\n+struct dma_bufs {\n+\tstruct rte_mbuf *bufs[MBUF_RING_SIZE];\n+\tstruct rte_mbuf *copies[MBUF_RING_SIZE];\n+\tuint16_t sent;\n+};\n+static struct dma_bufs dma_bufs[MAX_DEVS];\n+\n /* global transmission config */\n struct rxtx_transmission_config cfg;\n \n@@ -131,36 +141,32 @@ print_port_stats(uint16_t port_id)\n \n /* Print out statistics for one IOAT rawdev device. */\n static void\n-print_rawdev_stats(uint32_t dev_id, uint64_t *xstats,\n-\tunsigned int *ids_xstats, uint16_t nb_xstats,\n-\tstruct rte_rawdev_xstats_name *names_xstats)\n+print_dmadev_stats(uint32_t dev_id, struct rte_dmadev_stats stats)\n {\n-\tuint16_t i;\n-\n-\tprintf(\"\\nIOAT channel %u\", dev_id);\n-\tfor (i = 0; i < nb_xstats; i++)\n-\t\tprintf(\"\\n\\t %s: %*\"PRIu64,\n-\t\t\tnames_xstats[ids_xstats[i]].name,\n-\t\t\t(int)(37 - strlen(names_xstats[ids_xstats[i]].name)),\n-\t\t\txstats[i]);\n+\tprintf(\"\\nDMA channel %u\", dev_id);\n+\tprintf(\"\\n\\t Total submitted ops: %lu\", stats.submitted);\n+\tprintf(\"\\n\\t Total completed ops: %lu\", stats.completed);\n+\tprintf(\"\\n\\t Total failed ops: %lu\", stats.errors);\n }\n \n static void\n print_total_stats(struct total_statistics *ts)\n {\n \tprintf(\"\\nAggregate statistics ===============================\"\n-\t\t\"\\nTotal packets Tx: %24\"PRIu64\" [pps]\"\n-\t\t\"\\nTotal packets Rx: %24\"PRIu64\" [pps]\"\n-\t\t\"\\nTotal packets dropped: %19\"PRIu64\" [pps]\",\n+\t\t\"\\nTotal packets Tx: %22\"PRIu64\" [pkt/s]\"\n+\t\t\"\\nTotal packets Rx: %22\"PRIu64\" [pkt/s]\"\n+\t\t\"\\nTotal packets dropped: %17\"PRIu64\" [pkt/s]\",\n \t\tts->total_packets_tx,\n \t\tts->total_packets_rx,\n \t\tts->total_packets_dropped);\n \n \tif (copy_mode == COPY_MODE_IOAT_NUM) {\n-\t\tprintf(\"\\nTotal IOAT successful enqueues: %8\"PRIu64\" [enq/s]\"\n-\t\t\t\"\\nTotal IOAT failed enqueues: %12\"PRIu64\" [enq/s]\",\n-\t\t\tts->total_successful_enqueues,\n-\t\t\tts->total_failed_enqueues);\n+\t\tprintf(\"\\nTotal submitted ops: %19\"PRIu64\" [ops/s]\"\n+\t\t\t\"\\nTotal completed ops: %19\"PRIu64\" [ops/s]\"\n+\t\t\t\"\\nTotal failed ops: %22\"PRIu64\" [ops/s]\",\n+\t\t\tts->total_submitted,\n+\t\t\tts->total_completed,\n+\t\t\tts->total_failed);\n \t}\n \n \tprintf(\"\\n====================================================\\n\");\n@@ -171,13 +177,10 @@ static void\n print_stats(char *prgname)\n {\n \tstruct total_statistics ts, delta_ts;\n+\tstruct rte_dmadev_stats stats = {0};\n \tuint32_t i, port_id, dev_id;\n-\tstruct rte_rawdev_xstats_name *names_xstats;\n-\tuint64_t *xstats;\n-\tunsigned int *ids_xstats, nb_xstats;\n \tchar status_string[255]; /* to print at the top of the output */\n \tint status_strlen;\n-\tint ret;\n \n \tconst char clr[] = { 27, '[', '2', 'J', '\\0' };\n \tconst char topLeft[] = { 27, '[', '1', ';', '1', 'H', '\\0' };\n@@ -203,48 +206,6 @@ print_stats(char *prgname)\n \t\tsizeof(status_string) - status_strlen,\n \t\t\"Ring Size = %d\", ring_size);\n \n-\t/* Allocate memory for xstats names and values */\n-\tret = rte_rawdev_xstats_names_get(\n-\t\tcfg.ports[0].ioat_ids[0], NULL, 0);\n-\tif (ret < 0)\n-\t\treturn;\n-\tnb_xstats = (unsigned int)ret;\n-\n-\tnames_xstats = malloc(sizeof(*names_xstats) * nb_xstats);\n-\tif (names_xstats == NULL) {\n-\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\"Error allocating xstat names memory\\n\");\n-\t}\n-\trte_rawdev_xstats_names_get(cfg.ports[0].ioat_ids[0],\n-\t\tnames_xstats, nb_xstats);\n-\n-\tids_xstats = malloc(sizeof(*ids_xstats) * 2);\n-\tif (ids_xstats == NULL) {\n-\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\"Error allocating xstat ids_xstats memory\\n\");\n-\t}\n-\n-\txstats = malloc(sizeof(*xstats) * 2);\n-\tif (xstats == NULL) {\n-\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\"Error allocating xstat memory\\n\");\n-\t}\n-\n-\t/* Get failed/successful enqueues stats index */\n-\tids_xstats[0] = ids_xstats[1] = nb_xstats;\n-\tfor (i = 0; i < nb_xstats; i++) {\n-\t\tif (!strcmp(names_xstats[i].name, \"failed_enqueues\"))\n-\t\t\tids_xstats[0] = i;\n-\t\telse if (!strcmp(names_xstats[i].name, \"successful_enqueues\"))\n-\t\t\tids_xstats[1] = i;\n-\t\tif (ids_xstats[0] < nb_xstats && ids_xstats[1] < nb_xstats)\n-\t\t\tbreak;\n-\t}\n-\tif (ids_xstats[0] == nb_xstats || ids_xstats[1] == nb_xstats) {\n-\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\"Error getting failed/successful enqueues stats index\\n\");\n-\t}\n-\n \tmemset(&ts, 0, sizeof(struct total_statistics));\n \n \twhile (!force_quit) {\n@@ -276,17 +237,13 @@ print_stats(char *prgname)\n \t\t\t\tuint32_t j;\n \n \t\t\t\tfor (j = 0; j < cfg.ports[i].nb_queues; j++) {\n-\t\t\t\t\tdev_id = cfg.ports[i].ioat_ids[j];\n-\t\t\t\t\trte_rawdev_xstats_get(dev_id,\n-\t\t\t\t\t\tids_xstats, xstats, 2);\n-\n-\t\t\t\t\tprint_rawdev_stats(dev_id, xstats,\n-\t\t\t\t\t\tids_xstats, 2, names_xstats);\n+\t\t\t\t\tdev_id = cfg.ports[i].dmadev_ids[j];\n+\t\t\t\t\trte_dmadev_stats_get(dev_id, 0, &stats);\n+\t\t\t\t\tprint_dmadev_stats(dev_id, stats);\n \n-\t\t\t\t\tdelta_ts.total_failed_enqueues +=\n-\t\t\t\t\t\txstats[ids_xstats[0]];\n-\t\t\t\t\tdelta_ts.total_successful_enqueues +=\n-\t\t\t\t\t\txstats[ids_xstats[1]];\n+\t\t\t\t\tdelta_ts.total_submitted += stats.submitted;\n+\t\t\t\t\tdelta_ts.total_completed += stats.completed;\n+\t\t\t\t\tdelta_ts.total_failed += stats.errors;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n@@ -294,9 +251,9 @@ print_stats(char *prgname)\n \t\tdelta_ts.total_packets_tx -= ts.total_packets_tx;\n \t\tdelta_ts.total_packets_rx -= ts.total_packets_rx;\n \t\tdelta_ts.total_packets_dropped -= ts.total_packets_dropped;\n-\t\tdelta_ts.total_failed_enqueues -= ts.total_failed_enqueues;\n-\t\tdelta_ts.total_successful_enqueues -=\n-\t\t\tts.total_successful_enqueues;\n+\t\tdelta_ts.total_submitted -= ts.total_submitted;\n+\t\tdelta_ts.total_completed -= ts.total_completed;\n+\t\tdelta_ts.total_failed -= ts.total_failed;\n \n \t\tprintf(\"\\n\");\n \t\tprint_total_stats(&delta_ts);\n@@ -306,14 +263,10 @@ print_stats(char *prgname)\n \t\tts.total_packets_tx += delta_ts.total_packets_tx;\n \t\tts.total_packets_rx += delta_ts.total_packets_rx;\n \t\tts.total_packets_dropped += delta_ts.total_packets_dropped;\n-\t\tts.total_failed_enqueues += delta_ts.total_failed_enqueues;\n-\t\tts.total_successful_enqueues +=\n-\t\t\tdelta_ts.total_successful_enqueues;\n+\t\tts.total_submitted += delta_ts.total_submitted;\n+\t\tts.total_completed += delta_ts.total_completed;\n+\t\tts.total_failed += delta_ts.total_failed;\n \t}\n-\n-\tfree(names_xstats);\n-\tfree(xstats);\n-\tfree(ids_xstats);\n }\n \n static void\n@@ -357,20 +310,22 @@ static uint32_t\n ioat_enqueue_packets(struct rte_mbuf *pkts[], struct rte_mbuf *pkts_copy[],\n \tuint32_t nb_rx, uint16_t dev_id)\n {\n+\tstruct dma_bufs *dma = &dma_bufs[dev_id];\n \tint ret;\n \tuint32_t i;\n \n \tfor (i = 0; i < nb_rx; i++) {\n \t\t/* Perform data copy */\n-\t\tret = rte_ioat_enqueue_copy(dev_id,\n+\t\tret = rte_dmadev_copy(dev_id, 0,\n \t\t\trte_pktmbuf_iova(pkts[i]),\n \t\t\trte_pktmbuf_iova(pkts_copy[i]),\n-\t\t\trte_pktmbuf_data_len(pkts[i]),\n-\t\t\t(uintptr_t)pkts[i],\n-\t\t\t(uintptr_t)pkts_copy[i]);\n+\t\t\trte_pktmbuf_data_len(pkts[i]), 0);\n \n-\t\tif (ret != 1)\n+\t\tif (ret < 0)\n \t\t\tbreak;\n+\n+\t\tdma->bufs[ret & MBUF_RING_MASK] = pkts[i];\n+\t\tdma->copies[ret & MBUF_RING_MASK] = pkts_copy[i];\n \t}\n \n \tret = i;\n@@ -390,7 +345,7 @@ ioat_enqueue(struct rte_mbuf *pkts[], struct rte_mbuf *pkts_copy[],\n \t\tn = ioat_enqueue_packets(pkts + i, pkts_copy + i, m, dev_id);\n \t\tk += n;\n \t\tif (n > 0)\n-\t\t\trte_ioat_perform_ops(dev_id);\n+\t\t\trte_dmadev_submit(dev_id, 0);\n \n \t\t/* don't try to enqueue more if HW queue is full */\n \t\tif (n != m)\n@@ -404,20 +359,27 @@ static inline uint32_t\n ioat_dequeue(struct rte_mbuf *src[], struct rte_mbuf *dst[], uint32_t num,\n \tuint16_t dev_id)\n {\n-\tint32_t rc;\n+\tstruct dma_bufs *dma = &dma_bufs[dev_id];\n+\tuint16_t nb_dq, filled;\n \t/* Dequeue the mbufs from IOAT device. Since all memory\n \t * is DPDK pinned memory and therefore all addresses should\n \t * be valid, we don't check for copy errors\n \t */\n-\trc = rte_ioat_completed_ops(dev_id, num, NULL, NULL,\n-\t\t(void *)src, (void *)dst);\n-\tif (rc < 0) {\n-\t\tRTE_LOG(CRIT, IOAT,\n-\t\t\t\"rte_ioat_completed_ops(%hu) failedi, error: %d\\n\",\n-\t\t\tdev_id, rte_errno);\n-\t\trc = 0;\n+\tnb_dq = rte_dmadev_completed(dev_id, 0, num, NULL, NULL);\n+\n+\t/* Return early if no work to do */\n+\tif (unlikely(nb_dq == 0))\n+\t\treturn nb_dq;\n+\n+\t/* Populate pkts_copy with the copies bufs from dma->copies */\n+\tfor (filled = 0; filled < nb_dq; filled++) {\n+\t\tsrc[filled] = dma->bufs[(dma->sent + filled) & MBUF_RING_MASK];\n+\t\tdst[filled] = dma->copies[(dma->sent + filled) & MBUF_RING_MASK];\n \t}\n-\treturn rc;\n+\tdma->sent += nb_dq;\n+\n+\treturn filled;\n+\n }\n \n /* Receive packets on one port and enqueue to IOAT rawdev or rte_ring. 8< */\n@@ -454,7 +416,7 @@ ioat_rx_port(struct rxtx_port_config *rx_config)\n \n \t\t\t/* enqueue packets for  hardware copy */\n \t\t\tnb_enq = ioat_enqueue(pkts_burst, pkts_burst_copy,\n-\t\t\t\tnb_rx, ioat_batch_sz, rx_config->ioat_ids[i]);\n+\t\t\t\tnb_rx, ioat_batch_sz, rx_config->dmadev_ids[i]);\n \n \t\t\t/* free any not enqueued packets. */\n \t\t\trte_mempool_put_bulk(ioat_pktmbuf_pool,\n@@ -469,7 +431,7 @@ ioat_rx_port(struct rxtx_port_config *rx_config)\n \n \t\t\t/* get completed copies */\n \t\t\tnb_rx = ioat_dequeue(pkts_burst, pkts_burst_copy,\n-\t\t\t\tMAX_PKT_BURST, rx_config->ioat_ids[i]);\n+\t\t\t\tMAX_PKT_BURST, rx_config->dmadev_ids[i]);\n \t\t} else {\n \t\t\t/* Perform packet software copy, free source packets */\n \t\t\tfor (j = 0; j < nb_rx; j++)\n@@ -536,7 +498,7 @@ rx_main_loop(void)\n \tuint16_t i;\n \tuint16_t nb_ports = cfg.nb_ports;\n \n-\tRTE_LOG(INFO, IOAT, \"Entering main rx loop for copy on lcore %u\\n\",\n+\tRTE_LOG(INFO, DMA, \"Entering main rx loop for copy on lcore %u\\n\",\n \t\trte_lcore_id());\n \n \twhile (!force_quit)\n@@ -551,7 +513,7 @@ tx_main_loop(void)\n \tuint16_t i;\n \tuint16_t nb_ports = cfg.nb_ports;\n \n-\tRTE_LOG(INFO, IOAT, \"Entering main tx loop for copy on lcore %u\\n\",\n+\tRTE_LOG(INFO, DMA, \"Entering main tx loop for copy on lcore %u\\n\",\n \t\trte_lcore_id());\n \n \twhile (!force_quit)\n@@ -566,7 +528,7 @@ rxtx_main_loop(void)\n \tuint16_t i;\n \tuint16_t nb_ports = cfg.nb_ports;\n \n-\tRTE_LOG(INFO, IOAT, \"Entering main rx and tx loop for copy on\"\n+\tRTE_LOG(INFO, DMA, \"Entering main rx and tx loop for copy on\"\n \t\t\" lcore %u\\n\", rte_lcore_id());\n \n \twhile (!force_quit)\n@@ -581,7 +543,7 @@ static void start_forwarding_cores(void)\n {\n \tuint32_t lcore_id = rte_lcore_id();\n \n-\tRTE_LOG(INFO, IOAT, \"Entering %s on lcore %u\\n\",\n+\tRTE_LOG(INFO, DMA, \"Entering %s on lcore %u\\n\",\n \t\t__func__, rte_lcore_id());\n \n \tif (cfg.nb_lcores == 1) {\n@@ -794,20 +756,28 @@ check_link_status(uint32_t port_mask)\n static void\n configure_rawdev_queue(uint32_t dev_id)\n {\n-\tstruct rte_ioat_rawdev_config dev_config = {\n-\t\t\t.ring_size = ring_size,\n-\t\t\t.no_prefetch_completions = (cfg.nb_lcores > 1),\n+\tstruct rte_dmadev_info info;\n+\tstruct rte_dmadev_conf dev_config = { .nb_vchans = 1 };\n+\tstruct rte_dmadev_vchan_conf qconf = {\n+\t\t.direction = RTE_DMA_DIR_MEM_TO_MEM,\n+\t\t.nb_desc = ring_size\n \t};\n-\tstruct rte_rawdev_info info = { .dev_private = &dev_config };\n+\tuint16_t vchan = 0;\n \n-\tif (rte_rawdev_configure(dev_id, &info, sizeof(dev_config)) != 0) {\n-\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\"Error with rte_rawdev_configure()\\n\");\n+\tif (rte_dmadev_configure(dev_id, &dev_config) != 0)\n+\t\trte_exit(EXIT_FAILURE, \"Error with rte_dmadev_configure()\\n\");\n+\n+\tif (rte_dmadev_vchan_setup(dev_id, vchan, &qconf) != 0) {\n+\t\tprintf(\"Error with queue configuration\\n\");\n+\t\trte_panic();\n \t}\n-\tif (rte_rawdev_start(dev_id) != 0) {\n-\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\"Error with rte_rawdev_start()\\n\");\n+\trte_dmadev_info_get(dev_id, &info);\n+\tif (info.nb_vchans != 1) {\n+\t\tprintf(\"Error, no configured queues reported on device id %u\\n\", dev_id);\n+\t\trte_panic();\n \t}\n+\tif (rte_dmadev_start(dev_id) != 0)\n+\t\trte_exit(EXIT_FAILURE, \"Error with rte_dmadev_start()\\n\");\n }\n /* >8 End of configuration of device. */\n \n@@ -820,18 +790,16 @@ assign_rawdevs(void)\n \n \tfor (i = 0; i < cfg.nb_ports; i++) {\n \t\tfor (j = 0; j < cfg.ports[i].nb_queues; j++) {\n-\t\t\tstruct rte_rawdev_info rdev_info = { 0 };\n+\t\t\tstruct rte_dmadev_info dmadev_info = { 0 };\n \n \t\t\tdo {\n-\t\t\t\tif (rdev_id == rte_rawdev_count())\n+\t\t\t\tif (rdev_id == rte_dmadev_count())\n \t\t\t\t\tgoto end;\n-\t\t\t\trte_rawdev_info_get(rdev_id++, &rdev_info, 0);\n-\t\t\t} while (rdev_info.driver_name == NULL ||\n-\t\t\t\t\tstrcmp(rdev_info.driver_name,\n-\t\t\t\t\t\tIOAT_PMD_RAWDEV_NAME_STR) != 0);\n+\t\t\t\trte_dmadev_info_get(rdev_id++, &dmadev_info);\n+\t\t\t} while (dmadev_info.device->driver->name == NULL);\n \n-\t\t\tcfg.ports[i].ioat_ids[j] = rdev_id - 1;\n-\t\t\tconfigure_rawdev_queue(cfg.ports[i].ioat_ids[j]);\n+\t\t\tcfg.ports[i].dmadev_ids[j] = rdev_id - 1;\n+\t\t\tconfigure_rawdev_queue(cfg.ports[i].dmadev_ids[j]);\n \t\t\t++nb_rawdev;\n \t\t}\n \t}\n@@ -840,7 +808,7 @@ assign_rawdevs(void)\n \t\trte_exit(EXIT_FAILURE,\n \t\t\t\"Not enough IOAT rawdevs (%u) for all queues (%u).\\n\",\n \t\t\tnb_rawdev, cfg.nb_ports * cfg.ports[0].nb_queues);\n-\tRTE_LOG(INFO, IOAT, \"Number of used rawdevs: %u.\\n\", nb_rawdev);\n+\tRTE_LOG(INFO, DMA, \"Number of used rawdevs: %u.\\n\", nb_rawdev);\n }\n /* >8 End of using IOAT rawdev API functions. */\n \n@@ -1089,15 +1057,15 @@ main(int argc, char **argv)\n \t\tprintf(\"Closing port %d\\n\", cfg.ports[i].rxtx_port);\n \t\tret = rte_eth_dev_stop(cfg.ports[i].rxtx_port);\n \t\tif (ret != 0)\n-\t\t\tRTE_LOG(ERR, IOAT, \"rte_eth_dev_stop: err=%s, port=%u\\n\",\n+\t\t\tRTE_LOG(ERR, DMA, \"rte_eth_dev_stop: err=%s, port=%u\\n\",\n \t\t\t\trte_strerror(-ret), cfg.ports[i].rxtx_port);\n \n \t\trte_eth_dev_close(cfg.ports[i].rxtx_port);\n \t\tif (copy_mode == COPY_MODE_IOAT_NUM) {\n \t\t\tfor (j = 0; j < cfg.ports[i].nb_queues; j++) {\n \t\t\t\tprintf(\"Stopping rawdev %d\\n\",\n-\t\t\t\t\tcfg.ports[i].ioat_ids[j]);\n-\t\t\t\trte_rawdev_stop(cfg.ports[i].ioat_ids[j]);\n+\t\t\t\t\tcfg.ports[i].dmadev_ids[j]);\n+\t\t\t\trte_dmadev_stop(cfg.ports[i].dmadev_ids[j]);\n \t\t\t}\n \t\t} else /* copy_mode == COPY_MODE_SW_NUM */\n \t\t\trte_ring_free(cfg.ports[i].rx_to_tx_ring);\ndiff --git a/examples/ioat/meson.build b/examples/ioat/meson.build\nindex 68bce1ab03..c1dd7c9b29 100644\n--- a/examples/ioat/meson.build\n+++ b/examples/ioat/meson.build\n@@ -1,5 +1,5 @@\n # SPDX-License-Identifier: BSD-3-Clause\n-# Copyright(c) 2019 Intel Corporation\n+# Copyright(c) 2019-2021 Intel Corporation\n \n # meson file, for building this example as part of a main DPDK build.\n #\n@@ -7,12 +7,8 @@\n # DPDK instance, use 'make'\n \n allow_experimental_apis = true\n-build = dpdk_conf.has('RTE_RAW_IOAT')\n-if not build\n-    subdir_done()\n-endif\n \n-deps += ['raw_ioat']\n+deps += ['dmadev']\n \n sources = files(\n         'ioatfwd.c',\n",
    "prefixes": [
        "4/6"
    ]
}