Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/5346/?format=api
https://patches.dpdk.org/api/patches/5346/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1433938895-16331-2-git-send-email-michael.qiu@intel.com/", "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": "<1433938895-16331-2-git-send-email-michael.qiu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1433938895-16331-2-git-send-email-michael.qiu@intel.com", "date": "2015-06-10T12:21:34", "name": "[dpdk-dev,1/2] fm10k: Free queues when close port", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "d4f863f5ffec40be9af583de9d3f4e2922145170", "submitter": { "id": 101, "url": "https://patches.dpdk.org/api/people/101/?format=api", "name": "Michael Qiu", "email": "michael.qiu@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1433938895-16331-2-git-send-email-michael.qiu@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/5346/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/5346/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 C4F6C9A9E;\n\tWed, 10 Jun 2015 14:22:08 +0200 (CEST)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id F0CB21288\n\tfor <dev@dpdk.org>; Wed, 10 Jun 2015 14:22:06 +0200 (CEST)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga103.fm.intel.com with ESMTP; 10 Jun 2015 05:22:06 -0700", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga002.fm.intel.com with ESMTP; 10 Jun 2015 05:22:05 -0700", "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t5ACM3b8002763;\n\tWed, 10 Jun 2015 20:22:03 +0800", "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t5ACLxMV016374; Wed, 10 Jun 2015 20:22:01 +0800", "(from dayuqiu@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t5ACLxME016370; \n\tWed, 10 Jun 2015 20:21:59 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.13,587,1427785200\"; d=\"scan'208\";a=\"740770095\"", "From": "Michael Qiu <michael.qiu@intel.com>", "To": "dev@dpdk.org", "Date": "Wed, 10 Jun 2015 20:21:34 +0800", "Message-Id": "<1433938895-16331-2-git-send-email-michael.qiu@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1433938895-16331-1-git-send-email-michael.qiu@intel.com>", "References": "<1433083021-16701-1-git-send-email-michael.qiu@intel.com>\n\t<1433938895-16331-1-git-send-email-michael.qiu@intel.com>", "Cc": "shaopeng.he@intel.com", "Subject": "[dpdk-dev] [PATCH 1/2] fm10k: Free queues when close port", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <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": "When close a port, lots of memory should be released,\nsuch as software rings, queues, etc.\n\nSigned-off-by: Michael Qiu <michael.qiu@intel.com>\n---\n drivers/net/fm10k/fm10k_ethdev.c | 37 +++++++++++++++++++++++++++++++++----\n 1 file changed, 33 insertions(+), 4 deletions(-)", "diff": "diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c\nindex 87852ed..e310698 100644\n--- a/drivers/net/fm10k/fm10k_ethdev.c\n+++ b/drivers/net/fm10k/fm10k_ethdev.c\n@@ -52,6 +52,10 @@\n \n static void fm10k_close_mbx_service(struct fm10k_hw *hw);\n \n+static void fm10k_tx_queue_release(void *queue);\n+\n+static void fm10k_rx_queue_release(void *queue);\n+\n static void\n fm10k_mbx_initlock(struct fm10k_hw *hw)\n {\n@@ -665,11 +669,35 @@ fm10k_dev_stop(struct rte_eth_dev *dev)\n \n \tPMD_INIT_FUNC_TRACE();\n \n-\tfor (i = 0; i < dev->data->nb_tx_queues; i++)\n-\t\tfm10k_dev_tx_queue_stop(dev, i);\n+\tif (dev->data->tx_queues)\n+\t\tfor (i = 0; i < dev->data->nb_tx_queues; i++)\n+\t\t\tfm10k_dev_tx_queue_stop(dev, i);\n+\n+\tif (dev->data->rx_queues)\n+\t\tfor (i = 0; i < dev->data->nb_rx_queues; i++)\n+\t\t\tfm10k_dev_rx_queue_stop(dev, i);\n+}\n \n-\tfor (i = 0; i < dev->data->nb_rx_queues; i++)\n-\t\tfm10k_dev_rx_queue_stop(dev, i);\n+static void\n+fm10k_dev_queue_release(__rte_unused struct rte_eth_dev *dev)\n+{\n+\tint i;\n+\n+\tPMD_INIT_FUNC_TRACE();\n+\n+\tif (dev->data->tx_queues) {\n+\t\tfor (i = 0; i < dev->data->nb_tx_queues; i++)\n+\t\t\tfm10k_tx_queue_release(dev->data->tx_queues[i]);\n+\t\trte_free(dev->data->tx_queues);\n+\t\tdev->data->tx_queues = NULL;\n+\t}\n+\n+\tif (dev->data->rx_queues) {\n+\t\tfor (i = 0; i < dev->data->nb_rx_queues; i++)\n+\t\t\tfm10k_rx_queue_release(dev->data->rx_queues[i]);\n+\t\trte_free(dev->data->rx_queues);\n+\t\tdev->data->rx_queues = NULL;\n+\t}\n }\n \n static void\n@@ -682,6 +710,7 @@ fm10k_dev_close(struct rte_eth_dev *dev)\n \t/* Stop mailbox service first */\n \tfm10k_close_mbx_service(hw);\n \tfm10k_dev_stop(dev);\n+\tfm10k_dev_queue_release(dev);\n \tfm10k_stop_hw(hw);\n }\n \n", "prefixes": [ "dpdk-dev", "1/2" ] }{ "id": 5346, "url": "