get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 84419,
    "url": "http://patches.dpdk.org/api/patches/84419/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1605871656-51819-5-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": "<1605871656-51819-5-git-send-email-oulijun@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1605871656-51819-5-git-send-email-oulijun@huawei.com",
    "date": "2020-11-20T11:27:36",
    "name": "[4/4] net/hns3: fix FEC state query",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "109e418cd26b37807ade71a2499990b6083f5c3d",
    "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/1605871656-51819-5-git-send-email-oulijun@huawei.com/mbox/",
    "series": [
        {
            "id": 14002,
            "url": "http://patches.dpdk.org/api/series/14002/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=14002",
            "date": "2020-11-20T11:27:34",
            "name": "hns3 fixes",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/14002/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/84419/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/84419/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 8A312A04DD;\n\tFri, 20 Nov 2020 12:28:40 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D5685C908;\n\tFri, 20 Nov 2020 12:27:34 +0100 (CET)",
            "from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35])\n by dpdk.org (Postfix) with ESMTP id 8B6BBC87E\n for <dev@dpdk.org>; Fri, 20 Nov 2020 12:27:25 +0100 (CET)",
            "from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60])\n by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CcvQg1n5nz702y\n for <dev@dpdk.org>; Fri, 20 Nov 2020 19:27:07 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id\n 14.3.487.0; Fri, 20 Nov 2020 19:27:15 +0800"
        ],
        "From": "Lijun Ou <oulijun@huawei.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, <linuxarm@huawei.com>",
        "Date": "Fri, 20 Nov 2020 19:27:36 +0800",
        "Message-ID": "<1605871656-51819-5-git-send-email-oulijun@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1605871656-51819-1-git-send-email-oulijun@huawei.com>",
        "References": "<1605871656-51819-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 4/4] net/hns3: fix FEC state query",
        "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: \"Min Hu (Conor)\" <humin29@huawei.com>\n\nAs FEC is not supported below 10 Gbps, CMD(0x031A) offered\nfrom Firmware read will return fail in 10 Gbps device.\n\nThis patch will prevent read this CMD when below 10 Gbps,\nas this is non-sense.\n\nFixes: 9bf2ea8dbc65 (\"net/hns3: support FEC\")\nCc: stable@dpdk.org\n\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\nSigned-off-by: Lijun Ou <oulijun@huawei.com>\n---\n drivers/net/hns3/hns3_ethdev.c | 38 ++++++++++++++++++++++++--------------\n 1 file changed, 24 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex d6d3f03..faa7b0a 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -100,7 +100,7 @@ static int hns3_add_mc_addr(struct hns3_hw *hw,\n static int hns3_remove_mc_addr(struct hns3_hw *hw,\n \t\t\t    struct rte_ether_addr *mac_addr);\n static int hns3_restore_fec(struct hns3_hw *hw);\n-static int hns3_query_dev_fec_info(struct rte_eth_dev *dev);\n+static int hns3_query_dev_fec_info(struct hns3_hw *hw);\n \n void hns3_ether_format_addr(char *buf, uint16_t size,\n \t\t\t    const struct rte_ether_addr *ether_addr)\n@@ -3010,13 +3010,6 @@ hns3_get_capability(struct hns3_hw *hw)\n \t    device_id == HNS3_DEV_ID_200G_RDMA)\n \t\thns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_DCB_B, 1);\n \n-\tret = hns3_query_dev_fec_info(eth_dev);\n-\tif (ret) {\n-\t\tPMD_INIT_LOG(ERR,\n-\t\t\t     \"failed to query FEC information, ret = %d\", ret);\n-\t\treturn ret;\n-\t}\n-\n \t/* Get PCI revision id */\n \tret = rte_pci_read_config(pci_dev, &revision, HNS3_PCI_REVISION_ID_LEN,\n \t\t\t\t  HNS3_PCI_REVISION_ID);\n@@ -3148,8 +3141,15 @@ hns3_get_configuration(struct hns3_hw *hw)\n \t}\n \n \tret = hns3_get_board_configuration(hw);\n-\tif (ret)\n+\tif (ret) {\n \t\tPMD_INIT_LOG(ERR, \"failed to get board configuration: %d\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\tret = hns3_query_dev_fec_info(hw);\n+\tif (ret)\n+\t\tPMD_INIT_LOG(ERR,\n+\t\t\t     \"failed to query FEC information, ret = %d\", ret);\n \n \treturn ret;\n }\n@@ -5797,6 +5797,15 @@ get_current_fec_auto_state(struct hns3_hw *hw, uint8_t *state)\n \tstruct hns3_cmd_desc desc;\n \tint ret;\n \n+\t/*\n+\t * CMD(0x031A) read is not supported in device of link speed\n+\t * below 10 Gbps.\n+\t */\n+\tif (hw->mac.link_speed < ETH_SPEED_NUM_10G) {\n+\t\t*state = 0;\n+\t\treturn 0;\n+\t}\n+\n \thns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, true);\n \treq = (struct hns3_config_fec_cmd *)desc.data;\n \tret = hns3_cmd_send(hw, &desc, 1);\n@@ -6003,14 +6012,15 @@ hns3_restore_fec(struct hns3_hw *hw)\n }\n \n static int\n-hns3_query_dev_fec_info(struct rte_eth_dev *dev)\n+hns3_query_dev_fec_info(struct hns3_hw *hw)\n {\n-\tstruct hns3_adapter *hns = dev->data->dev_private;\n-\tstruct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(hns);\n-\tstruct hns3_pf *pf = &hns->pf;\n+\tstruct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);\n+\tstruct hns3_pf *pf = HNS3_DEV_PRIVATE_TO_PF(hns);\n+\tstruct rte_eth_dev *eth_dev;\n \tint ret;\n \n-\tret = hns3_fec_get(dev, &pf->fec_mode);\n+\teth_dev = &rte_eth_devices[hw->data->port_id];\n+\tret = hns3_fec_get(eth_dev, &pf->fec_mode);\n \tif (ret)\n \t\thns3_err(hw, \"query device FEC info failed, ret = %d\", ret);\n \n",
    "prefixes": [
        "4/4"
    ]
}