get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 72607,
    "url": "http://patchwork.dpdk.org/api/patches/72607/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1593604482-47494-7-git-send-email-xavier.huwei@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": "<1593604482-47494-7-git-send-email-xavier.huwei@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1593604482-47494-7-git-send-email-xavier.huwei@huawei.com",
    "date": "2020-07-01T11:54:38",
    "name": "[06/10] net/hns3: clear residual hardware configurations on init",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "cbfbb2e0bc1d9bcf2ea39e60581d51b8ca34cd2a",
    "submitter": {
        "id": 1405,
        "url": "http://patchwork.dpdk.org/api/people/1405/?format=api",
        "name": "Wei Hu (Xavier)",
        "email": "xavier.huwei@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/1593604482-47494-7-git-send-email-xavier.huwei@huawei.com/mbox/",
    "series": [
        {
            "id": 10710,
            "url": "http://patchwork.dpdk.org/api/series/10710/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=10710",
            "date": "2020-07-01T11:54:33",
            "name": "misc updates for hns3 PMD driver",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/10710/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/72607/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/72607/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 56954A0350;\n\tWed,  1 Jul 2020 13:57:17 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1F93E1D44B;\n\tWed,  1 Jul 2020 13:56:38 +0200 (CEST)",
            "from huawei.com (szxga07-in.huawei.com [45.249.212.35])\n by dpdk.org (Postfix) with ESMTP id 34EC71D40A\n for <dev@dpdk.org>; Wed,  1 Jul 2020 13:56:34 +0200 (CEST)",
            "from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60])\n by Forcepoint Email with ESMTP id 2B41EC95BDA785F5B4D7\n for <dev@dpdk.org>; Wed,  1 Jul 2020 19:56:32 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id\n 14.3.487.0; Wed, 1 Jul 2020 19:56:22 +0800"
        ],
        "From": "\"Wei Hu (Xavier)\" <xavier.huwei@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<xavier.huwei@huawei.com>",
        "Date": "Wed, 1 Jul 2020 19:54:38 +0800",
        "Message-ID": "<1593604482-47494-7-git-send-email-xavier.huwei@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1593604482-47494-1-git-send-email-xavier.huwei@huawei.com>",
        "References": "<1593604482-47494-1-git-send-email-xavier.huwei@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 06/10] net/hns3: clear residual hardware\n\tconfigurations on init",
        "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: Hongbo Zheng <zhenghongbo3@huawei.com>\n\nWhen the last driver exits abnormally, for example, it is killed by\n'kill -9', it may be too late to clear the configuration and cause the\nconfiguration to remain. Therefore, to ensure that the hardware environment\nis clean during initialization, the PF driver actively clear the hardware\nenvironment during initialization, including PF and corresponding VFs'\nvlan, mac, flow table configurations, etc.\n\nFixes: d51867db65c1 (\"net/hns3: add initialization\")\nCc: stable@dpdk.org\n\nSigned-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\n---\n drivers/net/hns3/hns3_cmd.h    |  3 +++\n drivers/net/hns3/hns3_ethdev.c | 27 +++++++++++++++++++++++++++\n 2 files changed, 30 insertions(+)",
    "diff": "diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h\nindex da770ac..b203e66 100644\n--- a/drivers/net/hns3/hns3_cmd.h\n+++ b/drivers/net/hns3/hns3_cmd.h\n@@ -207,6 +207,9 @@ enum hns3_opcode_type {\n \tHNS3_OPC_FD_AD_OP               = 0x1204,\n \tHNS3_OPC_FD_COUNTER_OP          = 0x1205,\n \n+\t/* Clear hardware state command */\n+\tHNS3_OPC_CLEAR_HW_STATE         = 0x700A,\n+\n \t/* SFP command */\n \tHNS3_OPC_SFP_GET_SPEED          = 0x7104,\n \ndiff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex a43ed82..1c234da 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -4322,6 +4322,21 @@ hns3_init_hardware(struct hns3_adapter *hns)\n }\n \n static int\n+hns3_clear_hw(struct hns3_hw *hw)\n+{\n+\tstruct hns3_cmd_desc desc;\n+\tint ret;\n+\n+\thns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CLEAR_HW_STATE, false);\n+\n+\tret = hns3_cmd_send(hw, &desc, 1);\n+\tif (ret && ret != -EOPNOTSUPP)\n+\t\treturn ret;\n+\n+\treturn 0;\n+}\n+\n+static int\n hns3_init_pf(struct rte_eth_dev *eth_dev)\n {\n \tstruct rte_device *dev = eth_dev->device;\n@@ -4351,6 +4366,18 @@ hns3_init_pf(struct rte_eth_dev *eth_dev)\n \t\tgoto err_cmd_init;\n \t}\n \n+\t/*\n+\t * To ensure that the hardware environment is clean during\n+\t * initialization, the driver actively clear the hardware environment\n+\t * during initialization, including PF and corresponding VFs' vlan, mac,\n+\t * flow table configurations, etc.\n+\t */\n+\tret = hns3_clear_hw(hw);\n+\tif (ret) {\n+\t\tPMD_INIT_LOG(ERR, \"failed to clear hardware: %d\", ret);\n+\t\tgoto err_cmd_init;\n+\t}\n+\n \tret = rte_intr_callback_register(&pci_dev->intr_handle,\n \t\t\t\t\t hns3_interrupt_handler,\n \t\t\t\t\t eth_dev);\n",
    "prefixes": [
        "06/10"
    ]
}