get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77563,
    "url": "http://patches.dpdk.org/api/patches/77563/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200913220711.3768597-13-thomas@monjalon.net/",
    "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": "<20200913220711.3768597-13-thomas@monjalon.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200913220711.3768597-13-thomas@monjalon.net",
    "date": "2020-09-13T22:07:03",
    "name": "[12/20] net/pcap: release port upon close",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "69b18d0c8efe07537ea0ead325df2907c5e1a03b",
    "submitter": {
        "id": 685,
        "url": "http://patches.dpdk.org/api/people/685/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas@monjalon.net"
    },
    "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/20200913220711.3768597-13-thomas@monjalon.net/mbox/",
    "series": [
        {
            "id": 12173,
            "url": "http://patches.dpdk.org/api/series/12173/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12173",
            "date": "2020-09-13T22:06:51",
            "name": "cleanup ethdev close operation",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/12173/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77563/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77563/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3F66FA04C9;\n\tMon, 14 Sep 2020 00:09:09 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9D5C61BE81;\n\tMon, 14 Sep 2020 00:08:21 +0200 (CEST)",
            "from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com\n [64.147.123.25]) by dpdk.org (Postfix) with ESMTP id 9BD592C52\n for <dev@dpdk.org>; Mon, 14 Sep 2020 00:08:20 +0200 (CEST)",
            "from compute7.internal (compute7.nyi.internal [10.202.2.47])\n by mailout.west.internal (Postfix) with ESMTP id 9B2AD5E2;\n Sun, 13 Sep 2020 18:08:19 -0400 (EDT)",
            "from mailfrontend2 ([10.202.2.163])\n by compute7.internal (MEProxy); Sun, 13 Sep 2020 18:08:19 -0400",
            "from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])\n by mail.messagingengine.com (Postfix) with ESMTPA id 84C8A306468B;\n Sun, 13 Sep 2020 18:08:18 -0400 (EDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding; s=fm2; bh=6/hE6eJbweWmL\n LY195w3fUApOT5EDkL5gWPO0g/wGhg=; b=AdCEWQEabDIZElFXHxPCcYbMv8fmc\n Nb0cKQGKSha7RDppMxjAslJlX/ULzgLBre4yl03KJ0gRefgbkQXWuXEdARgD6uJo\n Xxxl1TdtAh4w1ARlk/XFvUyLEsTsQG3Cd+/G8zLQUjT5aJzupikRjfS3Kg7aTr5b\n B/fvfUtvmxGsBvehnWW2zGPpvk5C+UVYBg8eELPpQJrjrrjgMx68Oo3y9BIyK7Se\n FXRbMOv8Kazawg/sAsFuQ0uc5jMNggZC2uMbfT5iZq+/ceUuaVASrLNw/vBLHoLP\n C+eQjwM7lTMEniGrg0J80BoOs/1xFZ5hsPJxHCIrhmQxnU6Pm1ZB8vEBg==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n messagingengine.com; h=cc:content-transfer-encoding:date:from\n :in-reply-to:message-id:mime-version:references:subject:to\n :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=\n fm3; bh=6/hE6eJbweWmLLY195w3fUApOT5EDkL5gWPO0g/wGhg=; b=K1UP6gVJ\n Rr7YC+fsU2ws5/HwKAqzEFSrRwGCbgWStI/Pws58fbjrt+1OY1LTJ5/Ca3aflfoi\n DCmtgNy6b5Y3K7hjvqi7+7Slfad6M5AFTkrrhOij4c8BAwpwdNvIv2XAG5oZlSZk\n TRDrJdXb7x2xFSPqvizMY3NmGf3PyQmGKh9VWTJIDqmXU4x7q1PogE79oX56XXU9\n yh47dW4Wg8v3oZxkFjc4jvzZhEp3kvDdlb81ZMfVoRNVWx8i8MWRgCJ1Hr8kxhzG\n nmE7UEmLg3yqyGh0B/xDWA2rFMztcdJl4kWI75X34e+9oykWBN7OaTdOwmZDSqVz\n 30iyWGs50e9lGQ=="
        ],
        "X-ME-Sender": "<xms:U5heXxUj-A06rlgDYg5-lZ0WAJIfldSugqFnFw1iGqtu5Nqrap_6yA>\n <xme:U5heXxnqfbcweSqhnrXWizhO6NaSmdeBP8ZzOkXiYpV3DJKLtg9Ulj-dWzDdHDkf-\n 6GM0mfdhmVuioTNlg>",
        "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgeduiedrudeihedgtdehucetufdoteggodetrfdotf\n fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen\n uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne\n cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr\n shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg\n ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg\n uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf\n hiiigvpeduvdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr\n lhhonhdrnhgvth",
        "X-ME-Proxy": "<xmx:U5heX9Z6W7URFb3r62kz1zZUCUsx0vx1KddtKQT5k72xlP3C4HwFGQ>\n <xmx:U5heX0X9en4MfZa1Ous_5hoCFMYDBaZ78oSI5z-292OZ_vAyuQlD4w>\n <xmx:U5heX7mYyecpQ__-lGqRaTR1XXZr5QnmrODbWYJeDN8ww-KlUfcgew>\n <xmx:U5heXzuMeEJx0VERZhi16abDuVhO6hk1WVq3SC1BMA9ooABl5Keo1g>",
        "From": "Thomas Monjalon <thomas@monjalon.net>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com, arybchenko@solarflare.com,\n Anatoly Burakov <anatoly.burakov@intel.com>",
        "Date": "Mon, 14 Sep 2020 00:07:03 +0200",
        "Message-Id": "<20200913220711.3768597-13-thomas@monjalon.net>",
        "X-Mailer": "git-send-email 2.28.0",
        "In-Reply-To": "<20200913220711.3768597-1-thomas@monjalon.net>",
        "References": "<20200913220711.3768597-1-thomas@monjalon.net>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 12/20] net/pcap: release port upon 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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources\ncan be freed by rte_eth_dev_close().\n\nFreeing of private port resources is moved\nfrom the \".remove(device)\" to the \".dev_close(port)\" operation.\n\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\n---\n drivers/net/pcap/rte_eth_pcap.c | 29 ++++++++++++++---------------\n 1 file changed, 14 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c\nindex 76e704a65a..a946fa9a1a 100644\n--- a/drivers/net/pcap/rte_eth_pcap.c\n+++ b/drivers/net/pcap/rte_eth_pcap.c\n@@ -734,6 +734,12 @@ eth_dev_close(struct rte_eth_dev *dev)\n \tunsigned int i;\n \tstruct pmd_internals *internals = dev->data->dev_private;\n \n+\tif (internals == NULL)\n+\t\treturn 0;\n+\n+\tPMD_LOG(INFO, \"Closing pcap ethdev on NUMA socket %d\",\n+\t\t\trte_socket_id());\n+\n \t/* Device wide flag, but cleanup must be performed per queue. */\n \tif (internals->infinite_rx) {\n \t\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n@@ -748,6 +754,12 @@ eth_dev_close(struct rte_eth_dev *dev)\n \t\t}\n \t}\n \n+\trte_free(dev->process_private);\n+\n+\tif (internals->phy_mac == 0)\n+\t\t/* not dynamically allocated, must not be freed */\n+\t\tdev->data->mac_addrs = NULL;\n+\n \treturn 0;\n }\n \n@@ -1322,6 +1334,7 @@ eth_from_pcaps(struct rte_vdev_device *vdev,\n \telse\n \t\teth_dev->tx_pkt_burst = eth_tx_drop;\n \n+\teth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;\n \trte_eth_dev_probing_finish(eth_dev);\n \treturn 0;\n }\n@@ -1544,30 +1557,16 @@ pmd_pcap_probe(struct rte_vdev_device *dev)\n static int\n pmd_pcap_remove(struct rte_vdev_device *dev)\n {\n-\tstruct pmd_internals *internals = NULL;\n \tstruct rte_eth_dev *eth_dev = NULL;\n \n-\tPMD_LOG(INFO, \"Closing pcap ethdev on numa socket %d\",\n-\t\t\trte_socket_id());\n-\n \tif (!dev)\n \t\treturn -1;\n \n-\t/* reserve an ethdev entry */\n \teth_dev = rte_eth_dev_allocated(rte_vdev_device_name(dev));\n \tif (eth_dev == NULL)\n-\t\treturn -1;\n-\n-\tif (rte_eal_process_type() == RTE_PROC_PRIMARY) {\n-\t\tinternals = eth_dev->data->dev_private;\n-\t\tif (internals != NULL && internals->phy_mac == 0)\n-\t\t\t/* not dynamically allocated, must not be freed */\n-\t\t\teth_dev->data->mac_addrs = NULL;\n-\t}\n+\t\treturn 0; /* port already released */\n \n \teth_dev_close(eth_dev);\n-\n-\trte_free(eth_dev->process_private);\n \trte_eth_dev_release_port(eth_dev);\n \n \treturn 0;\n",
    "prefixes": [
        "12/20"
    ]
}