get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 22568,
    "url": "http://patches.dpdk.org/api/patches/22568/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1490689316-131625-3-git-send-email-jianfeng.tan@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": "<1490689316-131625-3-git-send-email-jianfeng.tan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1490689316-131625-3-git-send-email-jianfeng.tan@intel.com",
    "date": "2017-03-28T08:21:53",
    "name": "[dpdk-dev,v2,2/5] net/virtio: add interrupt configure for vdev",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "426d944ce743f8c36f964407de51d2696079a617",
    "submitter": {
        "id": 313,
        "url": "http://patches.dpdk.org/api/people/313/?format=api",
        "name": "Jianfeng Tan",
        "email": "jianfeng.tan@intel.com"
    },
    "delegate": {
        "id": 355,
        "url": "http://patches.dpdk.org/api/users/355/?format=api",
        "username": "yliu",
        "first_name": "Yuanhan",
        "last_name": "Liu",
        "email": "yuanhan.liu@linux.intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1490689316-131625-3-git-send-email-jianfeng.tan@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/22568/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/22568/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id E8EF1D018;\n\tTue, 28 Mar 2017 10:21:27 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 81F66CF80\n\tfor <dev@dpdk.org>; Tue, 28 Mar 2017 10:21:15 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t28 Mar 2017 01:21:15 -0700",
            "from dpdk06.sh.intel.com ([10.239.129.195])\n\tby fmsmga006.fm.intel.com with ESMTP; 28 Mar 2017 01:21:13 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple;\n\td=intel.com; i=@intel.com; q=dns/txt; s=intel;\n\tt=1490689275; x=1522225275;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=q9VHW4EmhgaUQVbUtQV8asZ4zqDlZApUoogQrv9J1nQ=;\n\tb=BTxv6lPj8msElh7vWOc4WusV7/lZ4nAPjq1nz/hbB+Z4xZxtcp8+Y/JC\n\tneal3cHV5OMUkLBuvy16JHkG/gPnjw==;",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.36,236,1486454400\"; d=\"scan'208\";a=\"81788016\"",
        "From": "Jianfeng Tan <jianfeng.tan@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "yuanhan.liu@linux.intel.com, david.marchand@6wind.com,\n\tmaxime.coquelin@redhat.com, Jianfeng Tan <jianfeng.tan@intel.com>",
        "Date": "Tue, 28 Mar 2017 08:21:53 +0000",
        "Message-Id": "<1490689316-131625-3-git-send-email-jianfeng.tan@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1490689316-131625-1-git-send-email-jianfeng.tan@intel.com>",
        "References": "<1488563803-87754-1-git-send-email-jianfeng.tan@intel.com>\n\t<1490689316-131625-1-git-send-email-jianfeng.tan@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 2/5] net/virtio: add interrupt configure for\n\tvdev",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "For virtio PCI devices, interrupt should be configured before setting\nVIRTIO_CONFIG_STATUS_DRIVER_OK so that QEMU can properly set eventfds\nin the host.\n\nFor virtio virtual devices, VIRTIO_CONFIG_STATUS_DRIVER_OK should be\nset firstly, so that intr_handle is initialized in\nvirtio_user_start_device().\n\nTo accommodate both requirements, we rearrange the sequence like this:\n  a. set interrupt configure for PCI devices.\n  b. set VIRTIO_CONFIG_STATUS_DRIVER_OK.\n  c. set interrupt configure for virtual devices.\n\nSigned-off-by: Jianfeng Tan <jianfeng.tan@intel.com>\n---\n drivers/net/virtio/virtio_ethdev.c | 57 ++++++++++++++++++++++++++++++++++----\n 1 file changed, 51 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex d9986ab..f0213ba 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -1275,7 +1275,7 @@ virtio_queues_unbind_intr(struct rte_eth_dev *dev)\n }\n \n static int\n-virtio_configure_intr(struct rte_eth_dev *dev)\n+virtio_configure_intr_pci(struct rte_eth_dev *dev)\n {\n \tstruct virtio_hw *hw = dev->data->dev_private;\n \n@@ -1327,6 +1327,37 @@ virtio_configure_intr(struct rte_eth_dev *dev)\n \treturn 0;\n }\n \n+static int\n+virtio_configure_intr_vdev(struct rte_eth_dev *dev)\n+{\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n+\n+\tif (!dev->intr_handle->intr_vec) {\n+\t\tdev->intr_handle->intr_vec =\n+\t\t\trte_zmalloc(\"intr_vec\",\n+\t\t\t\t    hw->max_queue_pairs * sizeof(int), 0);\n+\t\tif (!dev->intr_handle->intr_vec) {\n+\t\t\tPMD_INIT_LOG(ERR, \"Failed to allocate %u rxq vectors\",\n+\t\t\t\t     hw->max_queue_pairs);\n+\t\t\treturn -ENOMEM;\n+\t\t}\n+\t}\n+\n+\t/* Re-register callback to update max_intr */\n+\trte_intr_callback_unregister(dev->intr_handle,\n+\t\t\t\t     virtio_interrupt_handler,\n+\t\t\t\t     dev);\n+\trte_intr_callback_register(dev->intr_handle,\n+\t\t\t\t   virtio_interrupt_handler,\n+\t\t\t\t   dev);\n+\n+\tif (virtio_queues_bind_intr(dev) < 0) {\n+\t\tPMD_INIT_LOG(ERR, \"Failed to bind queue/interrupt\");\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n /* reset device and renegotiate features if needed */\n static int\n virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n@@ -1450,15 +1481,29 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)\n \tif (ret < 0)\n \t\treturn ret;\n \n-\tif (eth_dev->data->dev_conf.intr_conf.rxq) {\n-\t\tif (virtio_configure_intr(eth_dev) < 0) {\n-\t\t\tPMD_INIT_LOG(ERR, \"failed to configure interrupt\");\n-\t\t\treturn -1;\n-\t\t}\n+\t/* For virtio PCI devices, setup interrupt configuration before\n+\t * setting VIRTIO_CONFIG_STATUS_DRIVER_OK, required by QEMU.\n+\t */\n+\tif (pci_dev &&\n+\t    eth_dev->data->dev_conf.intr_conf.rxq &&\n+\t    virtio_configure_intr_pci(eth_dev) < 0) {\n+\t\tPMD_INIT_LOG(ERR, \"failed to configure interrupt\");\n+\t\treturn -1;\n \t}\n \n \tvtpci_reinit_complete(hw);\n \n+\t/* For virtio vdev, setup interrupt configuration after\n+\t * setting VIRTIO_CONFIG_STATUS_DRIVER_OK, so that intr_handle\n+\t * is initialized in virtio_user_start_device().\n+\t */\n+\tif (!pci_dev &&\n+\t    eth_dev->data->dev_conf.intr_conf.rxq &&\n+\t    virtio_configure_intr_vdev(eth_dev) < 0) {\n+\t\tPMD_INIT_LOG(ERR, \"failed to configure interrupt\");\n+\t\treturn -1;\n+\t}\n+\n \tif (pci_dev)\n \t\tPMD_INIT_LOG(DEBUG, \"port %d vendorID=0x%x deviceID=0x%x\",\n \t\t\teth_dev->data->port_id, pci_dev->id.vendor_id,\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "2/5"
    ]
}