Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/127673/?format=api
http://patchwork.dpdk.org/api/patches/127673/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230529130940.1501-6-liudongdong3@huawei.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20230529130940.1501-6-liudongdong3@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230529130940.1501-6-liudongdong3@huawei.com", "date": "2023-05-29T13:09:34", "name": "[05/11] net/hns3: fix mbuf leak when start rxq in resetting", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "bfc1d89a8b8ca30b5ee49402a8e36c68f821d8b1", "submitter": { "id": 2718, "url": "http://patchwork.dpdk.org/api/people/2718/?format=api", "name": "Dongdong Liu", "email": "liudongdong3@huawei.com" }, "delegate": { "id": 319, "url": "http://patchwork.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230529130940.1501-6-liudongdong3@huawei.com/mbox/", "series": [ { "id": 28237, "url": "http://patchwork.dpdk.org/api/series/28237/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28237", "date": "2023-05-29T13:09:32", "name": "net/hns3: add some bugfixes for hns3", "version": 1, "mbox": "http://patchwork.dpdk.org/series/28237/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/127673/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/127673/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3739F42BD3;\n\tMon, 29 May 2023 15:13:06 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6A95942D74;\n\tMon, 29 May 2023 15:12:27 +0200 (CEST)", "from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189])\n by mails.dpdk.org (Postfix) with ESMTP id 0E60442D64;\n Mon, 29 May 2023 15:12:25 +0200 (CEST)", "from kwepemi500017.china.huawei.com (unknown [172.30.72.56])\n by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4QVG9V2gPBzLmSx;\n Mon, 29 May 2023 21:10:38 +0800 (CST)", "from localhost.localdomain (10.28.79.22) by\n kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2507.23; Mon, 29 May 2023 21:12:11 +0800" ], "From": "Dongdong Liu <liudongdong3@huawei.com>", "To": "<dev@dpdk.org>, <ferruh.yigit@amd.com>, <thomas@monjalon.net>,\n <andrew.rybchenko@oktetlabs.ru>, <fengchengwen@huawei.com>", "CC": "<stable@dpdk.org>, <lihuisong@huawei.com>, <liudongdong3@huawei.com>,\n <yisen.zhuang@huawei.com>, <huangdengdui@huawei.com>", "Subject": "[PATCH 05/11] net/hns3: fix mbuf leak when start rxq in resetting", "Date": "Mon, 29 May 2023 21:09:34 +0800", "Message-ID": "<20230529130940.1501-6-liudongdong3@huawei.com>", "X-Mailer": "git-send-email 2.22.0", "In-Reply-To": "<20230529130940.1501-1-liudongdong3@huawei.com>", "References": "<20230529130940.1501-1-liudongdong3@huawei.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Originating-IP": "[10.28.79.22]", "X-ClientProxiedBy": "dggems704-chm.china.huawei.com (10.3.19.181) To\n kwepemi500017.china.huawei.com (7.221.188.110)", "X-CFilter-Loop": "Reflected", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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" }, "content": "From: Chengwen Feng <fengchengwen@huawei.com>\n\nIn the reset restore-conf phase, the reset process will allocate for\nthe Rx ring mbufs unconditionlly.\n\nAnd the rte_eth_dev_rx_queue_start() will also allocate for the Rx ring\nmbufs unconditionlly.\n\nSo if the rte_eth_dev_rx_queue_start() is invoked before restore-conf\nphase, then the mbufs allocated by rte_eth_dev_rx_queue_start() will\nleak.\n\nBecause the hw->reset.resetting was always true during the phases from\nstop-service to restore-conf, so fix it by returning an error if the\nhw->reset.resetting is set.\n\nThis patch adds the above logic in both rx_queue_start/rx_queue_stop/\ntx_queue_start/tx_queue_stop ops.\n\nFixes: fa29fe45a7b4 (\"net/hns3: support queue start and stop\")\nCc: stable@dpdk.org\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\nSigned-off-by: Dongdong Liu <liudongdong3@huawei.com>\n---\n drivers/net/hns3/hns3_rxtx.c | 28 ++++++++++++++++++++++++++++\n 1 file changed, 28 insertions(+)", "diff": "diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c\nindex 6468da903e..2bfc5507e3 100644\n--- a/drivers/net/hns3/hns3_rxtx.c\n+++ b/drivers/net/hns3/hns3_rxtx.c\n@@ -4523,6 +4523,13 @@ hns3_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \t\treturn -ENOTSUP;\n \n \trte_spinlock_lock(&hw->lock);\n+\n+\tif (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED)) {\n+\t\thns3_err(hw, \"fail to start Rx queue during resetting.\");\n+\t\trte_spinlock_unlock(&hw->lock);\n+\t\treturn -EIO;\n+\t}\n+\n \tret = hns3_reset_queue(hw, rx_queue_id, HNS3_RING_TYPE_RX);\n \tif (ret) {\n \t\thns3_err(hw, \"fail to reset Rx queue %u, ret = %d.\",\n@@ -4569,6 +4576,13 @@ hns3_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \t\treturn -ENOTSUP;\n \n \trte_spinlock_lock(&hw->lock);\n+\n+\tif (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED)) {\n+\t\thns3_err(hw, \"fail to stop Rx queue during resetting.\");\n+\t\trte_spinlock_unlock(&hw->lock);\n+\t\treturn -EIO;\n+\t}\n+\n \thns3_enable_rxq(rxq, false);\n \n \thns3_rx_queue_release_mbufs(rxq);\n@@ -4591,6 +4605,13 @@ hns3_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)\n \t\treturn -ENOTSUP;\n \n \trte_spinlock_lock(&hw->lock);\n+\n+\tif (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED)) {\n+\t\thns3_err(hw, \"fail to start Tx queue during resetting.\");\n+\t\trte_spinlock_unlock(&hw->lock);\n+\t\treturn -EIO;\n+\t}\n+\n \tret = hns3_reset_queue(hw, tx_queue_id, HNS3_RING_TYPE_TX);\n \tif (ret) {\n \t\thns3_err(hw, \"fail to reset Tx queue %u, ret = %d.\",\n@@ -4617,6 +4638,13 @@ hns3_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)\n \t\treturn -ENOTSUP;\n \n \trte_spinlock_lock(&hw->lock);\n+\n+\tif (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED)) {\n+\t\thns3_err(hw, \"fail to stop Tx queue during resetting.\");\n+\t\trte_spinlock_unlock(&hw->lock);\n+\t\treturn -EIO;\n+\t}\n+\n \thns3_enable_txq(txq, false);\n \thns3_tx_queue_release_mbufs(txq);\n \t/*\n", "prefixes": [ "05/11" ] }{ "id": 127673, "url": "