get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 21774,
    "url": "http://patches.dpdk.org/api/patches/21774/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1489581310-26094-1-git-send-email-ciwillia@brocade.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": "<1489581310-26094-1-git-send-email-ciwillia@brocade.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1489581310-26094-1-git-send-email-ciwillia@brocade.com",
    "date": "2017-03-15T12:35:10",
    "name": "[dpdk-dev] net/vmxnet3: fix queue size changes",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "644ee0e1347a7b2da7d0b194cbef52f12a5d6d1e",
    "submitter": {
        "id": 424,
        "url": "http://patches.dpdk.org/api/people/424/?format=api",
        "name": "Chas Williams",
        "email": "ciwillia@brocade.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1489581310-26094-1-git-send-email-ciwillia@brocade.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/21774/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/21774/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 06D05567F;\n\tWed, 15 Mar 2017 13:35:24 +0100 (CET)",
            "from mx0a-000f0801.pphosted.com (mx0b-000f0801.pphosted.com\n\t[67.231.152.113]) by dpdk.org (Postfix) with ESMTP id D9FAD3777\n\tfor <dev@dpdk.org>; Wed, 15 Mar 2017 13:35:22 +0100 (CET)",
            "from pps.filterd (m0000700.ppops.net [127.0.0.1])\n\tby mx0b-000f0801.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id\n\tv2FCQYtE025212; Wed, 15 Mar 2017 05:35:22 -0700",
            "from brmwp-exmb12.corp.brocade.com ([208.47.132.227])\n\tby mx0b-000f0801.pphosted.com with ESMTP id 2975m380y5-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tWed, 15 Mar 2017 05:35:22 -0700",
            "from confsjhq2-2-001.brocade.com (10.252.136.2) by\n\tBRMWP-EXMB12.corp.brocade.com (172.16.59.130) with Microsoft SMTP\n\tServer (TLS) id 15.0.1210.3; Wed, 15 Mar 2017 06:35:20 -0600"
        ],
        "From": "\"Charles (Chas) Williams\" <ciwillia@brocade.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<yongwang@vmware.com>, \"Charles (Chas) Williams\" <ciwillia@brocade.com>",
        "Date": "Wed, 15 Mar 2017 08:35:10 -0400",
        "Message-ID": "<1489581310-26094-1-git-send-email-ciwillia@brocade.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<1489444915-3660-1-git-send-email-ciwillia@brocade.com>",
        "References": "<1489444915-3660-1-git-send-email-ciwillia@brocade.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-ClientProxiedBy": "hq1wp-excas11.corp.brocade.com (10.70.36.102) To\n\tBRMWP-EXMB12.corp.brocade.com (172.16.59.130)",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-03-15_03:, , signatures=0",
        "X-Proofpoint-Spam-Details": "rule=notspam policy=default score=0\n\tpriorityscore=1501 malwarescore=0\n\tsuspectscore=4 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015\n\tlowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam\n\tadjust=0\n\treason=mlx scancount=1 engine=8.0.1-1702020001\n\tdefinitions=main-1703150093",
        "Subject": "[dpdk-dev] [PATCH] net/vmxnet3: fix queue size changes",
        "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": "If the user reconfigures the queue size, then the previously allocated\nmemzone may potentially be too small.  Release the memzone when a queue\nis released and allocate a new one each time a queue is setup.\n\nWhile here convert to rte_eth_dma_zone_reserve() which does basically\nthe same things as the private function.\n\nFixes: dfaff37fc46d (\"vmxnet3: import new vmxnet3 poll mode driver implementation\")\n\nSigned-off-by: Chas Williams <ciwillia@brocade.com>\n---\n drivers/net/vmxnet3/vmxnet3_ring.h |  2 ++\n drivers/net/vmxnet3/vmxnet3_rxtx.c | 37 +++++++++++--------------------------\n 2 files changed, 13 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/drivers/net/vmxnet3/vmxnet3_ring.h b/drivers/net/vmxnet3/vmxnet3_ring.h\nindex 0ce46c5..d2e8323 100644\n--- a/drivers/net/vmxnet3/vmxnet3_ring.h\n+++ b/drivers/net/vmxnet3/vmxnet3_ring.h\n@@ -141,6 +141,7 @@ typedef struct vmxnet3_tx_queue {\n \tuint32_t                     qid;\n \tstruct Vmxnet3_TxQueueDesc   *shared;\n \tstruct vmxnet3_txq_stats     stats;\n+\tconst struct rte_memzone     *mz;\n \tbool                         stopped;\n \tuint16_t                     queue_id;      /**< Device TX queue index. */\n \tuint8_t                      port_id;       /**< Device port identifier. */\n@@ -175,6 +176,7 @@ typedef struct vmxnet3_rx_queue {\n \tstruct rte_mbuf             *start_seg;\n \tstruct rte_mbuf             *last_seg;\n \tstruct vmxnet3_rxq_stats    stats;\n+\tconst struct rte_memzone    *mz;\n \tbool                        stopped;\n \tuint16_t                    queue_id;      /**< Device RX queue index. */\n \tuint8_t                     port_id;       /**< Device port identifier. */\ndiff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c\nindex 6649c3f..e865c67 100644\n--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c\n+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c\n@@ -201,6 +201,8 @@ vmxnet3_dev_tx_queue_release(void *txq)\n \t\tvmxnet3_tx_cmd_ring_release_mbufs(&tq->cmd_ring);\n \t\t/* Release the cmd_ring */\n \t\tvmxnet3_cmd_ring_release(&tq->cmd_ring);\n+\t\t/* Release the memzone */\n+\t\trte_memzone_free(tq->mz);\n \t}\n }\n \n@@ -218,6 +220,9 @@ vmxnet3_dev_rx_queue_release(void *rxq)\n \t\t/* Release both the cmd_rings */\n \t\tfor (i = 0; i < VMXNET3_RX_CMDRING_SIZE; i++)\n \t\t\tvmxnet3_cmd_ring_release(&rq->cmd_ring[i]);\n+\n+\t\t/* Release the memzone */\n+\t\trte_memzone_free(rq->mz);\n \t}\n }\n \n@@ -891,30 +896,6 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\n \treturn nb_rx;\n }\n \n-/*\n- * Create memzone for device rings. malloc can't be used as the physical address is\n- * needed. If the memzone is already created, then this function returns a ptr\n- * to the old one.\n- */\n-static const struct rte_memzone *\n-ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name,\n-\t\t      uint16_t queue_id, uint32_t ring_size, int socket_id)\n-{\n-\tchar z_name[RTE_MEMZONE_NAMESIZE];\n-\tconst struct rte_memzone *mz;\n-\n-\tsnprintf(z_name, sizeof(z_name), \"%s_%s_%d_%d\",\n-\t\t dev->driver->pci_drv.driver.name, ring_name,\n-\t\t dev->data->port_id, queue_id);\n-\n-\tmz = rte_memzone_lookup(z_name);\n-\tif (mz)\n-\t\treturn mz;\n-\n-\treturn rte_memzone_reserve_aligned(z_name, ring_size,\n-\t\t\t\t\t   socket_id, 0, VMXNET3_RING_BA_ALIGN);\n-}\n-\n int\n vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev,\n \t\t\t   uint16_t queue_idx,\n@@ -983,11 +964,13 @@ vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev,\n \tsize += sizeof(struct Vmxnet3_TxCompDesc) * comp_ring->size;\n \tsize += txq->txdata_desc_size * data_ring->size;\n \n-\tmz = ring_dma_zone_reserve(dev, \"txdesc\", queue_idx, size, socket_id);\n+\tmz = rte_eth_dma_zone_reserve(dev, \"txdesc\", queue_idx, size,\n+\t\t\t\t      VMXNET3_RING_BA_ALIGN, socket_id);\n \tif (mz == NULL) {\n \t\tPMD_INIT_LOG(ERR, \"ERROR: Creating queue descriptors zone\");\n \t\treturn -ENOMEM;\n \t}\n+\ttxq->mz = mz;\n \tmemset(mz->addr, 0, mz->len);\n \n \t/* cmd_ring initialization */\n@@ -1092,11 +1075,13 @@ vmxnet3_dev_rx_queue_setup(struct rte_eth_dev *dev,\n \tif (VMXNET3_VERSION_GE_3(hw) && rxq->data_desc_size)\n \t\tsize += rxq->data_desc_size * data_ring->size;\n \n-\tmz = ring_dma_zone_reserve(dev, \"rxdesc\", queue_idx, size, socket_id);\n+\tmz = rte_eth_dma_zone_reserve(dev, \"rxdesc\", queue_idx, size,\n+\t\t\t\t      VMXNET3_RING_BA_ALIGN, socket_id);\n \tif (mz == NULL) {\n \t\tPMD_INIT_LOG(ERR, \"ERROR: Creating queue descriptors zone\");\n \t\treturn -ENOMEM;\n \t}\n+\trxq->mz = mz;\n \tmemset(mz->addr, 0, mz->len);\n \n \t/* cmd_ring0 initialization */\n",
    "prefixes": [
        "dpdk-dev"
    ]
}