get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74947,
    "url": "http://patches.dpdk.org/api/patches/74947/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200728165021.216291-4-maxime.coquelin@redhat.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": "<20200728165021.216291-4-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200728165021.216291-4-maxime.coquelin@redhat.com",
    "date": "2020-07-28T16:50:21",
    "name": "[v2,3/3] net/vhost: fix interrupt mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "61ebeadc558c627777e99a3427115c065cbb1cbe",
    "submitter": {
        "id": 512,
        "url": "http://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@redhat.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/20200728165021.216291-4-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 11365,
            "url": "http://patches.dpdk.org/api/series/11365/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11365",
            "date": "2020-07-28T16:50:18",
            "name": "Fix Vhost regressions",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/11365/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/74947/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/74947/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C09CCA052B;\n\tTue, 28 Jul 2020 18:51:07 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B14FD1C02E;\n\tTue, 28 Jul 2020 18:50:53 +0200 (CEST)",
            "from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com\n [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 50DD61C02E\n for <dev@dpdk.org>; Tue, 28 Jul 2020 18:50:52 +0200 (CEST)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-225-UJSNgt1HOCuSFblLW9pEWA-1; Tue, 28 Jul 2020 12:50:42 -0400",
            "from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com\n [10.5.11.14])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0D22A802805;\n Tue, 28 Jul 2020 16:50:41 +0000 (UTC)",
            "from localhost.localdomain (unknown [10.36.110.21])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 80CEA5D9E8;\n Tue, 28 Jul 2020 16:50:38 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1595955051;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=nc/4WtlNrymGlRML0x8zbSWGgcOoKSiDhon9MUaWof0=;\n b=Ej1BaaJPjXNialAViKfM4JdKAQNhezxiKGq1+rNXrdHJaYnCE+Cu4rEh9kVEZSYf7Zzdm2\n 5Y8DdVhHZ2lj4P26r6pxwHh8TjzJyjI+nGqE84VMYd2CSbJunIJcqtiCk2wEFwB87OEO7L\n 3lv/L3qy+6nrYpoC5YJeedsT2z3v0ys=",
        "X-MC-Unique": "UJSNgt1HOCuSFblLW9pEWA-1",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, matan@mellanox.com, chenbo.xia@intel.com,\n yong.liu@intel.com,\n yinan.wang@intel.com",
        "Cc": "thomas@monjalon.net, ferruh.yigit@intel.com, david.marchand@redhat.com,\n Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Tue, 28 Jul 2020 18:50:21 +0200",
        "Message-Id": "<20200728165021.216291-4-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<20200728165021.216291-1-maxime.coquelin@redhat.com>",
        "References": "<20200728165021.216291-1-maxime.coquelin@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.14",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 3/3] net/vhost: fix interrupt mode",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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": "At .new_device() time, only the first vring pair is\nnow ready, other vrings are consfigured later.\n\nProblem is that when application will setup and enable\ninterrupts, only the first queue pair Rx interrupt will\nbe enabled.\n\nThis patches fixes the issue by setting the number of\nmax interrupts to the number of Rx queues that will be\nlater initialized. Then, as soon as a Rx vring is ready,\nit removes the corresponding uninitialized epoll event,\nand install a new one with the valid FD.\n\nFixes: 604052ae5395 (\"net/vhost: support queue update\")\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n drivers/net/vhost/rte_eth_vhost.c | 39 ++++++++++++++++++++++++++-----\n 1 file changed, 33 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c\nindex 951929c663..0f6a0bbbf7 100644\n--- a/drivers/net/vhost/rte_eth_vhost.c\n+++ b/drivers/net/vhost/rte_eth_vhost.c\n@@ -5,6 +5,7 @@\n #include <unistd.h>\n #include <pthread.h>\n #include <stdbool.h>\n+#include <sys/epoll.h>\n \n #include <rte_mbuf.h>\n #include <rte_ethdev_driver.h>\n@@ -593,7 +594,6 @@ eth_vhost_install_intr(struct rte_eth_dev *dev)\n {\n \tstruct rte_vhost_vring vring;\n \tstruct vhost_queue *vq;\n-\tint count = 0;\n \tint nb_rxq = dev->data->nb_rx_queues;\n \tint i;\n \tint ret;\n@@ -623,6 +623,8 @@ eth_vhost_install_intr(struct rte_eth_dev *dev)\n \n \tVHOST_LOG(INFO, \"Prepare intr vec\\n\");\n \tfor (i = 0; i < nb_rxq; i++) {\n+\t\tdev->intr_handle->intr_vec[i] = RTE_INTR_VEC_RXTX_OFFSET + i;\n+\t\tdev->intr_handle->efds[i] = -1;\n \t\tvq = dev->data->rx_queues[i];\n \t\tif (!vq) {\n \t\t\tVHOST_LOG(INFO, \"rxq-%d not setup yet, skip!\\n\", i);\n@@ -641,14 +643,12 @@ eth_vhost_install_intr(struct rte_eth_dev *dev)\n \t\t\t\t\"rxq-%d's kickfd is invalid, skip!\\n\", i);\n \t\t\tcontinue;\n \t\t}\n-\t\tdev->intr_handle->intr_vec[i] = RTE_INTR_VEC_RXTX_OFFSET + i;\n \t\tdev->intr_handle->efds[i] = vring.kickfd;\n-\t\tcount++;\n \t\tVHOST_LOG(INFO, \"Installed intr vec for rxq-%d\\n\", i);\n \t}\n \n-\tdev->intr_handle->nb_efd = count;\n-\tdev->intr_handle->max_intr = count + 1;\n+\tdev->intr_handle->nb_efd = nb_rxq;\n+\tdev->intr_handle->max_intr = nb_rxq + 1;\n \tdev->intr_handle->type = RTE_INTR_HANDLE_VDEV;\n \n \treturn 0;\n@@ -836,8 +836,11 @@ vring_conf_update(int vid, struct rte_eth_dev *eth_dev, uint16_t vring_id)\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 rte_intr_handle *handle;\n+\tstruct rte_epoll_event rev;\n \tint rx_idx = vring_id % 2 ? (vring_id - 1) >> 1 : -1;\n \tint ret = 0;\n+\tint epfd;\n \n \t/*\n \t * The vring kickfd may be changed after the new device notification.\n@@ -857,7 +860,31 @@ vring_conf_update(int vid, struct rte_eth_dev *eth_dev, uint16_t vring_id)\n \t\tif (vring.kickfd != eth_dev->intr_handle->efds[rx_idx]) {\n \t\t\tVHOST_LOG(INFO, \"kickfd for rxq-%d was changed.\\n\",\n \t\t\t\t\t  rx_idx);\n-\t\t\teth_dev->intr_handle->efds[rx_idx] = vring.kickfd;\n+\n+\t\t\t/*\n+\t\t\t * First remove invalid epoll event, and then isntall\n+\t\t\t * the new one. May be solved with a proper API in the\n+\t\t\t * future.\n+\t\t\t */\n+\t\t\thandle = eth_dev->intr_handle;\n+\t\t\thandle->efds[rx_idx] = vring.kickfd;\n+\t\t\tepfd = handle->elist[rx_idx].epfd;\n+\t\t\trev = handle->elist[rx_idx];\n+\t\t\tret = rte_epoll_ctl(epfd, EPOLL_CTL_DEL, rev.fd,\n+\t\t\t\t\t&handle->elist[rx_idx]);\n+\t\t\tif (ret) {\n+\t\t\t\tVHOST_LOG(ERR, \"Delete epoll event failed.\\n\");\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\n+\t\t\trev.fd = vring.kickfd;\n+\t\t\thandle->elist[rx_idx] = rev;\n+\t\t\tret = rte_epoll_ctl(epfd, EPOLL_CTL_ADD, rev.fd,\n+\t\t\t\t\t&handle->elist[rx_idx]);\n+\t\t\tif (ret) {\n+\t\t\t\tVHOST_LOG(ERR, \"Add epoll event failed.\\n\");\n+\t\t\t\treturn ret;\n+\t\t\t}\n \t\t}\n \t}\n \n",
    "prefixes": [
        "v2",
        "3/3"
    ]
}