get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 134911,
    "url": "http://patches.dpdk.org/api/patches/134911/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231207115439.83247-1-schalla@marvell.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": "<20231207115439.83247-1-schalla@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231207115439.83247-1-schalla@marvell.com",
    "date": "2023-12-07T11:54:38",
    "name": "[1/2] net/virtio-user: improve kick performance with notification area mapping",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f6baf04b60c942639c1905b1836f95272ed3ea6e",
    "submitter": {
        "id": 2283,
        "url": "http://patches.dpdk.org/api/people/2283/?format=api",
        "name": "Srujana Challa",
        "email": "schalla@marvell.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20231207115439.83247-1-schalla@marvell.com/mbox/",
    "series": [
        {
            "id": 30475,
            "url": "http://patches.dpdk.org/api/series/30475/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30475",
            "date": "2023-12-07T11:54:38",
            "name": "[1/2] net/virtio-user: improve kick performance with notification area mapping",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/30475/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/134911/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/134911/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 2A39C43699;\n\tThu,  7 Dec 2023 12:55:04 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A7A4340295;\n\tThu,  7 Dec 2023 12:55:03 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id D06C74025C\n for <dev@dpdk.org>; Thu,  7 Dec 2023 12:55:02 +0100 (CET)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 3B79PGwN032040; Thu, 7 Dec 2023 03:55:01 -0800",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3uubdd8ewu-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Thu, 07 Dec 2023 03:55:00 -0800",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Thu, 7 Dec 2023 03:54:42 -0800",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Thu, 7 Dec 2023 03:54:42 -0800",
            "from localhost.localdomain (unknown [10.28.36.175])\n by maili.marvell.com (Postfix) with ESMTP id 6018E3F7051;\n Thu,  7 Dec 2023 03:54:40 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : mime-version : content-transfer-encoding :\n content-type; s=pfpt0220; bh=d5E5FkqXLBtD25s2+JCsnAhhcKeCEboJNHc+5PSvwUQ=;\n b=XcbzDdQH+tjt6H6U1UpnQIk2hSRcEnFokvY0snA+WA4GWIsU6vFz81AeYxG08pdMsKnQ\n bwMrFyldM5OyAXXqSiXfMCOaQ9I0YjJ/FeZOmTEasYINdPBtKFlsuR4KrsOtumkcCKgI\n Vr/RjRGVx21sZ+GR6tFCbV4ZrG1ac4nX/n4Q60Mm3q2fjrJTH7igM4j2rJ7XQOpNhwIQ\n oCDsHD7OPYXFW57AyDG9w3wFBTeoLjUsZAUyFcj3LH/HTfUPlaHKx5UIcF9ikTowN+Bv\n vOLSFnO2m3N+mr8kI73efVdi4DwF1NVt61atCYyARAwoFoaqNqEqZeccipQoax9kiAhH kA==",
        "From": "Srujana Challa <schalla@marvell.com>",
        "To": "<dev@dpdk.org>, <maxime.coquelin@redhat.com>, <chenbox@nvidia.com>",
        "CC": "<jerinj@marvell.com>, <vattunuru@marvell.com>",
        "Subject": "[PATCH 1/2] net/virtio-user: improve kick performance with\n notification area mapping",
        "Date": "Thu, 7 Dec 2023 17:24:38 +0530",
        "Message-ID": "<20231207115439.83247-1-schalla@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "8Gzw5rdtFL0JJwOn8XyU0OXt4WcNbkLa",
        "X-Proofpoint-GUID": "8Gzw5rdtFL0JJwOn8XyU0OXt4WcNbkLa",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2023-12-07_09,2023-12-07_01,2023-05-22_02",
        "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": "This patch introduces new virtio-user callback to map the vq\nnotification area and implements it for the vhost-vDPA backend.\nThis is simply done by using mmap()/munmap() for\nthe vhost-vDPA fd.\n\nThis patch also adds a parameter for configuring feature bit\nVIRTIO_NET_F_NOTIFICATION_DATA. If feature is disabled, also\nupdate corresponding unsupported feature bit. And also adds\ncode to write to queue notify address in notify callback.\nThis will help in increasing the kick performance.\n\nSigned-off-by: Srujana Challa <schalla@marvell.com>\n---\n doc/guides/nics/virtio.rst                    |  5 ++\n drivers/net/virtio/virtio_user/vhost.h        |  1 +\n drivers/net/virtio/virtio_user/vhost_vdpa.c   | 56 ++++++++++++++++++\n .../net/virtio/virtio_user/virtio_user_dev.c  | 52 +++++++++++++++--\n .../net/virtio/virtio_user/virtio_user_dev.h  |  5 +-\n drivers/net/virtio/virtio_user_ethdev.c       | 57 ++++++++++++++++---\n 6 files changed, 162 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/virtio.rst b/doc/guides/nics/virtio.rst\nindex c22ce56a02..11dd6359e5 100644\n--- a/doc/guides/nics/virtio.rst\n+++ b/doc/guides/nics/virtio.rst\n@@ -349,6 +349,11 @@ Below devargs are supported by the virtio-user vdev:\n     election.\n     (Default: 0 (disabled))\n \n+#.  ``notification_data``:\n+\n+    It is used to enable virtio device notification data feature.\n+    (Default: 1 (enabled))\n+\n Virtio paths Selection and Usage\n --------------------------------\n \ndiff --git a/drivers/net/virtio/virtio_user/vhost.h b/drivers/net/virtio/virtio_user/vhost.h\nindex f817cab77a..1bce00c7ac 100644\n--- a/drivers/net/virtio/virtio_user/vhost.h\n+++ b/drivers/net/virtio/virtio_user/vhost.h\n@@ -90,6 +90,7 @@ struct virtio_user_backend_ops {\n \tint (*server_disconnect)(struct virtio_user_dev *dev);\n \tint (*server_reconnect)(struct virtio_user_dev *dev);\n \tint (*get_intr_fd)(struct virtio_user_dev *dev);\n+\tint (*map_notification_area)(struct virtio_user_dev *dev, bool map);\n };\n \n extern struct virtio_user_backend_ops virtio_ops_user;\ndiff --git a/drivers/net/virtio/virtio_user/vhost_vdpa.c b/drivers/net/virtio/virtio_user/vhost_vdpa.c\nindex 2c36b26224..1eb0f9ec48 100644\n--- a/drivers/net/virtio/virtio_user/vhost_vdpa.c\n+++ b/drivers/net/virtio/virtio_user/vhost_vdpa.c\n@@ -5,6 +5,7 @@\n #include <sys/ioctl.h>\n #include <sys/types.h>\n #include <sys/stat.h>\n+#include <sys/mman.h>\n #include <fcntl.h>\n #include <stdlib.h>\n #include <unistd.h>\n@@ -622,6 +623,60 @@ vhost_vdpa_get_intr_fd(struct virtio_user_dev *dev __rte_unused)\n \treturn -1;\n }\n \n+static int\n+unmap_notification_area(struct virtio_user_dev *dev, int nr_vrings)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < nr_vrings; i++) {\n+\t\tif (dev->notify_area[i])\n+\t\t\tmunmap(dev->notify_area[i], getpagesize());\n+\t}\n+\tfree(dev->notify_area);\n+\n+\treturn 0;\n+}\n+\n+static int\n+vhost_vdpa_map_notification_area(struct virtio_user_dev *dev, bool map)\n+{\n+\tstruct vhost_vdpa_data *data = dev->backend_data;\n+\tint nr_vrings, i, page_size = getpagesize();\n+\tuint16_t **notify_area;\n+\n+\tnr_vrings = dev->max_queue_pairs * 2;\n+\tif (dev->device_features & (1ull << VIRTIO_NET_F_CTRL_VQ))\n+\t\tnr_vrings++;\n+\n+\tif (!map)\n+\t\treturn unmap_notification_area(dev, nr_vrings);\n+\n+\tnotify_area = malloc(nr_vrings * sizeof(*notify_area));\n+\tif (!notify_area) {\n+\t\tPMD_DRV_LOG(ERR, \"(%s) Failed to allocate notify area array\", dev->path);\n+\t\treturn -1;\n+\t}\n+\tfor (i = 0; i < nr_vrings; i++) {\n+\t\tnotify_area[i] = mmap(NULL, page_size, PROT_WRITE, MAP_SHARED | MAP_FILE,\n+\t\t\t\t      data->vhostfd, i * page_size);\n+\t\tif (notify_area[i] == MAP_FAILED) {\n+\t\t\tPMD_DRV_LOG(ERR, \"(%s) Map failed for notify address of queue %d\\n\",\n+\t\t\t\t    dev->path, i);\n+\t\t\tgoto map_err;\n+\t\t}\n+\t}\n+\tdev->notify_area = notify_area;\n+\n+\treturn 0;\n+\n+map_err:\n+\ti--;\n+\tfor (; i >= 0; i--)\n+\t\tmunmap(notify_area[i], page_size);\n+\tfree(notify_area);\n+\treturn -1;\n+}\n+\n struct virtio_user_backend_ops virtio_ops_vdpa = {\n \t.setup = vhost_vdpa_setup,\n \t.destroy = vhost_vdpa_destroy,\n@@ -646,4 +701,5 @@ struct virtio_user_backend_ops virtio_ops_vdpa = {\n \t.dma_unmap = vhost_vdpa_dma_unmap_batch,\n \t.update_link_state = vhost_vdpa_update_link_state,\n \t.get_intr_fd = vhost_vdpa_get_intr_fd,\n+\t.map_notification_area = vhost_vdpa_map_notification_area,\n };\ndiff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c\nindex af1f8c8237..578877d089 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c\n@@ -18,6 +18,7 @@\n #include <rte_string_fns.h>\n #include <rte_eal_memconfig.h>\n #include <rte_malloc.h>\n+#include <rte_io.h>\n \n #include \"vhost.h\"\n #include \"virtio_user_dev.h\"\n@@ -413,6 +414,12 @@ virtio_user_dev_init_notify(struct virtio_user_dev *dev)\n \t\tdev->callfds[i] = callfd;\n \t\tdev->kickfds[i] = kickfd;\n \t}\n+\tdev->notify_area_mapped = false;\n+\tif (dev->ops->map_notification_area) {\n+\t\tif (dev->ops->map_notification_area(dev, true))\n+\t\t\tgoto err;\n+\t\tdev->notify_area_mapped = true;\n+\t}\n \n \treturn 0;\n err:\n@@ -445,6 +452,11 @@ virtio_user_dev_uninit_notify(struct virtio_user_dev *dev)\n \t\t\tdev->callfds[i] = -1;\n \t\t}\n \t}\n+\tif (dev->ops->map_notification_area && dev->notify_area_mapped) {\n+\t\t/* Unmap notification area */\n+\t\tdev->ops->map_notification_area(dev, false);\n+\t\tdev->notify_area_mapped = false;\n+\t}\n }\n \n static int\n@@ -674,12 +686,14 @@ virtio_user_free_vrings(struct virtio_user_dev *dev)\n \t 1ULL << VIRTIO_NET_F_GUEST_TSO6\t|\t\\\n \t 1ULL << VIRTIO_F_IN_ORDER\t\t|\t\\\n \t 1ULL << VIRTIO_F_VERSION_1\t\t|\t\\\n-\t 1ULL << VIRTIO_F_RING_PACKED)\n+\t 1ULL << VIRTIO_F_RING_PACKED\t\t|\t\\\n+\t 1ULL << VIRTIO_F_NOTIFICATION_DATA)\n \n int\n virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues,\n \t\t     int cq, int queue_size, const char *mac, char **ifname,\n \t\t     int server, int mrg_rxbuf, int in_order, int packed_vq,\n+\t\t     int notification_data,\n \t\t     enum virtio_user_backend_type backend_type)\n {\n \tuint64_t backend_features;\n@@ -737,6 +751,9 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues,\n \tif (!packed_vq)\n \t\tdev->unsupported_features |= (1ull << VIRTIO_F_RING_PACKED);\n \n+\tif (!notification_data)\n+\t\tdev->unsupported_features |= (1ull << VIRTIO_F_NOTIFICATION_DATA);\n+\n \tif (dev->mac_specified)\n \t\tdev->frontend_features |= (1ull << VIRTIO_NET_F_MAC);\n \telse\n@@ -1039,11 +1056,35 @@ static void\n virtio_user_control_queue_notify(struct virtqueue *vq, void *cookie)\n {\n \tstruct virtio_user_dev *dev = cookie;\n-\tuint64_t buf = 1;\n+\tuint64_t notify_data = 1;\n+\n+\tif (!dev->notify_area_mapped) {\n+\t\tif (write(dev->kickfds[vq->vq_queue_index], &notify_data, sizeof(notify_data)) < 0)\n+\t\t\tPMD_DRV_LOG(ERR, \"failed to kick backend: %s\",\n+\t\t\t\t    strerror(errno));\n+\t\treturn;\n+\t} else if (!virtio_with_feature(&dev->hw, VIRTIO_F_NOTIFICATION_DATA)) {\n+\t\trte_write16(vq->vq_queue_index, vq->notify_addr);\n+\t\treturn;\n+\t}\n \n-\tif (write(dev->kickfds[vq->vq_queue_index], &buf, sizeof(buf)) < 0)\n-\t\tPMD_DRV_LOG(ERR, \"failed to kick backend: %s\",\n-\t\t\t    strerror(errno));\n+\tif (virtio_with_packed_queue(&dev->hw)) {\n+\t\t/* Bit[0:15]: vq queue index\n+\t\t * Bit[16:30]: avail index\n+\t\t * Bit[31]: avail wrap counter\n+\t\t */\n+\t\tnotify_data = ((uint32_t)(!!(vq->vq_packed.cached_flags &\n+\t\t\t\tVRING_PACKED_DESC_F_AVAIL)) << 31) |\n+\t\t\t\t((uint32_t)vq->vq_avail_idx << 16) |\n+\t\t\t\tvq->vq_queue_index;\n+\t} else {\n+\t\t/* Bit[0:15]: vq queue index\n+\t\t * Bit[16:31]: avail index\n+\t\t */\n+\t\tnotify_data = ((uint32_t)vq->vq_avail_idx << 16) |\n+\t\t\t\tvq->vq_queue_index;\n+\t}\n+\trte_write32(notify_data, vq->notify_addr);\n }\n \n int\n@@ -1062,6 +1103,7 @@ virtio_user_dev_create_shadow_cvq(struct virtio_user_dev *dev, struct virtqueue\n \n \tscvq->cq.notify_queue = &virtio_user_control_queue_notify;\n \tscvq->cq.notify_cookie = dev;\n+\tscvq->notify_addr = vq->notify_addr;\n \tdev->scvq = scvq;\n \n \treturn 0;\ndiff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h\nindex 7323d88302..29ec386da5 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.h\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h\n@@ -64,6 +64,9 @@ struct virtio_user_dev {\n \tstruct virtqueue\t*scvq;\n \n \tvoid *backend_data;\n+\n+\tbool notify_area_mapped;\n+\tuint16_t **notify_area;\n };\n \n int virtio_user_dev_set_features(struct virtio_user_dev *dev);\n@@ -72,7 +75,7 @@ int virtio_user_stop_device(struct virtio_user_dev *dev);\n int virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues,\n \t\t\t int cq, int queue_size, const char *mac, char **ifname,\n \t\t\t int server, int mrg_rxbuf, int in_order,\n-\t\t\t int packed_vq,\n+\t\t\t int packed_vq, int notification_data,\n \t\t\t enum virtio_user_backend_type backend_type);\n void virtio_user_dev_uninit(struct virtio_user_dev *dev);\n void virtio_user_handle_cq(struct virtio_user_dev *dev, uint16_t queue_idx);\ndiff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c\nindex 3a31642899..241465ecdd 100644\n--- a/drivers/net/virtio/virtio_user_ethdev.c\n+++ b/drivers/net/virtio/virtio_user_ethdev.c\n@@ -18,6 +18,7 @@\n #include <bus_vdev_driver.h>\n #include <rte_alarm.h>\n #include <rte_cycles.h>\n+#include <rte_io.h>\n \n #include \"virtio_ethdev.h\"\n #include \"virtio_logs.h\"\n@@ -232,6 +233,7 @@ virtio_user_setup_queue(struct virtio_hw *hw, struct virtqueue *vq)\n \telse\n \t\tvirtio_user_setup_queue_split(vq, dev);\n \n+\tvq->notify_addr = dev->notify_area[vq->vq_queue_index];\n \tif (dev->hw_cvq && hw->cvq && (virtnet_cq_to_vq(hw->cvq) == vq))\n \t\treturn virtio_user_dev_create_shadow_cvq(dev, vq);\n \n@@ -262,8 +264,8 @@ virtio_user_del_queue(struct virtio_hw *hw, struct virtqueue *vq)\n static void\n virtio_user_notify_queue(struct virtio_hw *hw, struct virtqueue *vq)\n {\n-\tuint64_t buf = 1;\n \tstruct virtio_user_dev *dev = virtio_user_get_dev(hw);\n+\tuint64_t notify_data = 1;\n \n \tif (hw->cvq && (virtnet_cq_to_vq(hw->cvq) == vq)) {\n \t\tvirtio_user_handle_cq(dev, vq->vq_queue_index);\n@@ -271,9 +273,34 @@ virtio_user_notify_queue(struct virtio_hw *hw, struct virtqueue *vq)\n \t\treturn;\n \t}\n \n-\tif (write(dev->kickfds[vq->vq_queue_index], &buf, sizeof(buf)) < 0)\n-\t\tPMD_DRV_LOG(ERR, \"failed to kick backend: %s\",\n-\t\t\t    strerror(errno));\n+\tif (!dev->notify_area_mapped) {\n+\t\tif (write(dev->kickfds[vq->vq_queue_index], &notify_data,\n+\t\t\t  sizeof(notify_data)) < 0)\n+\t\t\tPMD_DRV_LOG(ERR, \"failed to kick backend: %s\",\n+\t\t\t\t    strerror(errno));\n+\t\treturn;\n+\t} else if (!virtio_with_feature(hw, VIRTIO_F_NOTIFICATION_DATA)) {\n+\t\trte_write16(vq->vq_queue_index, vq->notify_addr);\n+\t\treturn;\n+\t}\n+\n+\tif (virtio_with_packed_queue(hw)) {\n+\t\t/* Bit[0:15]: vq queue index\n+\t\t * Bit[16:30]: avail index\n+\t\t * Bit[31]: avail wrap counter\n+\t\t */\n+\t\tnotify_data = ((uint32_t)(!!(vq->vq_packed.cached_flags &\n+\t\t\t\tVRING_PACKED_DESC_F_AVAIL)) << 31) |\n+\t\t\t\t((uint32_t)vq->vq_avail_idx << 16) |\n+\t\t\t\tvq->vq_queue_index;\n+\t} else {\n+\t\t/* Bit[0:15]: vq queue index\n+\t\t * Bit[16:31]: avail index\n+\t\t */\n+\t\tnotify_data = ((uint32_t)vq->vq_avail_idx << 16) |\n+\t\t\t\tvq->vq_queue_index;\n+\t}\n+\trte_write32(notify_data, vq->notify_addr);\n }\n \n static int\n@@ -329,6 +356,8 @@ static const char *valid_args[] = {\n \tVIRTIO_USER_ARG_SPEED,\n #define VIRTIO_USER_ARG_VECTORIZED     \"vectorized\"\n \tVIRTIO_USER_ARG_VECTORIZED,\n+#define VIRTIO_USER_ARG_NOTIFICATION_DATA  \"notification_data\"\n+\tVIRTIO_USER_ARG_NOTIFICATION_DATA,\n \tNULL\n };\n \n@@ -480,6 +509,7 @@ virtio_user_pmd_probe(struct rte_vdev_device *vdev)\n \tuint64_t in_order = 1;\n \tuint64_t packed_vq = 0;\n \tuint64_t vectorized = 0;\n+\tuint64_t notification_data = 1;\n \tchar *path = NULL;\n \tchar *ifname = NULL;\n \tchar *mac_addr = NULL;\n@@ -637,6 +667,15 @@ virtio_user_pmd_probe(struct rte_vdev_device *vdev)\n \t\t}\n \t}\n \n+\tif (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_NOTIFICATION_DATA) == 1) {\n+\t\tif (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_NOTIFICATION_DATA,\n+\t\t\t\t       &get_integer_arg, &notification_data) < 0) {\n+\t\t\tPMD_INIT_LOG(ERR, \"error to parse %s\",\n+\t\t\t\t     VIRTIO_USER_ARG_NOTIFICATION_DATA);\n+\t\t\tgoto end;\n+\t\t}\n+\t}\n+\n \teth_dev = virtio_user_eth_dev_alloc(vdev);\n \tif (!eth_dev) {\n \t\tPMD_INIT_LOG(ERR, \"virtio_user fails to alloc device\");\n@@ -645,9 +684,10 @@ virtio_user_pmd_probe(struct rte_vdev_device *vdev)\n \n \tdev = eth_dev->data->dev_private;\n \thw = &dev->hw;\n-\tif (virtio_user_dev_init(dev, path, (uint16_t)queues, cq,\n-\t\t\t queue_size, mac_addr, &ifname, server_mode,\n-\t\t\t mrg_rxbuf, in_order, packed_vq, backend_type) < 0) {\n+\tif (virtio_user_dev_init(dev, path, (uint16_t)queues, cq, queue_size,\n+\t\t\t\t mac_addr, &ifname, server_mode, mrg_rxbuf,\n+\t\t\t\t in_order, packed_vq, notification_data,\n+\t\t\t\t backend_type) < 0) {\n \t\tPMD_INIT_LOG(ERR, \"virtio_user_dev_init fails\");\n \t\tvirtio_user_eth_dev_free(eth_dev);\n \t\tgoto end;\n@@ -784,4 +824,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_virtio_user,\n \t\"in_order=<0|1> \"\n \t\"packed_vq=<0|1> \"\n \t\"speed=<int> \"\n-\t\"vectorized=<0|1>\");\n+\t\"vectorized=<0|1> \"\n+\t\"notification_data=<0|1> \");\n",
    "prefixes": [
        "1/2"
    ]
}