get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 44442,
    "url": "https://patches.dpdk.org/api/patches/44442/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180907233929.21950-1-thomas@monjalon.net/",
    "project": {
        "id": 1,
        "url": "https://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": "<20180907233929.21950-1-thomas@monjalon.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180907233929.21950-1-thomas@monjalon.net",
    "date": "2018-09-07T23:39:29",
    "name": "[RFC] ethdev: complete closing to free all resources",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "27bba5a89ef071d8893bc7207f437a5ee52dfa95",
    "submitter": {
        "id": 685,
        "url": "https://patches.dpdk.org/api/people/685/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas@monjalon.net"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20180907233929.21950-1-thomas@monjalon.net/mbox/",
    "series": [
        {
            "id": 1238,
            "url": "https://patches.dpdk.org/api/series/1238/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1238",
            "date": "2018-09-07T23:39:29",
            "name": "[RFC] ethdev: complete closing to free all resources",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/1238/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/44442/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/44442/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 2D70B5F1C;\n\tSat,  8 Sep 2018 01:39:35 +0200 (CEST)",
            "from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com\n\t[66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 5AC2A5F17\n\tfor <dev@dpdk.org>; Sat,  8 Sep 2018 01:39:33 +0200 (CEST)",
            "from compute1.internal (compute1.nyi.internal [10.202.2.41])\n\tby mailout.nyi.internal (Postfix) with ESMTP id DDC0121FF6;\n\tFri,  7 Sep 2018 19:39:32 -0400 (EDT)",
            "from mailfrontend2 ([10.202.2.163])\n\tby compute1.internal (MEProxy); Fri, 07 Sep 2018 19:39:32 -0400",
            "from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])\n\tby mail.messagingengine.com (Postfix) with ESMTPA id D2B801028D;\n\tFri,  7 Sep 2018 19:39:31 -0400 (EDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n\tcc:date:from:message-id:subject:to:x-me-sender:x-me-sender\n\t:x-sasl-enc; s=mesmtp; bh=pm+v5w5wRijmYxSqV0Ax2v3ouiTbOyyZjNQDwh\n\tfWjKw=; b=SPWh9CjbrtrYvp+JYjOnnmn7pvWMGGA8UfzL0xu30jZHq+MyKDUxTy\n\ts3w/meYHbjdzDEM3fWbgjtKaWR9/MME8SkiNZl8JZBChHykLDgH2O5gtwAJJJjSB\n\t5mDZFaCGuvEUTEhQCO0lyUQC5b+u88gaVArRVTHbB6kkRhkLG8oeM=",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:date:from:message-id:subject:to\n\t:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=pm+v5w5wRijmYxSqV\n\t0Ax2v3ouiTbOyyZjNQDwhfWjKw=; b=tImmoVo5zEjxznptOfj58osa9xBbkYeFA\n\tnHJ/09Mbxt1ssDYafFFUZ+YD4nrWIGB33so/5z3dIoLTn2D128V0/DiFiRksimnJ\n\tzAHifgs+4Pv9KluMwkM9Z6D2CXoTdIvuMB/4GVOeGMrLzqenyAadHtlot6MRACNJ\n\tvf9gOy4lM5lHfvHe4h820k+WPDq/TgpxZzJRqEIUQ85GuGkHG7bzDQGesvLjynl7\n\tw7S837xCKB1rLbGUiZHP/h4FlqFmztWKWZgEMRt0tenxSmoB+eNck/xgtJ8y+jkQ\n\tw6CFZEoYcvSAEYS5rxyVq6b0W+YGvN6IpRhwxOU9rXrU/LWLo/y4g=="
        ],
        "X-ME-Proxy": "<xmx:NAyTW6x04YWwFju1YUDYc4AheghDsGx6KmwKirOvhv2TkOs4WjhP4A>\n\t<xmx:NAyTW29BqSsB5nAFVR1Dl8ofn9GkXfsQ85DPer6Ip9L_3dPepXFqhg>\n\t<xmx:NAyTW3b9JWt09UZute-7B15nXQVvjQ05r1qM7WymMt6T1eDDqN703A>\n\t<xmx:NAyTWwjBfSDd4eLZewPGF8yO-MBUWSdPSn_BajCgu347PjDrb1OBjA>\n\t<xmx:NAyTW-_pqsYKpD-1U3cUVRvbg6DWajxQLyNMR_vZXNsto5j0wfXKoA>\n\t<xmx:NAyTWxRa4Fvy4LmJBlmUFnsIq94o-3MpiGapR8CQ6Wraozr3NCw4ug>",
        "X-ME-Sender": "<xms:NAyTW4bj1TrbJdC_Vq57Pq8I4kkumWYume-wj_69-xcEVENdiuqlBw>",
        "From": "Thomas Monjalon <thomas@monjalon.net>",
        "To": "ferruh.yigit@intel.com,\n\tarybchenko@solarflare.com",
        "Cc": "dev@dpdk.org",
        "Date": "Sat,  8 Sep 2018 01:39:29 +0200",
        "Message-Id": "<20180907233929.21950-1-thomas@monjalon.net>",
        "X-Mailer": "git-send-email 2.18.0",
        "Subject": "[dpdk-dev] [RFC] ethdev: complete closing to free all resources",
        "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": "After closing a port, it cannot be restarted.\nSo there is no reason to not free all associated resources.\n\nThe last step was done with rte_eth_dev_detach() which is deprecated.\nInstead of removing the associated rte_device, the driver should check\nif no more port (ethdev, cryptodev, etc) is still open for the device.\nThen the device resources can be freed by the driver inside the\ndev_close() driver callback operation.\n\nThe last ethdev freeing (dev_private and final release), which were done\nby rte_eth_dev_detach(), are now done at the end of rte_eth_dev_close().\n\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\n---\nThis patch contains only the change in the close function as RFC.\n\nThis idea was presented at Dublin during the \"hotplug talk\".\n---\n lib/librte_ethdev/rte_ethdev.c | 5 +++++\n lib/librte_ethdev/rte_ethdev.h | 5 +++--\n 2 files changed, 8 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 4c3202505..071fcbd23 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -1358,6 +1358,7 @@ void\n rte_eth_dev_close(uint16_t port_id)\n {\n \tstruct rte_eth_dev *dev;\n+\tstruct rte_bus *bus;\n \n \tRTE_ETH_VALID_PORTID_OR_RET(port_id);\n \tdev = &rte_eth_devices[port_id];\n@@ -1372,6 +1373,10 @@ rte_eth_dev_close(uint16_t port_id)\n \tdev->data->nb_tx_queues = 0;\n \trte_free(dev->data->tx_queues);\n \tdev->data->tx_queues = NULL;\n+\n+\trte_free(dev->data->dev_private);\n+\n+\trte_eth_dev_release_port(dev);\n }\n \n int\ndiff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h\nindex 7070e9ab4..37a757a7a 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -1797,8 +1797,9 @@ int rte_eth_dev_set_link_down(uint16_t port_id);\n \n /**\n  * Close a stopped Ethernet device. The device cannot be restarted!\n- * The function frees all resources except for needed by the\n- * closed state. To free these resources, call rte_eth_dev_detach().\n+ * The function frees all port resources.\n+ * If there is no more port associated with the underlying device,\n+ * the driver should free the device resources.\n  *\n  * @param port_id\n  *   The port identifier of the Ethernet device.\n",
    "prefixes": [
        "RFC"
    ]
}