Show a patch.

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

{
    "id": 74583,
    "url": "https://patches.dpdk.org/api/patches/74583/",
    "web_url": "https://patches.dpdk.org/patch/74583/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20200721163816.15057-1-matan@mellanox.com>",
    "date": "2020-07-21T16:38:16",
    "name": "[v2] net/vhost: support queue update",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c43c7c2285b625c2ffd5d08e879421fefa9d2a64",
    "submitter": {
        "id": 796,
        "url": "https://patches.dpdk.org/api/people/796/",
        "name": "Matan Azrad",
        "email": "matan@mellanox.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/patch/74583/mbox/",
    "series": [
        {
            "id": 11220,
            "url": "https://patches.dpdk.org/api/series/11220/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11220",
            "date": "2020-07-21T16:38:16",
            "name": "[v2] net/vhost: support queue update",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/11220/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74583/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/74583/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "References": "<1595175493-21497-1-git-send-email-matan@mellanox.com>",
        "X-BeenThere": "dev@dpdk.org",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH v2] net/vhost: support queue update",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "From": "Matan Azrad <matan@mellanox.com>",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 5ACE3A0526;\n\tTue, 21 Jul 2020 18:38:29 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3F3461C025;\n\tTue, 21 Jul 2020 18:38:29 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 9E0C11C010\n for <dev@dpdk.org>; Tue, 21 Jul 2020 18:38:27 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n matan@mellanox.com) with SMTP; 21 Jul 2020 19:38:23 +0300",
            "from pegasus24.mtr.labs.mlnx (pegasus24.mtr.labs.mlnx [10.210.16.8])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 06LGcMWE005836;\n Tue, 21 Jul 2020 19:38:22 +0300"
        ],
        "To": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Date": "Tue, 21 Jul 2020 16:38:16 +0000",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "In-Reply-To": "<1595175493-21497-1-git-send-email-matan@mellanox.com>",
        "Cc": "dev@dpdk.org, Ferruh Yigit <ferruh.yigit@intel.com>, chenbo.xia@intel.com,\n david.marchand@redhat.com, thomas@monjalon.net",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200721163816.15057-1-matan@mellanox.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "The commit below changed the readiness condition of vhost device to fix\nmulti-queues issues showed with QEMU versions.\n\nNow, the vhost device is ready when the first queue-pair is ready.\nWhen more queues are being ready, the queue state callback will be\ntriggered to notify the vhost manager.\n\nIn case of Rx interrupt configuration, the vhost driver set the\nkickfd queue file descriptor in order to be notified on Rx traffic.\n\nSo, when queue becomes ready, the kickfd may be changed and should be\nupdated in the Rx interrupt structure.\n\nUpdate kickfd when the queue state callback is invoked.\nAlso update event notification when it is enabled by the user.\n\nFixes: d0fcc38f5fa4 (\"vhost: improve device readiness notifications\")\n\nSigned-off-by: Matan Azrad <matan@mellanox.com>\n---\n drivers/net/vhost/rte_eth_vhost.c | 49 +++++++++++++++++++++++++++++++\n 1 file changed, 49 insertions(+)",
    "diff": "diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c\nindex 9fbf39f66b..bbf79b2c0e 100644\n--- a/drivers/net/vhost/rte_eth_vhost.c\n+++ b/drivers/net/vhost/rte_eth_vhost.c\n@@ -94,6 +94,7 @@ struct vhost_queue {\n \tstruct rte_mempool *mb_pool;\n \tuint16_t port;\n \tuint16_t virtqueue_id;\n+\tbool intr_en;\n \tstruct vhost_stats stats;\n };\n \n@@ -546,6 +547,8 @@ eth_rxq_intr_enable(struct rte_eth_dev *dev, uint16_t qid)\n \trte_vhost_enable_guest_notification(vq->vid, (qid << 1) + 1, 1);\n \trte_wmb();\n \n+\tvq->intr_en = true;\n+\n \treturn ret;\n }\n \n@@ -571,6 +574,8 @@ eth_rxq_intr_disable(struct rte_eth_dev *dev, uint16_t qid)\n \trte_vhost_enable_guest_notification(vq->vid, (qid << 1) + 1, 0);\n \trte_wmb();\n \n+\tvq->intr_en = false;\n+\n \treturn 0;\n }\n \n@@ -830,6 +835,45 @@ destroy_device(int vid)\n \t_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);\n }\n \n+static int\n+vring_conf_update(int vid, struct rte_eth_dev *eth_dev, uint16_t vring_id)\n+{\n+\tstruct rte_eth_conf *dev_conf = &eth_dev->data->dev_conf;\n+\tstruct pmd_internal *internal = eth_dev->data->dev_private;\n+\tstruct rte_vhost_vring vring;\n+\tstruct vhost_queue *vq;\n+\tint rx_idx = vring_id % 2 ? (vring_id - 1) >> 1 : -1;\n+\tint ret = 0;\n+\n+\t/*\n+\t * The vring kickfd may be changed after the new device notification.\n+\t * Update it when the vring state is updated.\n+\t */\n+\tif (rx_idx >= 0 && rx_idx < eth_dev->data->nb_rx_queues &&\n+\t    rte_atomic32_read(&internal->dev_attached) &&\n+\t    rte_atomic32_read(&internal->started) &&\n+\t    dev_conf->intr_conf.rxq) {\n+\t\tvq = eth_dev->data->rx_queues[rx_idx];\n+\t\tret = rte_vhost_get_vhost_vring(vid, vring_id, &vring);\n+\t\tif (!ret) {\n+\t\t\tif (vring.kickfd !=\n+\t\t\t    eth_dev->intr_handle->efds[rx_idx]) {\n+\t\t\t\tVHOST_LOG(INFO,\n+\t\t\t\t\t  \"kickfd for rxq-%d was changed.\\n\",\n+\t\t\t\t\t  rx_idx);\n+\t\t\t\teth_dev->intr_handle->efds[rx_idx] =\n+\t\t\t\t\t\t\t\t   vring.kickfd;\n+\t\t\t}\n+\n+\t\t\trte_vhost_enable_guest_notification(vid, vring_id,\n+\t\t\t\t\t\t\t    vq->intr_en);\n+\t\t\trte_wmb();\n+\t\t}\n+\t}\n+\n+\treturn ret;\n+}\n+\n static int\n vring_state_changed(int vid, uint16_t vring, int enable)\n {\n@@ -848,6 +892,11 @@ vring_state_changed(int vid, uint16_t vring, int enable)\n \teth_dev = list->eth_dev;\n \t/* won't be NULL */\n \tstate = vring_states[eth_dev->data->port_id];\n+\n+\tif (enable && vring_conf_update(vid, eth_dev, vring))\n+\t\tVHOST_LOG(INFO, \"Failed to update vring-%d configuration.\\n\",\n+\t\t\t  (int)vring);\n+\n \trte_spinlock_lock(&state->lock);\n \tif (state->cur[vring] == enable) {\n \t\trte_spinlock_unlock(&state->lock);\n",
    "prefixes": [
        "v2"
    ]
}