get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 15181,
    "url": "http://patchwork.dpdk.org/api/patches/15181/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1471049909-18117-4-git-send-email-yongwang@vmware.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<1471049909-18117-4-git-send-email-yongwang@vmware.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1471049909-18117-4-git-send-email-yongwang@vmware.com",
    "date": "2016-08-13T00:58:28",
    "name": "[dpdk-dev,3/4] net/vmxnet3: reallocate shared memzone on re-config",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "cdd1d5c063f0e61b76df201696a3dad458b63e15",
    "submitter": {
        "id": 93,
        "url": "http://patchwork.dpdk.org/api/people/93/?format=api",
        "name": "Yong Wang",
        "email": "yongwang@vmware.com"
    },
    "delegate": {
        "id": 10,
        "url": "http://patchwork.dpdk.org/api/users/10/?format=api",
        "username": "bruce",
        "first_name": "Bruce",
        "last_name": "Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1471049909-18117-4-git-send-email-yongwang@vmware.com/mbox/",
    "series": [],
    "comments": "http://patchwork.dpdk.org/api/patches/15181/comments/",
    "check": "pending",
    "checks": "http://patchwork.dpdk.org/api/patches/15181/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 7281D5A31;\n\tSat, 13 Aug 2016 03:15:02 +0200 (CEST)",
            "from EX13-EDG-OU-002.vmware.com (ex13-edg-ou-002.vmware.com\n\t[208.91.0.190]) by dpdk.org (Postfix) with ESMTP id 6A2995960\n\tfor <dev@dpdk.org>; Sat, 13 Aug 2016 03:15:01 +0200 (CEST)",
            "from sc9-mailhost3.vmware.com (10.113.161.73) by\n\tEX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP\n\tServer id 15.0.1156.6; Fri, 12 Aug 2016 18:14:05 -0700",
            "from sc2-edge-ivybridge-01.eng.vmware.com (unknown\n\t[10.172.139.164])\n\tby sc9-mailhost3.vmware.com (Postfix) with ESMTP id D901640630;\n\tFri, 12 Aug 2016 18:14:59 -0700 (PDT)"
        ],
        "From": "Yong Wang <yongwang@vmware.com>",
        "To": "<stephen@networkplumber.org>",
        "CC": "<dev@dpdk.org>, <sothy.e98@gmail.com>, <gyang@vmware.com>,\n\t<diproiettod@vmware.com>, Yong Wang <yongwang@vmware.com>",
        "Date": "Fri, 12 Aug 2016 17:58:28 -0700",
        "Message-ID": "<1471049909-18117-4-git-send-email-yongwang@vmware.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1471049909-18117-1-git-send-email-yongwang@vmware.com>",
        "References": "<1471049909-18117-1-git-send-email-yongwang@vmware.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "Received-SPF": "None (EX13-EDG-OU-002.vmware.com: yongwang@vmware.com does not\n\tdesignate permitted sender hosts)",
        "Subject": "[dpdk-dev] [PATCH 3/4] net/vmxnet3: reallocate shared memzone on\n\tre-config",
        "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": "When adding a DPDK port to a bridge using ovs-vswitchd with DPDK,\nthe vmxnet3 device fails to activate due to mismatched magic number.\nDoing this will incur the following operations: start the port,\nstop the port, reconfigure and re-start the port.  The reconfig\ncould request different number of tx/rx queues but the driver\nbypasses allocating the queuedesc memzone of proper size (which\ndepends on the queue size) if there is an existing one.  This\nresults in a memzone with wrong size and potential invalid memory\naccess. To fix this, this change will free the memzone if found\nand reserve a new one.\n\nSigned-off-by: Yong Wang <yongwang@vmware.com>\nReviewed-by: Guolin Yang <gyang@vmware.com>\nReviewed-by: Daniele Di Proietto <ddiproietto@vmware.com>\nTested-by: Daniele Di Proietto <ddiproietto@vmware.com>\n---\n drivers/net/vmxnet3/vmxnet3_ethdev.c | 27 ++++++++++++++++++++-------\n 1 file changed, 20 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c\nindex a2cb2dd..6b1e720 100644\n--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c\n+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c\n@@ -131,7 +131,8 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {\n \n static const struct rte_memzone *\n gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size,\n-\t\t const char *post_string, int socket_id, uint16_t align)\n+\t\t const char *post_string, int socket_id,\n+\t\t uint16_t align, bool reuse)\n {\n \tchar z_name[RTE_MEMZONE_NAMESIZE];\n \tconst struct rte_memzone *mz;\n@@ -140,6 +141,13 @@ gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size,\n \t\t dev->driver->pci_drv.name, dev->data->port_id, post_string);\n \n \tmz = rte_memzone_lookup(z_name);\n+\tif (!reuse) {\n+\t\tif (mz)\n+\t\t\trte_memzone_free(mz);\n+\t\treturn rte_memzone_reserve_aligned(z_name, size, socket_id,\n+\t\t\t\t\t\t   0, align);\n+\t}\n+\n \tif (mz)\n \t\treturn mz;\n \n@@ -384,7 +392,7 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)\n \t * on current socket\n \t */\n \tmz = gpa_zone_reserve(dev, sizeof(struct Vmxnet3_DriverShared),\n-\t\t\t      \"shared\", rte_socket_id(), 8);\n+\t\t\t      \"shared\", rte_socket_id(), 8, 1);\n \n \tif (mz == NULL) {\n \t\tPMD_INIT_LOG(ERR, \"ERROR: Creating shared zone\");\n@@ -397,10 +405,14 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)\n \n \t/*\n \t * Allocate a memzone for Vmxnet3_RxQueueDesc - Vmxnet3_TxQueueDesc\n-\t * on current socket\n+\t * on current socket.\n+\t *\n+\t * We cannot reuse this memzone from previous allocation as its size\n+\t * depends on the number of tx and rx queues, which could be different\n+\t * from one config to another.\n \t */\n-\tmz = gpa_zone_reserve(dev, size, \"queuedesc\",\n-\t\t\t      rte_socket_id(), VMXNET3_QUEUE_DESC_ALIGN);\n+\tmz = gpa_zone_reserve(dev, size, \"queuedesc\", rte_socket_id(),\n+\t\t\t      VMXNET3_QUEUE_DESC_ALIGN, 0);\n \tif (mz == NULL) {\n \t\tPMD_INIT_LOG(ERR, \"ERROR: Creating queue descriptors zone\");\n \t\treturn -ENOMEM;\n@@ -415,8 +427,9 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)\n \n \tif (dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {\n \t\t/* Allocate memory structure for UPT1_RSSConf and configure */\n-\t\tmz = gpa_zone_reserve(dev, sizeof(struct VMXNET3_RSSConf), \"rss_conf\",\n-\t\t\t\t      rte_socket_id(), RTE_CACHE_LINE_SIZE);\n+\t\tmz = gpa_zone_reserve(dev, sizeof(struct VMXNET3_RSSConf),\n+\t\t\t\t      \"rss_conf\", rte_socket_id(),\n+\t\t\t\t      RTE_CACHE_LINE_SIZE, 1);\n \t\tif (mz == NULL) {\n \t\t\tPMD_INIT_LOG(ERR,\n \t\t\t\t     \"ERROR: Creating rss_conf structure zone\");\n",
    "prefixes": [
        "dpdk-dev",
        "3/4"
    ]
}