get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87680,
    "url": "https://patches.dpdk.org/api/patches/87680/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1612355037-48768-3-git-send-email-oulijun@huawei.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": "<1612355037-48768-3-git-send-email-oulijun@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1612355037-48768-3-git-send-email-oulijun@huawei.com",
    "date": "2021-02-03T12:23:48",
    "name": "[02/11] net/hns3: fix link status change from firmware",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2032c0dcea3de9151c9cf1d6a19ee81a68de7225",
    "submitter": {
        "id": 1675,
        "url": "https://patches.dpdk.org/api/people/1675/?format=api",
        "name": "Lijun Ou",
        "email": "oulijun@huawei.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/1612355037-48768-3-git-send-email-oulijun@huawei.com/mbox/",
    "series": [
        {
            "id": 15123,
            "url": "https://patches.dpdk.org/api/series/15123/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=15123",
            "date": "2021-02-03T12:23:47",
            "name": "critical bugfixes for hns3",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/15123/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/87680/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/87680/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 B663EA0A0E;\n\tWed,  3 Feb 2021 13:24:48 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D3F4A24054C;\n\tWed,  3 Feb 2021 13:24:30 +0100 (CET)",
            "from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35])\n by mails.dpdk.org (Postfix) with ESMTP id AD9AD24052C\n for <dev@dpdk.org>; Wed,  3 Feb 2021 13:24:25 +0100 (CET)",
            "from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59])\n by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DW16d1WsDz7ftT;\n Wed,  3 Feb 2021 20:23:05 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id\n 14.3.498.0; Wed, 3 Feb 2021 20:24:22 +0800"
        ],
        "From": "Lijun Ou <oulijun@huawei.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, <linuxarm@openeuler.org>",
        "Date": "Wed, 3 Feb 2021 20:23:48 +0800",
        "Message-ID": "<1612355037-48768-3-git-send-email-oulijun@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1612355037-48768-1-git-send-email-oulijun@huawei.com>",
        "References": "<1612355037-48768-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 02/11] net/hns3: fix link status change from\n firmware",
        "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": "From: Huisong Li <lihuisong@huawei.com>\n\nWhen the hardware link status changes, the firmware proactively\nreports the link status change message, and then driver update\nlink status. This feature is lack of a switch to control in pf\ndriver. Otherwise, this feature does not take effect when the\nkernel PF driver that supports the feature is not loaded.\n\nFixes: 109e4dd1bd7a (\"net/hns3: get link state change through mailbox\")\nCc: stable@dpdk.org\n\nSigned-off-by: Huisong Li <lihuisong@huawei.com>\nSigned-off-by: Lijun Ou <oulijun@huawei.com>\n---\n drivers/net/hns3/hns3_cmd.h    | 10 ++++++++++\n drivers/net/hns3/hns3_ethdev.c | 31 +++++++++++++++++++++++++++++++\n 2 files changed, 41 insertions(+)",
    "diff": "diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h\nindex dc97a1a..ad5e188 100644\n--- a/drivers/net/hns3/hns3_cmd.h\n+++ b/drivers/net/hns3/hns3_cmd.h\n@@ -206,6 +206,9 @@ enum hns3_opcode_type {\n \t/* Clear hardware state command */\n \tHNS3_OPC_CLEAR_HW_STATE         = 0x700B,\n \n+\t/* Firmware stats command */\n+\tHNS3_OPC_FIRMWARE_COMPAT_CFG    = 0x701A,\n+\n \t/* SFP command */\n \tHNS3_OPC_SFP_GET_SPEED          = 0x7104,\n \n@@ -633,6 +636,13 @@ enum hns3_promisc_type {\n \tHNS3_BROADCAST\t= 3,\n };\n \n+#define HNS3_LINK_EVENT_REPORT_EN_B\t0\n+#define HNS3_NCSI_ERROR_REPORT_EN_B\t1\n+struct hns3_firmware_compat_cmd {\n+\tuint32_t compat;\n+\tuint8_t rsv[20];\n+};\n+\n #define HNS3_MAC_TX_EN_B\t\t6\n #define HNS3_MAC_RX_EN_B\t\t7\n #define HNS3_MAC_PAD_TX_B\t\t11\ndiff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex 8c57b63..f93870d 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -3919,6 +3919,26 @@ hns3_buffer_alloc(struct hns3_hw *hw)\n }\n \n static int\n+hns3_firmware_compat_config(struct hns3_hw *hw, bool is_init)\n+{\n+\tstruct hns3_firmware_compat_cmd *req;\n+\tstruct hns3_cmd_desc desc;\n+\tuint32_t compat = 0;\n+\n+\thns3_cmd_setup_basic_desc(&desc, HNS3_OPC_FIRMWARE_COMPAT_CFG, false);\n+\treq = (struct hns3_firmware_compat_cmd *)desc.data;\n+\n+\tif (is_init) {\n+\t\thns3_set_bit(compat, HNS3_LINK_EVENT_REPORT_EN_B, 1);\n+\t\thns3_set_bit(compat, HNS3_NCSI_ERROR_REPORT_EN_B, 0);\n+\t}\n+\n+\treq->compat = rte_cpu_to_le_32(compat);\n+\n+\treturn hns3_cmd_send(hw, &desc, 1);\n+}\n+\n+static int\n hns3_mac_init(struct hns3_hw *hw)\n {\n \tstruct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);\n@@ -4610,6 +4630,15 @@ hns3_init_hardware(struct hns3_adapter *hns)\n \t\tgoto err_mac_init;\n \t}\n \n+\t/*\n+\t * Requiring firmware to enable some features, driver can\n+\t * still work without it.\n+\t */\n+\tret = hns3_firmware_compat_config(hw, true);\n+\tif (ret)\n+\t\tPMD_INIT_LOG(WARNING, \"firmware compatible features not \"\n+\t\t\t     \"supported, ret = %d.\", ret);\n+\n \treturn 0;\n \n err_mac_init:\n@@ -4746,6 +4775,7 @@ hns3_init_pf(struct rte_eth_dev *eth_dev)\n err_enable_intr:\n \thns3_fdir_filter_uninit(hns);\n err_fdir:\n+\t(void)hns3_firmware_compat_config(hw, false);\n \thns3_uninit_umv_space(hw);\n err_init_hw:\n \thns3_tqp_stats_uninit(hw);\n@@ -4780,6 +4810,7 @@ hns3_uninit_pf(struct rte_eth_dev *eth_dev)\n \t(void)hns3_config_gro(hw, false);\n \thns3_promisc_uninit(hw);\n \thns3_fdir_filter_uninit(hns);\n+\t(void)hns3_firmware_compat_config(hw, false);\n \thns3_uninit_umv_space(hw);\n \thns3_tqp_stats_uninit(hw);\n \thns3_pf_disable_irq0(hw);\n",
    "prefixes": [
        "02/11"
    ]
}