get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 15596,
    "url": "http://patches.dpdk.org/api/patches/15596/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1472827152-4321-1-git-send-email-klarose@sandvine.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": "<1472827152-4321-1-git-send-email-klarose@sandvine.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1472827152-4321-1-git-send-email-klarose@sandvine.com",
    "date": "2016-09-02T14:39:12",
    "name": "[dpdk-dev] net/virtio: fix qemu exit on device stop/start",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "a439afbb8cf8b5c82fb4c9666d3e1748d2aa3cc7",
    "submitter": {
        "id": 435,
        "url": "http://patches.dpdk.org/api/people/435/?format=api",
        "name": "Kyle Larose",
        "email": "klarose@sandvine.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/1472827152-4321-1-git-send-email-klarose@sandvine.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/15596/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/15596/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 EE23C4CE7;\n\tFri,  2 Sep 2016 16:39:20 +0200 (CEST)",
            "from TPC-E3-11-020.phaedrus.sandvine.com (lab.sandvine.com\n\t[98.159.241.2]) by dpdk.org (Postfix) with ESMTP id 0FF66FE5\n\tfor <dev@dpdk.org>; Fri,  2 Sep 2016 16:39:19 +0200 (CEST)",
            "by TPC-E3-11-020.phaedrus.sandvine.com (Postfix, from userid 10523)\n\tid 47FB017C9; Fri,  2 Sep 2016 10:39:18 -0400 (EDT)"
        ],
        "From": "Kyle Larose <klarose@sandvine.com>",
        "To": "huawei.xie@intel.com,\n\tyuanhan.liu@linux.intel.com",
        "Cc": "dev@dpdk.org,\n\tKyle Larose <klarose@sandvine.com>",
        "Date": "Fri,  2 Sep 2016 10:39:12 -0400",
        "Message-Id": "<1472827152-4321-1-git-send-email-klarose@sandvine.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "Subject": "[dpdk-dev] [PATCH] net/virtio: fix qemu exit on device stop/start",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <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": "Starting with DPDK 16.04, performing a start, then stop followed by a\nstart on a virtio NIC sending traffic can cause qemu to exit.\n\nQemu exits with a message like:\n    2016-09-01T15:45:32.119059Z qemu-kvm: Guest moved used index from 5\n    to 1\n\nThis appears to occur because virtio_dev_start will always reinitialize\nthe virtio queues if virtio_dev_stop has been called. Prior to the\npatch that introduced the regression, virtio_dev_stop did not mark the\ndevice as stopped, so start would not actually reinitialize the queues.\n\nThis fix reintroduces that behaviour by tracking whether or not the\nqueues require initialization separately from whether or not the device\nhas been stopped. It does this by introducing an \"opened\" flag to the\ndevice.\n\nA simple test with testpmd can reproduce the problem.\n\n1. Set up two virtio ports, ideally connecting two devices which can\nping one-another.\n2. Start pinging between the devices\n3. Start testpmd in interactive mode on the two virtio ports\n    e.g. testpmd -w 0000:00:05.0 -w 0000:00:06.0 -- -i\n4. Run the following commands a few times:\n    start\n    stop\n    port stop 0\n    port stop 1\n    port start 0\n    port start 1\n    start\n5. Qemu should exit with a \"Guest moved ...\" message.\n\nAfter applying this patch, I can no longer reproduce this problem.\nThe ping resumes every time I start the ports back up.\n\nTest environment:\n\n- CPU: Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz\n- Host OS: CentOS Linux release 7.1.1503 (Core)\n- Guest OS: CentOS Linux release 7.2.1511 (Core)\n- Qemu-kvm version: 1.5.3-86.el7_1.6\n\nFixes: 9a0615af7746 (\"virtio: fix restart\")\n\nSigned-off-by: Kyle Larose <klarose@sandvine.com>\n---\n drivers/net/virtio/virtio_ethdev.c | 10 ++++++++--\n drivers/net/virtio/virtio_pci.h    |  1 +\n 2 files changed, 9 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex 07d6449..da796cb 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -558,6 +558,9 @@ virtio_dev_close(struct rte_eth_dev *dev)\n \tvtpci_reset(hw);\n \tvirtio_dev_free_mbufs(dev);\n \tvirtio_free_queues(dev);\n+\n+\thw->opened = 0;\n+\n }\n \n static void\n@@ -1393,9 +1396,10 @@ virtio_dev_start(struct rte_eth_dev *dev)\n \tvirtio_dev_link_update(dev, 0);\n \n \t/* On restart after stop do not touch queues */\n-\tif (hw->started)\n+\tif (hw->opened) {\n+\t\thw->started = 1;\n \t\treturn 0;\n-\n+\t}\n \t/* Do final configuration before rx/tx engine starts */\n \tvirtio_dev_rxtx_start(dev);\n \tvtpci_reinit_complete(hw);\n@@ -1431,6 +1435,8 @@ virtio_dev_start(struct rte_eth_dev *dev)\n \t\tVIRTQUEUE_DUMP(txvq->vq);\n \t}\n \n+\thw->opened = 1;\n+\n \treturn 0;\n }\n \ndiff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h\nindex dd7693f..52911af 100644\n--- a/drivers/net/virtio/virtio_pci.h\n+++ b/drivers/net/virtio/virtio_pci.h\n@@ -252,6 +252,7 @@ struct virtio_hw {\n \tuint8_t\t    vlan_strip;\n \tuint8_t\t    use_msix;\n \tuint8_t     started;\n+\tuint8_t     opened;\n \tuint8_t     modern;\n \tuint8_t     mac_addr[ETHER_ADDR_LEN];\n \tuint32_t    notify_off_multiplier;\n",
    "prefixes": [
        "dpdk-dev"
    ]
}