get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 122616,
    "url": "http://patchwork.dpdk.org/api/patches/122616/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230129105140.29921-3-liudongdong3@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": "<20230129105140.29921-3-liudongdong3@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230129105140.29921-3-liudongdong3@huawei.com",
    "date": "2023-01-29T10:51:32",
    "name": "[02/10] net/hns3: extract common API to query device",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b8982eda5cf003446f30d0dd4cee1b5a28679fd7",
    "submitter": {
        "id": 2718,
        "url": "http://patchwork.dpdk.org/api/people/2718/?format=api",
        "name": "Dongdong Liu",
        "email": "liudongdong3@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/20230129105140.29921-3-liudongdong3@huawei.com/mbox/",
    "series": [
        {
            "id": 26679,
            "url": "http://patchwork.dpdk.org/api/series/26679/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=26679",
            "date": "2023-01-29T10:51:32",
            "name": "net/hns3: some bugfixes for rss",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/26679/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/122616/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/122616/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 6DE84424B3;\n\tSun, 29 Jan 2023 11:52:13 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E4E5B40ED5;\n\tSun, 29 Jan 2023 11:52:12 +0100 (CET)",
            "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id 0C7AD40ED4;\n Sun, 29 Jan 2023 11:52:10 +0100 (CET)",
            "from kwepemi500017.china.huawei.com (unknown [172.30.72.53])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4P4Smy31SPzfZ9c;\n Sun, 29 Jan 2023 18:52:02 +0800 (CST)",
            "from localhost.localdomain (10.28.79.22) by\n kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2375.34; Sun, 29 Jan 2023 18:52:08 +0800"
        ],
        "From": "Dongdong Liu <liudongdong3@huawei.com>",
        "To": "<dev@dpdk.org>, <ferruh.yigit@amd.com>, <thomas@monjalon.net>,\n <andrew.rybchenko@oktetlabs.ru>",
        "CC": "<stable@dpdk.org>, <yisen.zhuang@huawei.com>, <liudongdong3@huawei.com>,\n <lihuisong@huawei.com>",
        "Subject": "[PATCH 02/10] net/hns3: extract common API to query device",
        "Date": "Sun, 29 Jan 2023 18:51:32 +0800",
        "Message-ID": "<20230129105140.29921-3-liudongdong3@huawei.com>",
        "X-Mailer": "git-send-email 2.22.0",
        "In-Reply-To": "<20230129105140.29921-1-liudongdong3@huawei.com>",
        "References": "<20230129105140.29921-1-liudongdong3@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.28.79.22]",
        "X-ClientProxiedBy": "dggems702-chm.china.huawei.com (10.3.19.179) To\n kwepemi500017.china.huawei.com (7.221.188.110)",
        "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: Huisong Li <lihuisong@huawei.com>\n\nExtract common function to query device specifications.\n\nFixes: 9c740336f024 (\"net/hns3: get device specifications from firmware\")\nCc: stable@dpdk.org\n\nSigned-off-by: Huisong Li <lihuisong@huawei.com>\nSigned-off-by: Dongdong Liu <liudongdong3@huawei.com>\n---\n drivers/net/hns3/hns3_common.c    | 75 +++++++++++++++++++++++++++++++\n drivers/net/hns3/hns3_common.h    |  2 +\n drivers/net/hns3/hns3_ethdev.c    | 63 --------------------------\n drivers/net/hns3/hns3_ethdev_vf.c | 65 +--------------------------\n 4 files changed, 79 insertions(+), 126 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c\nindex 7adc6a4972..b0c7f8d62c 100644\n--- a/drivers/net/hns3/hns3_common.c\n+++ b/drivers/net/hns3/hns3_common.c\n@@ -10,6 +10,7 @@\n #include \"hns3_logs.h\"\n #include \"hns3_regs.h\"\n #include \"hns3_rxtx.h\"\n+#include \"hns3_dcb.h\"\n #include \"hns3_common.h\"\n \n int\n@@ -845,3 +846,77 @@ hns3_get_pci_revision_id(struct hns3_hw *hw, uint8_t *revision_id)\n \n \treturn 0;\n }\n+\n+void\n+hns3_set_default_dev_specifications(struct hns3_hw *hw)\n+{\n+\tstruct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);\n+\n+\thw->max_non_tso_bd_num = HNS3_MAX_NON_TSO_BD_PER_PKT;\n+\thw->rss_ind_tbl_size = HNS3_RSS_IND_TBL_SIZE;\n+\thw->rss_key_size = HNS3_RSS_KEY_SIZE;\n+\thw->intr.int_ql_max = HNS3_INTR_QL_NONE;\n+\n+\tif (hns->is_vf)\n+\t\treturn;\n+\n+\thw->max_tm_rate = HNS3_ETHER_MAX_RATE;\n+}\n+\n+static void\n+hns3_parse_dev_specifications(struct hns3_hw *hw, struct hns3_cmd_desc *desc)\n+{\n+\tstruct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);\n+\tstruct hns3_dev_specs_0_cmd *req0;\n+\tstruct hns3_dev_specs_1_cmd *req1;\n+\n+\treq0 = (struct hns3_dev_specs_0_cmd *)desc[0].data;\n+\treq1 = (struct hns3_dev_specs_1_cmd *)desc[1].data;\n+\n+\thw->max_non_tso_bd_num = req0->max_non_tso_bd_num;\n+\thw->rss_ind_tbl_size = rte_le_to_cpu_16(req0->rss_ind_tbl_size);\n+\thw->rss_key_size = rte_le_to_cpu_16(req0->rss_key_size);\n+\thw->intr.int_ql_max = rte_le_to_cpu_16(req0->intr_ql_max);\n+\thw->min_tx_pkt_len = req1->min_tx_pkt_len;\n+\n+\tif (hns->is_vf)\n+\t\treturn;\n+\n+\thw->max_tm_rate = rte_le_to_cpu_32(req0->max_tm_rate);\n+}\n+\n+static int\n+hns3_check_dev_specifications(struct hns3_hw *hw)\n+{\n+\tif (hw->rss_ind_tbl_size == 0 ||\n+\t    hw->rss_ind_tbl_size > HNS3_RSS_IND_TBL_SIZE_MAX) {\n+\t\thns3_err(hw, \"the indirection table size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)\",\n+\t\t\t hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n+hns3_query_dev_specifications(struct hns3_hw *hw)\n+{\n+\tstruct hns3_cmd_desc desc[HNS3_QUERY_DEV_SPECS_BD_NUM];\n+\tint ret;\n+\tint i;\n+\n+\tfor (i = 0; i < HNS3_QUERY_DEV_SPECS_BD_NUM - 1; i++) {\n+\t\thns3_cmd_setup_basic_desc(&desc[i], HNS3_OPC_QUERY_DEV_SPECS,\n+\t\t\t\t\t  true);\n+\t\tdesc[i].flag |= rte_cpu_to_le_16(HNS3_CMD_FLAG_NEXT);\n+\t}\n+\thns3_cmd_setup_basic_desc(&desc[i], HNS3_OPC_QUERY_DEV_SPECS, true);\n+\n+\tret = hns3_cmd_send(hw, desc, HNS3_QUERY_DEV_SPECS_BD_NUM);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\thns3_parse_dev_specifications(hw, desc);\n+\n+\treturn hns3_check_dev_specifications(hw);\n+}\ndiff --git a/drivers/net/hns3/hns3_common.h b/drivers/net/hns3/hns3_common.h\nindex 5aa001f0cc..8eaeda26e7 100644\n--- a/drivers/net/hns3/hns3_common.h\n+++ b/drivers/net/hns3/hns3_common.h\n@@ -60,5 +60,7 @@ void hns3_unmap_rx_interrupt(struct rte_eth_dev *dev);\n int hns3_restore_rx_interrupt(struct hns3_hw *hw);\n \n int hns3_get_pci_revision_id(struct hns3_hw *hw, uint8_t *revision_id);\n+void hns3_set_default_dev_specifications(struct hns3_hw *hw);\n+int hns3_query_dev_specifications(struct hns3_hw *hw);\n \n #endif /* HNS3_COMMON_H */\ndiff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex eb809cd8c9..ab565ce128 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -2647,69 +2647,6 @@ hns3_parse_speed(int speed_cmd, uint32_t *speed)\n \treturn 0;\n }\n \n-static void\n-hns3_set_default_dev_specifications(struct hns3_hw *hw)\n-{\n-\thw->max_non_tso_bd_num = HNS3_MAX_NON_TSO_BD_PER_PKT;\n-\thw->rss_ind_tbl_size = HNS3_RSS_IND_TBL_SIZE;\n-\thw->rss_key_size = HNS3_RSS_KEY_SIZE;\n-\thw->max_tm_rate = HNS3_ETHER_MAX_RATE;\n-\thw->intr.int_ql_max = HNS3_INTR_QL_NONE;\n-}\n-\n-static void\n-hns3_parse_dev_specifications(struct hns3_hw *hw, struct hns3_cmd_desc *desc)\n-{\n-\tstruct hns3_dev_specs_0_cmd *req0;\n-\tstruct hns3_dev_specs_1_cmd *req1;\n-\n-\treq0 = (struct hns3_dev_specs_0_cmd *)desc[0].data;\n-\treq1 = (struct hns3_dev_specs_1_cmd *)desc[1].data;\n-\n-\thw->max_non_tso_bd_num = req0->max_non_tso_bd_num;\n-\thw->rss_ind_tbl_size = rte_le_to_cpu_16(req0->rss_ind_tbl_size);\n-\thw->rss_key_size = rte_le_to_cpu_16(req0->rss_key_size);\n-\thw->max_tm_rate = rte_le_to_cpu_32(req0->max_tm_rate);\n-\thw->intr.int_ql_max = rte_le_to_cpu_16(req0->intr_ql_max);\n-\thw->min_tx_pkt_len = req1->min_tx_pkt_len;\n-}\n-\n-static int\n-hns3_check_dev_specifications(struct hns3_hw *hw)\n-{\n-\tif (hw->rss_ind_tbl_size == 0 ||\n-\t    hw->rss_ind_tbl_size > HNS3_RSS_IND_TBL_SIZE_MAX) {\n-\t\thns3_err(hw, \"the indirection table size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)\",\n-\t\t\t hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);\n-\t\treturn -EINVAL;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-static int\n-hns3_query_dev_specifications(struct hns3_hw *hw)\n-{\n-\tstruct hns3_cmd_desc desc[HNS3_QUERY_DEV_SPECS_BD_NUM];\n-\tint ret;\n-\tint i;\n-\n-\tfor (i = 0; i < HNS3_QUERY_DEV_SPECS_BD_NUM - 1; i++) {\n-\t\thns3_cmd_setup_basic_desc(&desc[i], HNS3_OPC_QUERY_DEV_SPECS,\n-\t\t\t\t\t  true);\n-\t\tdesc[i].flag |= rte_cpu_to_le_16(HNS3_CMD_FLAG_NEXT);\n-\t}\n-\thns3_cmd_setup_basic_desc(&desc[i], HNS3_OPC_QUERY_DEV_SPECS, true);\n-\n-\tret = hns3_cmd_send(hw, desc, HNS3_QUERY_DEV_SPECS_BD_NUM);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\thns3_parse_dev_specifications(hw, desc);\n-\n-\treturn hns3_check_dev_specifications(hw);\n-}\n-\n static int\n hns3_get_capability(struct hns3_hw *hw)\n {\ndiff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c\nindex e43815607a..d3c1bdf2c5 100644\n--- a/drivers/net/hns3/hns3_ethdev_vf.c\n+++ b/drivers/net/hns3/hns3_ethdev_vf.c\n@@ -688,67 +688,6 @@ hns3vf_interrupt_handler(void *param)\n \thns3vf_enable_irq0(hw);\n }\n \n-static void\n-hns3vf_set_default_dev_specifications(struct hns3_hw *hw)\n-{\n-\thw->max_non_tso_bd_num = HNS3_MAX_NON_TSO_BD_PER_PKT;\n-\thw->rss_ind_tbl_size = HNS3_RSS_IND_TBL_SIZE;\n-\thw->rss_key_size = HNS3_RSS_KEY_SIZE;\n-\thw->intr.int_ql_max = HNS3_INTR_QL_NONE;\n-}\n-\n-static void\n-hns3vf_parse_dev_specifications(struct hns3_hw *hw, struct hns3_cmd_desc *desc)\n-{\n-\tstruct hns3_dev_specs_0_cmd *req0;\n-\tstruct hns3_dev_specs_1_cmd *req1;\n-\n-\treq0 = (struct hns3_dev_specs_0_cmd *)desc[0].data;\n-\treq1 = (struct hns3_dev_specs_1_cmd *)desc[1].data;\n-\n-\thw->max_non_tso_bd_num = req0->max_non_tso_bd_num;\n-\thw->rss_ind_tbl_size = rte_le_to_cpu_16(req0->rss_ind_tbl_size);\n-\thw->rss_key_size = rte_le_to_cpu_16(req0->rss_key_size);\n-\thw->intr.int_ql_max = rte_le_to_cpu_16(req0->intr_ql_max);\n-\thw->min_tx_pkt_len = req1->min_tx_pkt_len;\n-}\n-\n-static int\n-hns3vf_check_dev_specifications(struct hns3_hw *hw)\n-{\n-\tif (hw->rss_ind_tbl_size == 0 ||\n-\t    hw->rss_ind_tbl_size > HNS3_RSS_IND_TBL_SIZE_MAX) {\n-\t\thns3_err(hw, \"the indirection table size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)\",\n-\t\t\t hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);\n-\t\treturn -EINVAL;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-static int\n-hns3vf_query_dev_specifications(struct hns3_hw *hw)\n-{\n-\tstruct hns3_cmd_desc desc[HNS3_QUERY_DEV_SPECS_BD_NUM];\n-\tint ret;\n-\tint i;\n-\n-\tfor (i = 0; i < HNS3_QUERY_DEV_SPECS_BD_NUM - 1; i++) {\n-\t\thns3_cmd_setup_basic_desc(&desc[i], HNS3_OPC_QUERY_DEV_SPECS,\n-\t\t\t\t\t  true);\n-\t\tdesc[i].flag |= rte_cpu_to_le_16(HNS3_CMD_FLAG_NEXT);\n-\t}\n-\thns3_cmd_setup_basic_desc(&desc[i], HNS3_OPC_QUERY_DEV_SPECS, true);\n-\n-\tret = hns3_cmd_send(hw, desc, HNS3_QUERY_DEV_SPECS_BD_NUM);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\thns3vf_parse_dev_specifications(hw, desc);\n-\n-\treturn hns3vf_check_dev_specifications(hw);\n-}\n-\n void\n hns3vf_update_push_lsc_cap(struct hns3_hw *hw, bool supported)\n {\n@@ -826,7 +765,7 @@ hns3vf_get_capability(struct hns3_hw *hw)\n \t\treturn ret;\n \n \tif (hw->revision < PCI_REVISION_ID_HIP09_A) {\n-\t\thns3vf_set_default_dev_specifications(hw);\n+\t\thns3_set_default_dev_specifications(hw);\n \t\thw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_RSV_ONE;\n \t\thw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_2US;\n \t\thw->tso_mode = HNS3_TSO_SW_CAL_PSEUDO_H_CSUM;\n@@ -837,7 +776,7 @@ hns3vf_get_capability(struct hns3_hw *hw)\n \t\treturn 0;\n \t}\n \n-\tret = hns3vf_query_dev_specifications(hw);\n+\tret = hns3_query_dev_specifications(hw);\n \tif (ret) {\n \t\tPMD_INIT_LOG(ERR,\n \t\t\t     \"failed to query dev specifications, ret = %d\",\n",
    "prefixes": [
        "02/10"
    ]
}