get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/134952/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 134952,
    "url": "http://patches.dpdk.org/api/patches/134952/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231208074416.2890279-2-haijie1@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": "<20231208074416.2890279-2-haijie1@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231208074416.2890279-2-haijie1@huawei.com",
    "date": "2023-12-08T07:44:14",
    "name": "[v3,1/3] net/hns3: fix VF multiple count on one reset",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "bb18df57244698d59cc2dd76bf4c61edc981bc6f",
    "submitter": {
        "id": 2935,
        "url": "http://patches.dpdk.org/api/people/2935/?format=api",
        "name": "Jie Hai",
        "email": "haijie1@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/20231208074416.2890279-2-haijie1@huawei.com/mbox/",
    "series": [
        {
            "id": 30488,
            "url": "http://patches.dpdk.org/api/series/30488/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30488",
            "date": "2023-12-08T07:44:14",
            "name": "net/hns3: bugfix on reset",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/30488/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/134952/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/134952/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 9C56B436A6;\n\tFri,  8 Dec 2023 08:48:00 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6FD2642F04;\n\tFri,  8 Dec 2023 08:48:00 +0100 (CET)",
            "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id 5473B42E8D\n for <dev@dpdk.org>; Fri,  8 Dec 2023 08:47:58 +0100 (CET)",
            "from kwepemd100004.china.huawei.com (unknown [172.30.72.56])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Smjnf1kdtzsRyL\n for <dev@dpdk.org>; Fri,  8 Dec 2023 15:44:06 +0800 (CST)",
            "from localhost.localdomain (10.67.165.2) by\n kwepemd100004.china.huawei.com (7.221.188.31) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.2.1258.28; Fri, 8 Dec 2023 15:47:56 +0800"
        ],
        "From": "Jie Hai <haijie1@huawei.com>",
        "To": "<dev@dpdk.org>, Yisen Zhuang <yisen.zhuang@huawei.com>, Chunsong Feng\n <fengchunsong@huawei.com>, \"Wei Hu (Xavier)\" <xavier.huwei@huawei.com>,\n Ferruh Yigit <ferruh.yigit@intel.com>, \"Min Hu (Connor)\"\n <humin29@huawei.com>, Huisong Li <lihuisong@huawei.com>",
        "CC": "<fengchengwen@huawei.com>, <liudongdong3@huawei.com>, <haijie1@huawei.com>",
        "Subject": "[PATCH v3 1/3] net/hns3: fix VF multiple count on one reset",
        "Date": "Fri, 8 Dec 2023 15:44:14 +0800",
        "Message-ID": "<20231208074416.2890279-2-haijie1@huawei.com>",
        "X-Mailer": "git-send-email 2.30.0",
        "In-Reply-To": "<20231208074416.2890279-1-haijie1@huawei.com>",
        "References": "<20231111015915.2776769-1-haijie1@huawei.com>\n <20231208074416.2890279-1-haijie1@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.67.165.2]",
        "X-ClientProxiedBy": "dggems704-chm.china.huawei.com (10.3.19.181) To\n kwepemd100004.china.huawei.com (7.221.188.31)",
        "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: Dengdui Huang <huangdengdui@huawei.com>\n\nThere are two ways for the hns3 VF driver to know reset event, namely,\ninterrupt task and periodic detection task. For the latter, the real\nreset process will delay several microseconds to execute. Both tasks\ncause the count to increase by 1.\n\nHowever, the periodic detection task also detects a reset event A\nafter interrupt task receive a reset event A. As a result, the reset\ncount will be double.\n\nSo this patch adds the comparison of reset level for VF in case of the\nmultiple reset count.\n\nFixes: a5475d61fa34 (\"net/hns3: support VF\")\nCc: stable@dpdk.org\n\nSigned-off-by: Dengdui Huang <huangdengdui@huawei.com>\nSigned-off-by: Jie Hai <haijie1@huawei.com>\n---\n drivers/net/hns3/hns3_ethdev_vf.c | 44 ++++++++++++++++++++-----------\n 1 file changed, 29 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c\nindex 916cc0fb1b62..089df146f76e 100644\n--- a/drivers/net/hns3/hns3_ethdev_vf.c\n+++ b/drivers/net/hns3/hns3_ethdev_vf.c\n@@ -563,13 +563,8 @@ hns3vf_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)\n \t\tval = hns3_read_dev(hw, HNS3_VF_RST_ING);\n \t\thns3_write_dev(hw, HNS3_VF_RST_ING, val | HNS3_VF_RST_ING_BIT);\n \t\tval = cmdq_stat_reg & ~BIT(HNS3_VECTOR0_RST_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+\t\thw->reset.stats.global_cnt++;\n+\t\thns3_warn(hw, \"Global reset detected, clear reset status\");\n \n \t\tret = HNS3VF_VECTOR0_EVENT_RST;\n \t\tgoto out;\n@@ -584,9 +579,9 @@ hns3vf_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)\n \n \tval = 0;\n \tret = HNS3VF_VECTOR0_EVENT_OTHER;\n+\n out:\n-\tif (clearval)\n-\t\t*clearval = val;\n+\t*clearval = val;\n \treturn ret;\n }\n \n@@ -1709,11 +1704,25 @@ is_vf_reset_done(struct hns3_hw *hw)\n \treturn true;\n }\n \n+static enum hns3_reset_level\n+hns3vf_detect_reset_event(struct hns3_hw *hw)\n+{\n+\tenum hns3_reset_level reset = HNS3_NONE_RESET;\n+\tuint32_t cmdq_stat_reg;\n+\n+\tcmdq_stat_reg = hns3_read_dev(hw, HNS3_VECTOR0_CMDQ_STAT_REG);\n+\tif (BIT(HNS3_VECTOR0_RST_INT_B) & cmdq_stat_reg)\n+\t\treset = HNS3_VF_RESET;\n+\n+\treturn reset;\n+}\n+\n bool\n hns3vf_is_reset_pending(struct hns3_adapter *hns)\n {\n+\tenum hns3_reset_level last_req;\n \tstruct hns3_hw *hw = &hns->hw;\n-\tenum hns3_reset_level reset;\n+\tenum hns3_reset_level new_req;\n \n \t/*\n \t * According to the protocol of PCIe, FLR to a PF device resets the PF\n@@ -1736,13 +1745,18 @@ hns3vf_is_reset_pending(struct hns3_adapter *hns)\n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n \t\treturn false;\n \n-\thns3vf_check_event_cause(hns, NULL);\n-\treset = hns3vf_get_reset_level(hw, &hw->reset.pending);\n-\tif (hw->reset.level != HNS3_NONE_RESET && reset != HNS3_NONE_RESET &&\n-\t    hw->reset.level < reset) {\n-\t\thns3_warn(hw, \"High level reset %d is pending\", reset);\n+\tnew_req = hns3vf_detect_reset_event(hw);\n+\tif (new_req == HNS3_NONE_RESET)\n+\t\treturn false;\n+\n+\tlast_req = hns3vf_get_reset_level(hw, &hw->reset.pending);\n+\tif (last_req == HNS3_NONE_RESET || last_req < new_req) {\n+\t\t__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);\n+\t\thns3_schedule_delayed_reset(hns);\n+\t\thns3_warn(hw, \"High level reset detected, delay do reset\");\n \t\treturn true;\n \t}\n+\n \treturn false;\n }\n \n",
    "prefixes": [
        "v3",
        "1/3"
    ]
}