get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 124994,
    "url": "http://patches.dpdk.org/api/patches/124994/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230310093518.5198-6-liudongdong3@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": "<20230310093518.5198-6-liudongdong3@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230310093518.5198-6-liudongdong3@huawei.com",
    "date": "2023-03-10T09:35:07",
    "name": "[05/16] net/hns3: use hardware config to report redirection table",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a992c3e4d6972e421a34cbc79c0d722b44c46db6",
    "submitter": {
        "id": 2718,
        "url": "http://patches.dpdk.org/api/people/2718/?format=api",
        "name": "Dongdong Liu",
        "email": "liudongdong3@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/20230310093518.5198-6-liudongdong3@huawei.com/mbox/",
    "series": [
        {
            "id": 27329,
            "url": "http://patches.dpdk.org/api/series/27329/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27329",
            "date": "2023-03-10T09:35:02",
            "name": "net/hns3: some code refactor for hns3 RSS",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/27329/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/124994/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/124994/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 3273C41E3A;\n\tFri, 10 Mar 2023 10:37:02 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8F4EE42D31;\n\tFri, 10 Mar 2023 10:36:35 +0100 (CET)",
            "from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188])\n by mails.dpdk.org (Postfix) with ESMTP id 19B3842B7E;\n Fri, 10 Mar 2023 10:36:33 +0100 (CET)",
            "from kwepemi500017.china.huawei.com (unknown [172.30.72.56])\n by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PY18w5W8qzKq5p;\n Fri, 10 Mar 2023 17:34:24 +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.2507.21; Fri, 10 Mar 2023 17:36:31 +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 05/16] net/hns3: use hardware config to report redirection\n table",
        "Date": "Fri, 10 Mar 2023 17:35:07 +0800",
        "Message-ID": "<20230310093518.5198-6-liudongdong3@huawei.com>",
        "X-Mailer": "git-send-email 2.22.0",
        "In-Reply-To": "<20230310093518.5198-1-liudongdong3@huawei.com>",
        "References": "<20230310093518.5198-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": "dggems706-chm.china.huawei.com (10.3.19.183) 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\nCurrently, reta_query() API reports the redirection table from software.\nThis patch uses the one in hardware to report.\n\nFixes: c37ca66f2b27 (\"net/hns3: support RSS\")\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_cmd.h |  1 +\n drivers/net/hns3/hns3_rss.c | 65 ++++++++++++++++++++++++++++++++++---\n 2 files changed, 62 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h\nindex 994dfc48cc..eb394c9dec 100644\n--- a/drivers/net/hns3/hns3_cmd.h\n+++ b/drivers/net/hns3/hns3_cmd.h\n@@ -606,6 +606,7 @@ struct hns3_rss_input_tuple_cmd {\n #define HNS3_RSS_CFG_TBL_SIZE_H\t\t4\n #define HNS3_RSS_CFG_TBL_BW_H\t\t2\n #define HNS3_RSS_CFG_TBL_BW_L\t\t8\n+#define HNS3_RSS_CFG_TBL_BW_H_M\t\t0x3\n \n /* Configure the indirection table, opcode:0x0D07 */\n struct hns3_rss_indirection_table_cmd {\ndiff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c\nindex 21266d64b7..fe9ad609b7 100644\n--- a/drivers/net/hns3/hns3_rss.c\n+++ b/drivers/net/hns3/hns3_rss.c\n@@ -480,6 +480,54 @@ hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size)\n \treturn 0;\n }\n \n+static int\n+hns3_get_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size)\n+{\n+\tstruct hns3_rss_indirection_table_cmd *req;\n+\tuint16_t max_bd_num, cfg_tbl_size;\n+\tuint8_t qid_msb_off, qid_msb_idx;\n+\tstruct hns3_cmd_desc desc;\n+\tuint16_t q_id, q_hi, q_lo;\n+\tuint8_t rss_result_h;\n+\tuint16_t i, j;\n+\tint ret;\n+\n+\treq = (struct hns3_rss_indirection_table_cmd *)desc.data;\n+\tmax_bd_num = DIV_ROUND_UP(size, HNS3_RSS_CFG_TBL_SIZE);\n+\tfor (i = 0; i < max_bd_num; i++) {\n+\t\thns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_INDIR_TABLE,\n+\t\t\t\t\t  true);\n+\t\treq->start_table_index =\n+\t\t\t\trte_cpu_to_le_16(i * HNS3_RSS_CFG_TBL_SIZE);\n+\t\tret = hns3_cmd_send(hw, &desc, 1);\n+\t\tif (ret) {\n+\t\t\thns3_err(hw, \"fail to get RSS indirection table from firmware, ret = %d\",\n+\t\t\t\t ret);\n+\t\t\treturn ret;\n+\t\t}\n+\n+\t\tif (i == max_bd_num - 1 && (size % HNS3_RSS_CFG_TBL_SIZE) != 0)\n+\t\t\tcfg_tbl_size = size % HNS3_RSS_CFG_TBL_SIZE;\n+\t\telse\n+\t\t\tcfg_tbl_size = HNS3_RSS_CFG_TBL_SIZE;\n+\n+\t\tfor (j = 0; j < cfg_tbl_size; j++) {\n+\t\t\tqid_msb_idx =\n+\t\t\t\tj * HNS3_RSS_CFG_TBL_BW_H / HNS3_BITS_PER_BYTE;\n+\t\t\trss_result_h = req->rss_result_h[qid_msb_idx];\n+\t\t\tqid_msb_off =\n+\t\t\t\tj * HNS3_RSS_CFG_TBL_BW_H % HNS3_BITS_PER_BYTE;\n+\t\t\tq_hi = (rss_result_h >> qid_msb_off) &\n+\t\t\t\t\t\tHNS3_RSS_CFG_TBL_BW_H_M;\n+\t\t\tq_lo = req->rss_result_l[j];\n+\t\t\tq_id = (q_hi << HNS3_RSS_CFG_TBL_BW_L) | q_lo;\n+\t\t\tindir[i * HNS3_RSS_CFG_TBL_SIZE + j] = q_id;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n int\n hns3_rss_reset_indir_table(struct hns3_hw *hw)\n {\n@@ -841,10 +889,11 @@ hns3_dev_rss_reta_query(struct rte_eth_dev *dev,\n \t\t\tuint16_t reta_size)\n {\n \tstruct hns3_adapter *hns = dev->data->dev_private;\n+\tuint16_t reta_table[HNS3_RSS_IND_TBL_SIZE_MAX];\n \tstruct hns3_hw *hw = &hns->hw;\n-\tstruct hns3_rss_conf *rss_cfg = &hw->rss_info;\n \tuint16_t idx, shift;\n \tuint16_t i;\n+\tint ret;\n \n \tif (reta_size != hw->rss_ind_tbl_size) {\n \t\thns3_err(hw, \"The size of hash lookup table configured (%u)\"\n@@ -853,14 +902,22 @@ hns3_dev_rss_reta_query(struct rte_eth_dev *dev,\n \t\treturn -EINVAL;\n \t}\n \trte_spinlock_lock(&hw->lock);\n+\tret = hns3_get_rss_indir_table(hw, reta_table, reta_size);\n+\tif (ret != 0) {\n+\t\trte_spinlock_unlock(&hw->lock);\n+\t\thns3_err(hw, \"query RSS redirection table failed, ret = %d.\",\n+\t\t\t ret);\n+\t\treturn ret;\n+\t}\n+\trte_spinlock_unlock(&hw->lock);\n+\n \tfor (i = 0; i < reta_size; i++) {\n \t\tidx = i / RTE_ETH_RETA_GROUP_SIZE;\n \t\tshift = i % RTE_ETH_RETA_GROUP_SIZE;\n \t\tif (reta_conf[idx].mask & (1ULL << shift))\n-\t\t\treta_conf[idx].reta[shift] =\n-\t\t\t\t\t\trss_cfg->rss_indirection_tbl[i];\n+\t\t\treta_conf[idx].reta[shift] = reta_table[i];\n \t}\n-\trte_spinlock_unlock(&hw->lock);\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "05/16"
    ]
}