get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87668,
    "url": "https://patches.dpdk.org/api/patches/87668/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1612338382-3253-6-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": "<1612338382-3253-6-git-send-email-oulijun@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1612338382-3253-6-git-send-email-oulijun@huawei.com",
    "date": "2021-02-03T07:46:10",
    "name": "[05/17] net/hns3: fix query order of link status and link info",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d18ef083dcd26945e64096fa234244840af4bd10",
    "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/1612338382-3253-6-git-send-email-oulijun@huawei.com/mbox/",
    "series": [
        {
            "id": 15115,
            "url": "https://patches.dpdk.org/api/series/15115/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=15115",
            "date": "2021-02-03T07:46:05",
            "name": "bugfixes and small functionality for hns3",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/15115/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/87668/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/87668/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 857BFA0A0E;\n\tWed,  3 Feb 2021 08:49:26 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E5EEB2404BB;\n\tWed,  3 Feb 2021 08:47:13 +0100 (CET)",
            "from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32])\n by mails.dpdk.org (Postfix) with ESMTP id AE4C4240462\n for <dev@dpdk.org>; Wed,  3 Feb 2021 08:46:57 +0100 (CET)",
            "from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59])\n by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DVtym1SwFzjGXV;\n Wed,  3 Feb 2021 15:45:52 +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; Wed, 3 Feb 2021 15:46:49 +0800"
        ],
        "From": "Lijun Ou <oulijun@huawei.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, <linuxarm@openeuler.org>",
        "Date": "Wed, 3 Feb 2021 15:46:10 +0800",
        "Message-ID": "<1612338382-3253-6-git-send-email-oulijun@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1612338382-3253-1-git-send-email-oulijun@huawei.com>",
        "References": "<1612338382-3253-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 05/17] net/hns3: fix query order of link status\n and link info",
        "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 link information is updated in the firmware, the link information\nis updated first and then the link status is updated. In a 1s periodic\ntask, PF driver queries the link information and then obtains link status.\nIt may lead to a 1s time difference for obtaining valid link information\nwhen the port is up. Therefore, the query order of driver should be\nreversed to the order of firmware.\n\nFixes: 109e4dd1bd7a (\"net/hns3: get link state change through mailbox\")\nFixes: 59fad0f32135 (\"net/hns3: support link update operation\")\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_ethdev.c | 27 ++++++++++++++++++++-------\n 1 file changed, 20 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex bd998f6..13f78f2 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -93,7 +93,7 @@ static enum hns3_reset_level hns3_get_reset_level(struct hns3_adapter *hns,\n static int hns3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);\n static int hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid,\n \t\t\t\t    int on);\n-static int hns3_update_speed_duplex(struct rte_eth_dev *eth_dev);\n+static int hns3_update_link_info(struct rte_eth_dev *eth_dev);\n static bool hns3_update_link_status(struct hns3_hw *hw);\n \n static int hns3_add_mc_addr(struct hns3_hw *hw,\n@@ -2642,8 +2642,8 @@ hns3_dev_link_update(struct rte_eth_dev *eth_dev,\n \tstruct rte_eth_link new_link;\n \n \tif (!hns3_is_reset_pending(hns)) {\n-\t\thns3_update_speed_duplex(eth_dev);\n \t\thns3_update_link_status(hw);\n+\t\thns3_update_link_info(eth_dev);\n \t}\n \n \tmemset(&new_link, 0, sizeof(new_link));\n@@ -4368,11 +4368,9 @@ hns3_cfg_mac_speed_dup(struct hns3_hw *hw, uint32_t speed, uint8_t duplex)\n }\n \n static int\n-hns3_update_speed_duplex(struct rte_eth_dev *eth_dev)\n+hns3_update_fiber_link_info(struct hns3_hw *hw)\n {\n-\tstruct hns3_adapter *hns = eth_dev->data->dev_private;\n-\tstruct hns3_hw *hw = &hns->hw;\n-\tstruct hns3_pf *pf = &hns->pf;\n+\tstruct hns3_pf *pf = HNS3_DEV_HW_TO_PF(hw);\n \tuint32_t speed;\n \tint ret;\n \n@@ -4395,6 +4393,21 @@ hns3_update_speed_duplex(struct rte_eth_dev *eth_dev)\n }\n \n static int\n+hns3_update_link_info(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct hns3_adapter *hns = eth_dev->data->dev_private;\n+\tstruct hns3_hw *hw = &hns->hw;\n+\tint ret = 0;\n+\n+\tif (hw->mac.media_type == HNS3_MEDIA_TYPE_COPPER)\n+\t\treturn 0;\n+\telse if (hw->mac.media_type == HNS3_MEDIA_TYPE_FIBER)\n+\t\tret = hns3_update_fiber_link_info(hw);\n+\n+\treturn ret;\n+}\n+\n+static int\n hns3_cfg_mac_mode(struct hns3_hw *hw, bool enable)\n {\n \tstruct hns3_config_mac_mode_cmd *req;\n@@ -4509,8 +4522,8 @@ hns3_service_handler(void *param)\n \tstruct hns3_hw *hw = &hns->hw;\n \n \tif (!hns3_is_reset_pending(hns)) {\n-\t\thns3_update_speed_duplex(eth_dev);\n \t\thns3_update_link_status_and_event(hw);\n+\t\thns3_update_link_info(eth_dev);\n \t} else {\n \t\thns3_warn(hw, \"Cancel the query when reset is pending\");\n \t}\n",
    "prefixes": [
        "05/17"
    ]
}