get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 94692,
    "url": "https://patches.dpdk.org/api/patches/94692/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210623150014.1015484-5-wenwux.ma@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20210623150014.1015484-5-wenwux.ma@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210623150014.1015484-5-wenwux.ma@intel.com",
    "date": "2021-06-23T15:00:14",
    "name": "[v3,4/4] examples/vhost: support vhost async dequeue data path",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e68f88307400fedc5f8813228df7debe8c0062f0",
    "submitter": {
        "id": 2163,
        "url": "https://patches.dpdk.org/api/people/2163/?format=api",
        "name": "Ma, WenwuX",
        "email": "wenwux.ma@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210623150014.1015484-5-wenwux.ma@intel.com/mbox/",
    "series": [
        {
            "id": 17447,
            "url": "https://patches.dpdk.org/api/series/17447/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17447",
            "date": "2021-06-23T15:00:10",
            "name": "vhost: support async dequeue for split ring",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/17447/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/94692/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/94692/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 699A6A0C41;\n\tWed, 23 Jun 2021 05:07:34 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 01D7F410EE;\n\tWed, 23 Jun 2021 05:07:24 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id 1832140687\n for <dev@dpdk.org>; Wed, 23 Jun 2021 05:07:11 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 22 Jun 2021 20:07:11 -0700",
            "from unknown (HELO localhost.localdomain) ([10.240.183.109])\n by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 22 Jun 2021 20:07:09 -0700"
        ],
        "IronPort-SDR": [
            "\n QuVjmBZ02HW9plCnoym0zyqFwlMRj922QXV1+Mw4gn1+CEiU1OXR9uHT9amCwFicm2gx3YUJlo\n 387GjvvB0D3A==",
            "\n Qn2Z8V+3CsHJkBiLo6zGLuu7ZdzbBCibCcJJn9S20aNs8FwLkiFPEREBvzHVY9xM76sbagDx/B\n xHV9mPBKVsnQ=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10023\"; a=\"268322052\"",
            "E=Sophos;i=\"5.83,293,1616482800\"; d=\"scan'208\";a=\"268322052\"",
            "E=Sophos;i=\"5.83,293,1616482800\"; d=\"scan'208\";a=\"487141356\""
        ],
        "From": "Wenwu Ma <wenwux.ma@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "maxime.coquelin@redhat.com, chenbo.xia@intel.com, cheng1.jiang@intel.com,\n Wenwu Ma <wenwux.ma@intel.com>",
        "Date": "Wed, 23 Jun 2021 15:00:14 +0000",
        "Message-Id": "<20210623150014.1015484-5-wenwux.ma@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210623150014.1015484-1-wenwux.ma@intel.com>",
        "References": "<20210602083110.5530-1-yuanx.wang@intel.com>\n <20210623150014.1015484-1-wenwux.ma@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 4/4] examples/vhost: support vhost async\n dequeue data path",
        "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 is to add vhost async dequeue data-path in vhost sample.\nvswitch can leverage IOAT to accelerate vhost async dequeue data-path.\n\nSigned-off-by: Wenwu Ma <wenwux.ma@intel.com>\n---\n doc/guides/sample_app_ug/vhost.rst |   9 +-\n examples/vhost/ioat.c              |  61 ++++++++++---\n examples/vhost/ioat.h              |  25 ++++++\n examples/vhost/main.c              | 140 ++++++++++++++++++++---------\n 4 files changed, 177 insertions(+), 58 deletions(-)",
    "diff": "diff --git a/doc/guides/sample_app_ug/vhost.rst b/doc/guides/sample_app_ug/vhost.rst\nindex 9afde9c7f5..63dcf181e1 100644\n--- a/doc/guides/sample_app_ug/vhost.rst\n+++ b/doc/guides/sample_app_ug/vhost.rst\n@@ -169,9 +169,12 @@ demonstrates how to use the async vhost APIs. It's used in combination with dmas\n **--dmas**\n This parameter is used to specify the assigned DMA device of a vhost device.\n Async vhost-user net driver will be used if --dmas is set. For example\n---dmas [txd0@00:04.0,txd1@00:04.1] means use DMA channel 00:04.0 for vhost\n-device 0 enqueue operation and use DMA channel 00:04.1 for vhost device 1\n-enqueue operation.\n+--dmas [txd0@00:04.0,txd1@00:04.1,rxd0@00:04.2,rxd1@00:04.3] means use\n+DMA channel 00:04.0/00:04.2 for vhost device 0 enqueue/dequeue operation\n+and use DMA channel 00:04.1/00:04.3 for vhost device 1 enqueue/dequeue\n+operation. The index of the device corresponds to the socket file in order,\n+that means vhost device 0 is created through the first socket file, vhost\n+device 1 is created through the second socket file, and so on.\n \n Common Issues\n -------------\ndiff --git a/examples/vhost/ioat.c b/examples/vhost/ioat.c\nindex bf4e033bdb..a305100b47 100644\n--- a/examples/vhost/ioat.c\n+++ b/examples/vhost/ioat.c\n@@ -21,6 +21,8 @@ struct packet_tracker {\n \n struct packet_tracker cb_tracker[MAX_VHOST_DEVICE];\n \n+int vid2socketid[MAX_VHOST_DEVICE];\n+\n int\n open_ioat(const char *value)\n {\n@@ -29,7 +31,7 @@ open_ioat(const char *value)\n \tchar *addrs = input;\n \tchar *ptrs[2];\n \tchar *start, *end, *substr;\n-\tint64_t vid, vring_id;\n+\tint64_t socketid, vring_id;\n \tstruct rte_ioat_rawdev_config config;\n \tstruct rte_rawdev_info info = { .dev_private = &config };\n \tchar name[32];\n@@ -60,6 +62,8 @@ open_ioat(const char *value)\n \t\tgoto out;\n \t}\n \twhile (i < args_nr) {\n+\t\tchar *txd, *rxd;\n+\t\tbool is_txd;\n \t\tchar *arg_temp = dma_arg[i];\n \t\tuint8_t sub_nr;\n \t\tsub_nr = rte_strsplit(arg_temp, strlen(arg_temp), ptrs, 2, '@');\n@@ -68,27 +72,38 @@ open_ioat(const char *value)\n \t\t\tgoto out;\n \t\t}\n \n-\t\tstart = strstr(ptrs[0], \"txd\");\n-\t\tif (start == NULL) {\n+\t\tint async_flag;\n+\t\ttxd = strstr(ptrs[0], \"txd\");\n+\t\trxd = strstr(ptrs[0], \"rxd\");\n+\t\tif (txd == NULL && rxd == NULL) {\n \t\t\tret = -1;\n \t\t\tgoto out;\n+\t\t} else if (txd) {\n+\t\t\tis_txd = true;\n+\t\t\tstart = txd;\n+\t\t\tasync_flag = ASYNC_RX_VHOST;\n+\t\t} else {\n+\t\t\tis_txd = false;\n+\t\t\tstart = rxd;\n+\t\t\tasync_flag = ASYNC_TX_VHOST;\n \t\t}\n \n \t\tstart += 3;\n-\t\tvid = strtol(start, &end, 0);\n+\t\tsocketid = strtol(start, &end, 0);\n \t\tif (end == start) {\n \t\t\tret = -1;\n \t\t\tgoto out;\n \t\t}\n \n-\t\tvring_id = 0 + VIRTIO_RXQ;\n+\t\tvring_id = is_txd ? VIRTIO_RXQ : VIRTIO_TXQ;\n+\n \t\tif (rte_pci_addr_parse(ptrs[1],\n-\t\t\t\t&(dma_info + vid)->dmas[vring_id].addr) < 0) {\n+\t\t\t&(dma_info + socketid)->dmas[vring_id].addr) < 0) {\n \t\t\tret = -1;\n \t\t\tgoto out;\n \t\t}\n \n-\t\trte_pci_device_name(&(dma_info + vid)->dmas[vring_id].addr,\n+\t\trte_pci_device_name(&(dma_info + socketid)->dmas[vring_id].addr,\n \t\t\t\tname, sizeof(name));\n \t\tdev_id = rte_rawdev_get_dev_id(name);\n \t\tif (dev_id == (uint16_t)(-ENODEV) ||\n@@ -103,8 +118,9 @@ open_ioat(const char *value)\n \t\t\tgoto out;\n \t\t}\n \n-\t\t(dma_info + vid)->dmas[vring_id].dev_id = dev_id;\n-\t\t(dma_info + vid)->dmas[vring_id].is_valid = true;\n+\t\t(dma_info + socketid)->dmas[vring_id].dev_id = dev_id;\n+\t\t(dma_info + socketid)->dmas[vring_id].is_valid = true;\n+\t\t(dma_info + socketid)->async_flag |= async_flag;\n \t\tconfig.ring_size = IOAT_RING_SIZE;\n \t\tconfig.hdls_disable = true;\n \t\tif (rte_rawdev_configure(dev_id, &info, sizeof(config)) < 0) {\n@@ -126,13 +142,16 @@ ioat_transfer_data_cb(int vid, uint16_t queue_id,\n \t\tstruct rte_vhost_async_status *opaque_data, uint16_t count)\n {\n \tuint32_t i_desc;\n-\tuint16_t dev_id = dma_bind[vid].dmas[queue_id * 2 + VIRTIO_RXQ].dev_id;\n \tstruct rte_vhost_iov_iter *src = NULL;\n \tstruct rte_vhost_iov_iter *dst = NULL;\n \tunsigned long i_seg;\n \tunsigned short mask = MAX_ENQUEUED_SIZE - 1;\n-\tunsigned short write = cb_tracker[dev_id].next_write;\n \n+\tif (queue_id >= MAX_RING_COUNT)\n+\t\treturn -1;\n+\n+\tuint16_t dev_id = dma_bind[vid2socketid[vid]].dmas[queue_id].dev_id;\n+\tunsigned short write = cb_tracker[dev_id].next_write;\n \tif (!opaque_data) {\n \t\tfor (i_desc = 0; i_desc < count; i_desc++) {\n \t\t\tsrc = descs[i_desc].src;\n@@ -170,16 +189,16 @@ ioat_check_completed_copies_cb(int vid, uint16_t queue_id,\n \t\tstruct rte_vhost_async_status *opaque_data,\n \t\tuint16_t max_packets)\n {\n-\tif (!opaque_data) {\n+\tif (!opaque_data && (queue_id < MAX_RING_COUNT)) {\n \t\tuintptr_t dump[255];\n \t\tint n_seg;\n \t\tunsigned short read, write;\n \t\tunsigned short nb_packet = 0;\n \t\tunsigned short mask = MAX_ENQUEUED_SIZE - 1;\n \t\tunsigned short i;\n+\t\tuint16_t dev_id;\n \n-\t\tuint16_t dev_id = dma_bind[vid].dmas[queue_id * 2\n-\t\t\t\t+ VIRTIO_RXQ].dev_id;\n+\t\tdev_id = dma_bind[vid2socketid[vid]].dmas[queue_id].dev_id;\n \t\tn_seg = rte_ioat_completed_ops(dev_id, 255, NULL, NULL, dump, dump);\n \t\tif (n_seg < 0) {\n \t\t\tRTE_LOG(ERR,\n@@ -215,4 +234,18 @@ ioat_check_completed_copies_cb(int vid, uint16_t queue_id,\n \treturn -1;\n }\n \n+uint32_t get_async_flag_by_vid(int vid)\n+{\n+\treturn dma_bind[vid2socketid[vid]].async_flag;\n+}\n+\n+uint32_t get_async_flag_by_socketid(int socketid)\n+{\n+\treturn dma_bind[socketid].async_flag;\n+}\n+\n+void init_vid2socketid_array(int vid, int socketid)\n+{\n+\tvid2socketid[vid] = socketid;\n+}\n #endif /* RTE_RAW_IOAT */\ndiff --git a/examples/vhost/ioat.h b/examples/vhost/ioat.h\nindex 1aa28ed6a3..51111d65af 100644\n--- a/examples/vhost/ioat.h\n+++ b/examples/vhost/ioat.h\n@@ -12,6 +12,9 @@\n #define MAX_VHOST_DEVICE 1024\n #define IOAT_RING_SIZE 4096\n #define MAX_ENQUEUED_SIZE 4096\n+#define MAX_RING_COUNT\t2\n+#define ASYNC_RX_VHOST\t1\n+#define ASYNC_TX_VHOST\t2\n \n struct dma_info {\n \tstruct rte_pci_addr addr;\n@@ -20,6 +23,7 @@ struct dma_info {\n };\n \n struct dma_for_vhost {\n+\tint async_flag;\n \tstruct dma_info dmas[RTE_MAX_QUEUES_PER_PORT * 2];\n \tuint16_t nr;\n };\n@@ -36,6 +40,10 @@ uint32_t\n ioat_check_completed_copies_cb(int vid, uint16_t queue_id,\n \t\tstruct rte_vhost_async_status *opaque_data,\n \t\tuint16_t max_packets);\n+\n+uint32_t get_async_flag_by_vid(int vid);\n+uint32_t get_async_flag_by_socketid(int socketid);\n+void init_vid2socketid_array(int vid, int socketid);\n #else\n static int open_ioat(const char *value __rte_unused)\n {\n@@ -59,5 +67,22 @@ ioat_check_completed_copies_cb(int vid __rte_unused,\n {\n \treturn -1;\n }\n+\n+static uint32_t\n+get_async_flag_by_vid(int vid __rte_unused)\n+{\n+\treturn 0;\n+}\n+\n+static uint32_t\n+get_async_flag_by_socketid(int socketid __rte_unused)\n+{\n+\treturn 0;\n+}\n+\n+static void\n+init_vid2socketid_array(int vid __rte_unused, int socketid __rte_unused)\n+{\n+}\n #endif\n #endif /* _IOAT_H_ */\ndiff --git a/examples/vhost/main.c b/examples/vhost/main.c\nindex aebdc3a566..81d7e4cbd3 100644\n--- a/examples/vhost/main.c\n+++ b/examples/vhost/main.c\n@@ -93,8 +93,6 @@ static int client_mode;\n \n static int builtin_net_driver;\n \n-static int async_vhost_driver;\n-\n static char *dma_type;\n \n /* Specify timeout (in useconds) between retries on RX. */\n@@ -679,7 +677,6 @@ us_vhost_parse_args(int argc, char **argv)\n \t\t\t\tus_vhost_usage(prgname);\n \t\t\t\treturn -1;\n \t\t\t}\n-\t\t\tasync_vhost_driver = 1;\n \t\t\tbreak;\n \n \t\tcase OPT_CLIENT_NUM:\n@@ -897,7 +894,7 @@ drain_vhost(struct vhost_dev *vdev)\n \t\t\t\t__ATOMIC_SEQ_CST);\n \t}\n \n-\tif (!async_vhost_driver)\n+\tif ((get_async_flag_by_vid(vdev->vid) & ASYNC_RX_VHOST) == 0)\n \t\tfree_pkts(m, nr_xmit);\n }\n \n@@ -1237,10 +1234,19 @@ drain_eth_rx(struct vhost_dev *vdev)\n \t\t\t\t__ATOMIC_SEQ_CST);\n \t}\n \n-\tif (!async_vhost_driver)\n+\tif ((get_async_flag_by_vid(vdev->vid) & ASYNC_RX_VHOST) == 0)\n \t\tfree_pkts(pkts, rx_count);\n }\n \n+uint16_t async_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id,\n+\t\t\t\tstruct rte_mempool *mbuf_pool,\n+\t\t\t\tstruct rte_mbuf **pkts, uint16_t count)\n+{\n+\tint nr_inflight;\n+\treturn rte_vhost_async_try_dequeue_burst(dev->vid, queue_id,\n+\t\t\tmbuf_pool, pkts, count, &nr_inflight);\n+}\n+\n uint16_t sync_dequeue_pkts(struct vhost_dev *dev, uint16_t queue_id,\n \t\t\tstruct rte_mempool *mbuf_pool,\n \t\t\tstruct rte_mbuf **pkts, uint16_t count)\n@@ -1392,12 +1398,90 @@ destroy_device(int vid)\n \t\t\"(%d) device has been removed from data core\\n\",\n \t\tvdev->vid);\n \n-\tif (async_vhost_driver)\n+\tif (get_async_flag_by_vid(vid) & ASYNC_RX_VHOST)\n \t\trte_vhost_async_channel_unregister(vid, VIRTIO_RXQ);\n+\tif (get_async_flag_by_vid(vid) & ASYNC_TX_VHOST)\n+\t\trte_vhost_async_channel_unregister(vid, VIRTIO_TXQ);\n \n \trte_free(vdev);\n }\n \n+static int\n+get_socketid_by_vid(int vid)\n+{\n+\tint i;\n+\tchar ifname[PATH_MAX];\n+\trte_vhost_get_ifname(vid, ifname, sizeof(ifname));\n+\n+\tfor (i = 0; i < nb_sockets; i++) {\n+\t\tchar *file = socket_files + i * PATH_MAX;\n+\t\tif (strcmp(file, ifname) == 0)\n+\t\t\treturn i;\n+\t}\n+\n+\treturn -1;\n+}\n+\n+static int\n+init_vhost_queue_ops(int vid)\n+{\n+\tint socketid = get_socketid_by_vid(vid);\n+\tif (socketid == -1)\n+\t\treturn -1;\n+\n+\tinit_vid2socketid_array(vid, socketid);\n+\tif (builtin_net_driver) {\n+\t\tvdev_queue_ops[vid].enqueue_pkt_burst = builtin_enqueue_pkts;\n+\t\tvdev_queue_ops[vid].dequeue_pkt_burst = builtin_dequeue_pkts;\n+\t} else {\n+\t\tif (get_async_flag_by_vid(vid) & ASYNC_RX_VHOST) {\n+\t\t\tvdev_queue_ops[vid].enqueue_pkt_burst =\n+\t\t\t\t\t\tasync_enqueue_pkts;\n+\t\t} else {\n+\t\t\tvdev_queue_ops[vid].enqueue_pkt_burst =\n+\t\t\t\t\t\tsync_enqueue_pkts;\n+\t\t}\n+\n+\t\tif (get_async_flag_by_vid(vid) & ASYNC_TX_VHOST) {\n+\t\t\tvdev_queue_ops[vid].dequeue_pkt_burst =\n+\t\t\t\t\t\tasync_dequeue_pkts;\n+\t\t} else {\n+\t\t\tvdev_queue_ops[vid].dequeue_pkt_burst =\n+\t\t\t\t\t\tsync_dequeue_pkts;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+vhost_async_channel_register(int vid)\n+{\n+\tint ret = 0;\n+\tstruct rte_vhost_async_features f;\n+\tstruct rte_vhost_async_channel_ops channel_ops;\n+\n+\tif (dma_type != NULL && strncmp(dma_type, \"ioat\", 4) == 0) {\n+\t\tchannel_ops.transfer_data = ioat_transfer_data_cb;\n+\t\tchannel_ops.check_completed_copies =\n+\t\t\tioat_check_completed_copies_cb;\n+\n+\t\tf.async_inorder = 1;\n+\t\tf.async_threshold = 256;\n+\n+\t\tif (get_async_flag_by_vid(vid) & ASYNC_RX_VHOST) {\n+\t\t\tret |= rte_vhost_async_channel_register(vid, VIRTIO_RXQ,\n+\t\t\t\t\tf.intval, &channel_ops);\n+\t\t}\n+\t\tif (get_async_flag_by_vid(vid) & ASYNC_TX_VHOST) {\n+\t\t\tret |= rte_vhost_async_channel_register(vid, VIRTIO_TXQ,\n+\t\t\t\t\tf.intval, &channel_ops);\n+\t\t}\n+\t}\n+\n+\treturn ret;\n+}\n+\n /*\n  * A new device is added to a data core. First the device is added to the main linked list\n  * and then allocated to a specific data core.\n@@ -1431,20 +1515,8 @@ new_device(int vid)\n \t\t}\n \t}\n \n-\tif (builtin_net_driver) {\n-\t\tvdev_queue_ops[vid].enqueue_pkt_burst = builtin_enqueue_pkts;\n-\t\tvdev_queue_ops[vid].dequeue_pkt_burst = builtin_dequeue_pkts;\n-\t} else {\n-\t\tif (async_vhost_driver) {\n-\t\t\tvdev_queue_ops[vid].enqueue_pkt_burst =\n-\t\t\t\t\t\t\tasync_enqueue_pkts;\n-\t\t} else {\n-\t\t\tvdev_queue_ops[vid].enqueue_pkt_burst =\n-\t\t\t\t\t\t\tsync_enqueue_pkts;\n-\t\t}\n-\n-\t\tvdev_queue_ops[vid].dequeue_pkt_burst = sync_dequeue_pkts;\n-\t}\n+\tif (init_vhost_queue_ops(vid) != 0)\n+\t\treturn -1;\n \n \tif (builtin_net_driver)\n \t\tvs_vhost_net_setup(vdev);\n@@ -1473,28 +1545,13 @@ new_device(int vid)\n \trte_vhost_enable_guest_notification(vid, VIRTIO_RXQ, 0);\n \trte_vhost_enable_guest_notification(vid, VIRTIO_TXQ, 0);\n \n+\tint ret = vhost_async_channel_register(vid);\n+\n \tRTE_LOG(INFO, VHOST_DATA,\n \t\t\"(%d) device has been added to data core %d\\n\",\n \t\tvid, vdev->coreid);\n \n-\tif (async_vhost_driver) {\n-\t\tstruct rte_vhost_async_features f;\n-\t\tstruct rte_vhost_async_channel_ops channel_ops;\n-\n-\t\tif (dma_type != NULL && strncmp(dma_type, \"ioat\", 4) == 0) {\n-\t\t\tchannel_ops.transfer_data = ioat_transfer_data_cb;\n-\t\t\tchannel_ops.check_completed_copies =\n-\t\t\t\tioat_check_completed_copies_cb;\n-\n-\t\t\tf.async_inorder = 1;\n-\t\t\tf.async_threshold = 256;\n-\n-\t\t\treturn rte_vhost_async_channel_register(vid, VIRTIO_RXQ,\n-\t\t\t\tf.intval, &channel_ops);\n-\t\t}\n-\t}\n-\n-\treturn 0;\n+\treturn ret;\n }\n \n /*\n@@ -1735,10 +1792,11 @@ main(int argc, char *argv[])\n \tfor (i = 0; i < nb_sockets; i++) {\n \t\tchar *file = socket_files + i * PATH_MAX;\n \n-\t\tif (async_vhost_driver)\n-\t\t\tflags = flags | RTE_VHOST_USER_ASYNC_COPY;\n+\t\tuint64_t flag = flags;\n+\t\tif (get_async_flag_by_socketid(i) != 0)\n+\t\t\tflag |= RTE_VHOST_USER_ASYNC_COPY;\n \n-\t\tret = rte_vhost_driver_register(file, flags);\n+\t\tret = rte_vhost_driver_register(file, flag);\n \t\tif (ret != 0) {\n \t\t\tunregister_drivers(i);\n \t\t\trte_exit(EXIT_FAILURE,\n",
    "prefixes": [
        "v3",
        "4/4"
    ]
}