get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 53157,
    "url": "http://patches.dpdk.org/api/patches/53157/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190429203325.10696-3-stephen@networkplumber.org/",
    "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": "<20190429203325.10696-3-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190429203325.10696-3-stephen@networkplumber.org",
    "date": "2019-04-29T20:33:25",
    "name": "[2/2] net/netvsc: free all queues on close",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "49e65c9cd649078ee90ea2f0924c8d4257ae8f3f",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "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/20190429203325.10696-3-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 4509,
            "url": "http://patches.dpdk.org/api/series/4509/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4509",
            "date": "2019-04-29T20:33:23",
            "name": "netvsc pmd fixes for 19.05",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4509/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/53157/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/53157/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 50B231B10E;\n\tMon, 29 Apr 2019 22:33:38 +0200 (CEST)",
            "from mail-pf1-f193.google.com (mail-pf1-f193.google.com\n\t[209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 803581B105\n\tfor <dev@dpdk.org>; Mon, 29 Apr 2019 22:33:32 +0200 (CEST)",
            "by mail-pf1-f193.google.com with SMTP id u17so1934867pfn.7\n\tfor <dev@dpdk.org>; Mon, 29 Apr 2019 13:33:32 -0700 (PDT)",
            "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\ti4sm3557424pfa.44.2019.04.29.13.33.29\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 29 Apr 2019 13:33:30 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=vOgnAzJjXJuiKSaZY/XjFaMuwTuY/SygBmNT+9wspLc=;\n\tb=qftRlekbYFDdgQ6qF2tmCiqKYCMl6reZss3ibA2wY8QDXDuAqhwFNHI3b6lK+3wiwt\n\tLblkkDUVYBiyCbB5GAGGZUz7Kj+IX8qFoGQ3maNadp5KBjvNhENu4vM4Bk4scuGL33bg\n\t28HCknBDH4jAr5ZiVT+MgR+SgLsLCLKCp6fvSOcnrFsdWVtn6hLY5rn71SKSaH5cwpb7\n\tMCw2rT/H9dj7uiJ0yIgQ6NFWN4Wsy+MgFXGfxpxQcMiCaPWfrYebFkKwnYI/iuVidiLr\n\tSVndSREOUYf4kQOuLCyHr/U9bQYVYsr5/+F9p33botN57VyqbpHPUVNDrikTSue2CXtU\n\tmeqA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=vOgnAzJjXJuiKSaZY/XjFaMuwTuY/SygBmNT+9wspLc=;\n\tb=OcZWpOUrHn2p+fQFdkiPInKwWnlfZ5hfKuOIPeKFI6giZoHDcSruYGIbAK3KOZroXZ\n\tVQTzT2W0S6Gpi8F76mFdLOiWUu4GUvJSrgqwfB0JQu77uJ0eoJZ5nSxVXwOYGyoZHjRd\n\tLLSk2y5McbrdyPRervs3KRNJsGubg1ohH5yDxl/yroO/J6J99o25eoVWl+YdHGEfYcsr\n\t0r7KOV9WOKrPYLPJV+yJQOD88FVubET8Qeo7/kKH/BnOaAASyy7Lf8x5YO+UUmK9OrZD\n\tGm+H6jd5Mw6SDVpWRf1Eo8x9xSRb4ZoabSYZeXAGMmGw/7DOzn35U+Mncpe4cTs47sOt\n\ttkdw==",
        "X-Gm-Message-State": "APjAAAURqaujNlpkEOH/ZF32fouyIeYlTU5HLAiDXBCRvujIHbemrajo\n\ta3Qr4jSIwwH+tsNk775KbSWBqn4BCus=",
        "X-Google-Smtp-Source": "APXvYqz1urpJUaQyihh88xEvhn+TQkv5inTq2EPDTaseWtWsUa4yb6UmnyBCt3t9DHVMzL9EQdg6rA==",
        "X-Received": "by 2002:a62:6086:: with SMTP id\n\tu128mr66785231pfb.148.1556570011359; \n\tMon, 29 Apr 2019 13:33:31 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n\tStephen Hemminger <sthemmin@microsoft.com>",
        "Date": "Mon, 29 Apr 2019 13:33:25 -0700",
        "Message-Id": "<20190429203325.10696-3-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190429203325.10696-1-stephen@networkplumber.org>",
        "References": "<20190429203325.10696-1-stephen@networkplumber.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 2/2] net/netvsc: free all queues on close",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "When dev_close is called, the netvsc driver will clean up all\nqueues including the primary ring buffer.\n\nSigned-off-by: Stephen Hemminger <sthemmin@microsoft.com>\n---\n drivers/net/netvsc/hn_ethdev.c |  8 +++++--\n drivers/net/netvsc/hn_rxtx.c   | 39 ++++++++++++++++++++++++++++------\n drivers/net/netvsc/hn_var.h    |  1 +\n 3 files changed, 40 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c\nindex 407ee484935a..553cb06f6e33 100644\n--- a/drivers/net/netvsc/hn_ethdev.c\n+++ b/drivers/net/netvsc/hn_ethdev.c\n@@ -112,6 +112,9 @@ eth_dev_vmbus_allocate(struct rte_vmbus_device *dev, size_t private_data_size)\n \teth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;\n \teth_dev->intr_handle = &dev->intr_handle;\n \n+\t/* allow ethdev to remove on close */\n+\teth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;\n+\n \treturn eth_dev;\n }\n \n@@ -632,11 +635,12 @@ hn_dev_stop(struct rte_eth_dev *dev)\n }\n \n static void\n-hn_dev_close(struct rte_eth_dev *dev __rte_unused)\n+hn_dev_close(struct rte_eth_dev *dev)\n {\n-\tPMD_INIT_LOG(DEBUG, \"close\");\n+\tPMD_INIT_FUNC_TRACE();\n \n \thn_vf_close(dev);\n+\thn_dev_free_queues(dev);\n }\n \n static const struct eth_dev_ops hn_eth_dev_ops = {\ndiff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c\nindex 7856f7e6ec48..1bebae7cddd4 100644\n--- a/drivers/net/netvsc/hn_rxtx.c\n+++ b/drivers/net/netvsc/hn_rxtx.c\n@@ -840,12 +840,9 @@ hn_dev_rx_queue_setup(struct rte_eth_dev *dev,\n \treturn error;\n }\n \n-void\n-hn_dev_rx_queue_release(void *arg)\n+static void\n+hn_rx_queue_free(struct hn_rx_queue *rxq, bool keep_primary)\n {\n-\tstruct hn_rx_queue *rxq = arg;\n-\n-\tPMD_INIT_FUNC_TRACE();\n \n \tif (!rxq)\n \t\treturn;\n@@ -857,12 +854,22 @@ hn_dev_rx_queue_release(void *arg)\n \thn_vf_rx_queue_release(rxq->hv, rxq->queue_id);\n \n \t/* Keep primary queue to allow for control operations */\n-\tif (rxq != rxq->hv->primary) {\n+\tif (keep_primary && rxq != rxq->hv->primary) {\n \t\trte_free(rxq->event_buf);\n \t\trte_free(rxq);\n \t}\n }\n \n+void\n+hn_dev_rx_queue_release(void *arg)\n+{\n+\tstruct hn_rx_queue *rxq = arg;\n+\n+\tPMD_INIT_FUNC_TRACE();\n+\n+\thn_rx_queue_free(rxq, true);\n+}\n+\n int\n hn_dev_tx_done_cleanup(void *arg, uint32_t free_cnt)\n {\n@@ -1440,3 +1447,23 @@ hn_recv_pkts(void *prxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\n \n \treturn nb_rcv;\n }\n+\n+void\n+hn_dev_free_queues(struct rte_eth_dev *dev)\n+{\n+\tunsigned int i;\n+\n+\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n+\t\tstruct hn_rx_queue *rxq = dev->data->rx_queues[i];\n+\n+\t\thn_rx_queue_free(rxq, false);\n+\t\tdev->data->rx_queues[i] = NULL;\n+\t}\n+\tdev->data->nb_rx_queues = 0;\n+\n+\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n+\t\thn_dev_tx_queue_release(dev->data->tx_queues[i]);\n+\t\tdev->data->tx_queues[i] = NULL;\n+\t}\n+\tdev->data->nb_tx_queues = 0;\n+}\ndiff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h\nindex 8383f3246ca4..de885d898e6a 100644\n--- a/drivers/net/netvsc/hn_var.h\n+++ b/drivers/net/netvsc/hn_var.h\n@@ -173,6 +173,7 @@ int\thn_dev_rx_queue_setup(struct rte_eth_dev *dev,\n \t\t\t      const struct rte_eth_rxconf *rx_conf,\n \t\t\t      struct rte_mempool *mp);\n void\thn_dev_rx_queue_release(void *arg);\n+void\thn_dev_free_queues(struct rte_eth_dev *dev);\n \n /* Check if VF is attached */\n static inline bool\n",
    "prefixes": [
        "2/2"
    ]
}