Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/46443/?format=api
http://patches.dpdk.org/api/patches/46443/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20181009221732.17377-1-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": "<20181009221732.17377-1-thomas@monjalon.net>", "list_archive_url": "https://inbox.dpdk.org/dev/20181009221732.17377-1-thomas@monjalon.net", "date": "2018-10-09T22:17:32", "name": "[v2] ethdev: complete closing of port", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "3bad4d7f5348c2bd0419247200660f12be35f4da", "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/20181009221732.17377-1-thomas@monjalon.net/mbox/", "series": [ { "id": 1790, "url": "http://patches.dpdk.org/api/series/1790/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1790", "date": "2018-10-09T22:17:32", "name": "[v2] ethdev: complete closing of port", "version": 2, "mbox": "http://patches.dpdk.org/series/1790/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/46443/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/46443/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 0EF1C1B4D2;\n\tWed, 10 Oct 2018 00:17:44 +0200 (CEST)", "from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com\n\t[66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 893C61B4D1\n\tfor <dev@dpdk.org>; Wed, 10 Oct 2018 00:17:42 +0200 (CEST)", "from compute1.internal (compute1.nyi.internal [10.202.2.41])\n\tby mailout.nyi.internal (Postfix) with ESMTP id BD96020365;\n\tTue, 9 Oct 2018 18:17:41 -0400 (EDT)", "from mailfrontend2 ([10.202.2.163])\n\tby compute1.internal (MEProxy); Tue, 09 Oct 2018 18:17:41 -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 66A60102A0;\n\tTue, 9 Oct 2018 18:17:40 -0400 (EDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n\tfrom:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding; s=mesmtp; bh=OVxrJtur5N\n\tRTqu46RqzfIDYOvSpngHxuX68N+PZ8VYY=; b=hyp/1nCaRPWAlduDNyBh+gYlW2\n\tI4pICaX8ADa4R1+6+GSdMmopULITUUUGurYBXNmbgl51njUtoRuPlE14h/1YErzK\n\t/ZtwnjnlaZQFwTwJahaFhW6jGPscoTRwU8S2GScw6vi+Oc20ZM/s70Ay7i+soUOH\n\trYSvGqJmcn8ahrSqo=", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:content-transfer-encoding:date:from\n\t:in-reply-to:message-id:mime-version:references:subject:to\n\t:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=\n\tfm1; bh=OVxrJtur5NRTqu46RqzfIDYOvSpngHxuX68N+PZ8VYY=; b=woFyU0hR\n\tS1odXt+vZt/F2yNWSW7nP4uKyeDCkVgihjfpUgw7m70/3vhjzUAJvevt/fqs70KC\n\tc0ru6ebF6DA2RgJm6yYDN+Vr95z4KsWEN85CVUxxpSyIRHs/igkuMIO/g63lT+ke\n\tTnNlaqYAckr3hOr3gwIyQp3gpNTaghn/Xmc0Y+hxSxi+5onIdpDAZs2Te41EZLXx\n\tmO0M6j8adw/LYclj2H+mkDiQRIK9iSyOuO0eY0UprEWpGye+BD+byt5paQ2UFXvn\n\tZqtYeMmvJlCo33TDY8btemTUhsklaCqdvsEnSxccGI9aqNKbvW0wXJir48hJbo7L\n\thXtkFhcqvk2DwQ==" ], "X-ME-Sender": "<xms:BSm9WyFQ4_lya0Ttnz-1grlcr6DtgzR14VdpAWPyS0IdywB5vH3PMw>", "X-ME-Proxy": "<xmx:BSm9W_AL1UWuaUD4mqPeycaWidtrOgwZzOvr8iXnzkMFOLd8fBCptQ>\n\t<xmx:BSm9WwoYGs2HnOFDtlh-6SDh1PrYkCXbGD5uAk08sAZpxszMBplcUg>\n\t<xmx:BSm9W598xu8ryZKSwB3SfPuIkokqp-YlAPBjfQwMCqdsiR1ku-_d5A>\n\t<xmx:BSm9WxDYnyY2EgBcnfSLN5N2Bv--6SElr0pGXqySRFcxtOq1PHOBQA>\n\t<xmx:BSm9W7EIJStfP1LmE8srR7v82-0h3GmUF61DJzuJjNhI_5D7eTr62Q>\n\t<xmx:BSm9W0orbCqrKep14IO0bxXYM-AtkWdiPpsBxOs27_5coywgDXAhHA>", "From": "Thomas Monjalon <thomas@monjalon.net>", "To": "ferruh.yigit@intel.com,\n\tarybchenko@solarflare.com", "Cc": "dev@dpdk.org,\n\tophirmu@mellanox.com", "Date": "Wed, 10 Oct 2018 00:17:32 +0200", "Message-Id": "<20181009221732.17377-1-thomas@monjalon.net>", "X-Mailer": "git-send-email 2.19.0", "In-Reply-To": "<20180907233929.21950-1-thomas@monjalon.net>", "References": "<20180907233929.21950-1-thomas@monjalon.net>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v2] ethdev: complete closing of port", "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 blindly removing the associated rte_device, the driver should\ncheck if no more port (ethdev, cryptodev, etc) is open for the device.\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\nIf the driver is trying to free the port again, the function\nrte_eth_dev_release_port() will abort with -ENODEV error.\n\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\n---\n lib/librte_ethdev/rte_ethdev.c | 6 ++++++\n lib/librte_ethdev/rte_ethdev.h | 3 +--\n 2 files changed, 7 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex ed83e5954..3062dc711 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -506,6 +506,8 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)\n {\n \tif (eth_dev == NULL)\n \t\treturn -EINVAL;\n+\tif (eth_dev->state == RTE_ETH_DEV_UNUSED)\n+\t\treturn -ENODEV;\n \n \trte_eth_dev_shared_data_prepare();\n \n@@ -1441,6 +1443,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 a8942ff88..378c01afa 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -1846,8 +1846,7 @@ 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.\n+ * The function frees all port resources.\n *\n * @param port_id\n * The port identifier of the Ethernet device.\n", "prefixes": [ "v2" ] }{ "id": 46443, "url": "