Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/69547/?format=api
https://patches.dpdk.org/api/patches/69547/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200429111328.64952-6-huwei013@chinasoftinc.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": "<20200429111328.64952-6-huwei013@chinasoftinc.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200429111328.64952-6-huwei013@chinasoftinc.com", "date": "2020-04-29T11:13:27", "name": "[5/6] net/hns3: fix MSI-x interrupt number during initialization", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "0ecbdc5cc32e57bf2671b5e6b2c7844843205926", "submitter": { "id": 1537, "url": "https://patches.dpdk.org/api/people/1537/?format=api", "name": "Wei Hu (Xavier)", "email": "huwei013@chinasoftinc.com" }, "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/20200429111328.64952-6-huwei013@chinasoftinc.com/mbox/", "series": [ { "id": 9733, "url": "https://patches.dpdk.org/api/series/9733/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=9733", "date": "2020-04-29T11:13:22", "name": "misc updates and bugfixes for hns3 PMD driver", "version": 1, "mbox": "https://patches.dpdk.org/series/9733/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/69547/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/69547/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 E3739A00BE;\n\tWed, 29 Apr 2020 13:14:31 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2C6F91DA64;\n\tWed, 29 Apr 2020 13:14:05 +0200 (CEST)", "from mail.chinasoftinc.com (unknown [114.113.233.8])\n by dpdk.org (Postfix) with ESMTP id C7FDD1DA4E\n for <dev@dpdk.org>; Wed, 29 Apr 2020 13:13:57 +0200 (CEST)", "from localhost.localdomain (114.119.4.74) by INCCAS002.ito.icss\n (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Wed, 29 Apr 2020\n 19:13:39 +0800" ], "From": "\"Wei Hu (Xavier)\" <huwei013@chinasoftinc.com>", "To": "<dev@dpdk.org>", "Date": "Wed, 29 Apr 2020 19:13:27 +0800", "Message-ID": "<20200429111328.64952-6-huwei013@chinasoftinc.com>", "X-Mailer": "git-send-email 2.23.0", "In-Reply-To": "<20200429111328.64952-1-huwei013@chinasoftinc.com>", "References": "<20200429111328.64952-1-huwei013@chinasoftinc.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Originating-IP": "[114.119.4.74]", "Subject": "[dpdk-dev] [PATCH 5/6] net/hns3: fix MSI-x interrupt number during\n\tinitialization", "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": "From: \"Wei Hu (Xavier)\" <xavier.huwei@huawei.com>\n\nCurrnetly, based on hns3 VF device error may occur during initialization.\n\nThe root cause as below:\nWhen the following fomula is excuted during initialization, the private\nvariable named hw->tqps_num has not been obtained from PF driver through\nmailbox, further causes failure when mapping interrupt and queues.\n hw->num_msi = (num_msi > hw->tqps_num + 1) ? hw->tqps_num + 1 : num_msi;\nWe need to use hw->tqp_num after it is correctly assigned.\n\nOn the other hand, because the private variable named hw->num_msi, which\nrepresents the number of MSI-x interrupt of hns3 PF/VF device, is used in\nthe '.get_reg' ops implementation function to dump all interrupt related\nregisters, it should be obtained from firmware directly and we'd better\nnot modify it in the driver.\n\nFixes: ef2e785c36cf (\"net/hns3: fix Tx interrupt when enabling Rx interrupt\")\nFixes: 02a7b55657b2 (\"net/hns3: support Rx interrupt\")\nCc: stable@dpdk.org\n\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\nSigned-off-by: Hao Chen <chenhao164@huawei.com>\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\n---\n drivers/net/hns3/hns3_ethdev.c | 10 +++++-----\n drivers/net/hns3/hns3_ethdev_vf.c | 5 +++--\n 2 files changed, 8 insertions(+), 7 deletions(-)", "diff": "diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex 1fac4f366..a09ac082e 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -2236,7 +2236,8 @@ hns3_init_ring_with_vector(struct hns3_hw *hw)\n \t * Rx interrupt.\n \t */\n \tvec = hw->num_msi - 1; /* vector 0 for misc interrupt, not for queue */\n-\thw->intr_tqps_num = vec - 1; /* the last interrupt is reserved */\n+\t/* vec - 1: the last interrupt is reserved */\n+\thw->intr_tqps_num = vec > hw->tqps_num ? hw->tqps_num : vec - 1;\n \tfor (i = 0; i < hw->intr_tqps_num; i++) {\n \t\t/*\n \t\t * Set gap limiter and rate limiter configuration of queue's\n@@ -2625,7 +2626,6 @@ hns3_query_pf_resource(struct hns3_hw *hw)\n \tstruct hns3_pf *pf = &hns->pf;\n \tstruct hns3_pf_res_cmd *req;\n \tstruct hns3_cmd_desc desc;\n-\tuint16_t num_msi;\n \tint ret;\n \n \thns3_cmd_setup_basic_desc(&desc, HNS3_OPC_QUERY_PF_RSRC, true);\n@@ -2657,9 +2657,9 @@ hns3_query_pf_resource(struct hns3_hw *hw)\n \n \tpf->dv_buf_size = roundup(pf->dv_buf_size, HNS3_BUF_SIZE_UNIT);\n \n-\tnum_msi = hns3_get_field(rte_le_to_cpu_16(req->pf_intr_vector_number),\n-\t\t\t\t HNS3_VEC_NUM_M, HNS3_VEC_NUM_S);\n-\thw->num_msi = (num_msi > hw->tqps_num + 1) ? hw->tqps_num + 1 : num_msi;\n+\thw->num_msi =\n+\t hns3_get_field(rte_le_to_cpu_16(req->pf_intr_vector_number),\n+\t\t\t HNS3_VEC_NUM_M, HNS3_VEC_NUM_S);\n \n \treturn 0;\n }\ndiff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c\nindex e26089065..904562e03 100644\n--- a/drivers/net/hns3/hns3_ethdev_vf.c\n+++ b/drivers/net/hns3/hns3_ethdev_vf.c\n@@ -713,7 +713,8 @@ hns3vf_init_ring_with_vector(struct hns3_hw *hw)\n \t * Rx interrupt.\n \t */\n \tvec = hw->num_msi - 1; /* vector 0 for misc interrupt, not for queue */\n-\thw->intr_tqps_num = vec - 1; /* the last interrupt is reserved */\n+\t/* vec - 1: the last interrupt is reserved */\n+\thw->intr_tqps_num = vec > hw->tqps_num ? hw->tqps_num : vec - 1;\n \tfor (i = 0; i < hw->intr_tqps_num; i++) {\n \t\t/*\n \t\t * Set gap limiter and rate limiter configuration of queue's\n@@ -1473,7 +1474,7 @@ hns3_query_vf_resource(struct hns3_hw *hw)\n \t\treturn -EINVAL;\n \t}\n \n-\thw->num_msi = (num_msi > hw->tqps_num + 1) ? hw->tqps_num + 1 : num_msi;\n+\thw->num_msi = num_msi;\n \n \treturn 0;\n }\n", "prefixes": [ "5/6" ] }{ "id": 69547, "url": "