Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/87083/?format=api
http://patches.dpdk.org/api/patches/87083/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1611310732-51975-8-git-send-email-oulijun@huawei.com/", "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": "<1611310732-51975-8-git-send-email-oulijun@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1611310732-51975-8-git-send-email-oulijun@huawei.com", "date": "2021-01-22T10:18:45", "name": "[07/14] net/hns3: refactor reset event report function", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "71a01841f2e6a87c91c103362d442ab0c6171726", "submitter": { "id": 1675, "url": "http://patches.dpdk.org/api/people/1675/?format=api", "name": "Lijun Ou", "email": "oulijun@huawei.com" }, "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/1611310732-51975-8-git-send-email-oulijun@huawei.com/mbox/", "series": [ { "id": 14903, "url": "http://patches.dpdk.org/api/series/14903/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=14903", "date": "2021-01-22T10:18:38", "name": "Misc updates for hns3", "version": 1, "mbox": "http://patches.dpdk.org/series/14903/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/87083/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/87083/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 798D6A0A0A;\n\tFri, 22 Jan 2021 11:19:48 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DD36F140F20;\n\tFri, 22 Jan 2021 11:19:21 +0100 (CET)", "from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191])\n by mails.dpdk.org (Postfix) with ESMTP id 5AE17140F0D\n for <dev@dpdk.org>; Fri, 22 Jan 2021 11:19:16 +0100 (CET)", "from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58])\n by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DMZvx5drpzjC0F;\n Fri, 22 Jan 2021 18:18:05 +0800 (CST)", "from localhost.localdomain (10.69.192.56) by\n DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id\n 14.3.498.0; Fri, 22 Jan 2021 18:19:11 +0800" ], "From": "Lijun Ou <oulijun@huawei.com>", "To": "<thomas@monjalon.net>, <ferruh.yigit@intel.com>", "CC": "<dev@dpdk.org>, <linuxarm@openeuler.org>", "Date": "Fri, 22 Jan 2021 18:18:45 +0800", "Message-ID": "<1611310732-51975-8-git-send-email-oulijun@huawei.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1611310732-51975-1-git-send-email-oulijun@huawei.com>", "References": "<1611310732-51975-1-git-send-email-oulijun@huawei.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.69.192.56]", "X-CFilter-Loop": "Reflected", "Subject": "[dpdk-dev] [PATCH 07/14] net/hns3: refactor reset event report\n function", "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", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Here encapsulate the process code of the imp reset report and\nglobal reset report into function in order to reduce the\ncomplexity of the hns3_check_event_cause function.\n\nSigned-off-by: Lijun Ou <oulijun@huawei.com>\n---\n drivers/net/hns3/hns3_ethdev.c | 69 +++++++++++++++++++++++++++---------------\n 1 file changed, 45 insertions(+), 24 deletions(-)", "diff": "diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex f3ce639..817d1dc 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -123,6 +123,47 @@ hns3_pf_enable_irq0(struct hns3_hw *hw)\n }\n \n static enum hns3_evt_cause\n+hns3_proc_imp_reset_event(struct hns3_adapter *hns, bool is_delay,\n+\t\t\t uint32_t *vec_val)\n+{\n+\tstruct hns3_hw *hw = &hns->hw;\n+\n+\trte_atomic16_set(&hw->reset.disable_cmd, 1);\n+\thns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);\n+\t*vec_val = BIT(HNS3_VECTOR0_IMPRESET_INT_B);\n+\tif (!is_delay) {\n+\t\thw->reset.stats.imp_cnt++;\n+\t\thns3_warn(hw, \"IMP reset detected, clear reset status\");\n+\t} else {\n+\t\thns3_schedule_delayed_reset(hns);\n+\t\thns3_warn(hw, \"IMP reset detected, don't clear reset status\");\n+\t}\n+\n+\treturn HNS3_VECTOR0_EVENT_RST;\n+}\n+\n+static enum hns3_evt_cause\n+hns3_proc_global_reset_event(struct hns3_adapter *hns, bool is_delay,\n+\t\t\t uint32_t *vec_val)\n+{\n+\tstruct hns3_hw *hw = &hns->hw;\n+\n+\trte_atomic16_set(&hw->reset.disable_cmd, 1);\n+\thns3_atomic_set_bit(HNS3_GLOBAL_RESET, &hw->reset.pending);\n+\t*vec_val = BIT(HNS3_VECTOR0_GLOBALRESET_INT_B);\n+\tif (!is_delay) {\n+\t\thw->reset.stats.global_cnt++;\n+\t\thns3_warn(hw, \"Global reset detected, clear reset status\");\n+\t} else {\n+\t\thns3_schedule_delayed_reset(hns);\n+\t\thns3_warn(hw,\n+\t\t\t \"Global reset detected, don't clear reset status\");\n+\t}\n+\n+\treturn HNS3_VECTOR0_EVENT_RST;\n+}\n+\n+static enum hns3_evt_cause\n hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)\n {\n \tstruct hns3_hw *hw = &hns->hw;\n@@ -131,12 +172,14 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)\n \tuint32_t hw_err_src_reg;\n \tuint32_t val;\n \tenum hns3_evt_cause ret;\n+\tbool is_delay;\n \n \t/* fetch the events from their corresponding regs */\n \tvector0_int_stats = hns3_read_dev(hw, HNS3_VECTOR0_OTHER_INT_STS_REG);\n \tcmdq_src_val = hns3_read_dev(hw, HNS3_VECTOR0_CMDQ_SRC_REG);\n \thw_err_src_reg = hns3_read_dev(hw, HNS3_RAS_PF_OTHER_INT_STS_REG);\n \n+\tis_delay = clearval == NULL ? true : false;\n \t/*\n \t * Assumption: If by any chance reset and mailbox events are reported\n \t * together then we will only process reset event and defer the\n@@ -145,35 +188,13 @@ hns3_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)\n \t * from H/W just for the mailbox.\n \t */\n \tif (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & vector0_int_stats) { /* IMP */\n-\t\trte_atomic16_set(&hw->reset.disable_cmd, 1);\n-\t\thns3_atomic_set_bit(HNS3_IMP_RESET, &hw->reset.pending);\n-\t\tval = BIT(HNS3_VECTOR0_IMPRESET_INT_B);\n-\t\tif (clearval) {\n-\t\t\thw->reset.stats.imp_cnt++;\n-\t\t\thns3_warn(hw, \"IMP reset detected, clear reset status\");\n-\t\t} else {\n-\t\t\thns3_schedule_delayed_reset(hns);\n-\t\t\thns3_warn(hw, \"IMP reset detected, don't clear reset status\");\n-\t\t}\n-\n-\t\tret = HNS3_VECTOR0_EVENT_RST;\n+\t\tret = hns3_proc_imp_reset_event(hns, is_delay, &val);\n \t\tgoto out;\n \t}\n \n \t/* Global reset */\n \tif (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_int_stats) {\n-\t\trte_atomic16_set(&hw->reset.disable_cmd, 1);\n-\t\thns3_atomic_set_bit(HNS3_GLOBAL_RESET, &hw->reset.pending);\n-\t\tval = BIT(HNS3_VECTOR0_GLOBALRESET_INT_B);\n-\t\tif (clearval) {\n-\t\t\thw->reset.stats.global_cnt++;\n-\t\t\thns3_warn(hw, \"Global reset detected, clear reset status\");\n-\t\t} else {\n-\t\t\thns3_schedule_delayed_reset(hns);\n-\t\t\thns3_warn(hw, \"Global reset detected, don't clear reset status\");\n-\t\t}\n-\n-\t\tret = HNS3_VECTOR0_EVENT_RST;\n+\t\tret = hns3_proc_global_reset_event(hns, is_delay, &val);\n \t\tgoto out;\n \t}\n \n", "prefixes": [ "07/14" ] }{ "id": 87083, "url": "