get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 122625,
    "url": "https://patches.dpdk.org/api/patches/122625/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230129105140.29921-10-liudongdong3@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": "<20230129105140.29921-10-liudongdong3@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230129105140.29921-10-liudongdong3@huawei.com",
    "date": "2023-01-29T10:51:39",
    "name": "[09/10] net/hns3: fix bad memory structure conversion",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "dc5a4dc9ed92310b194c990be8657ea560998c59",
    "submitter": {
        "id": 2718,
        "url": "https://patches.dpdk.org/api/people/2718/?format=api",
        "name": "Dongdong Liu",
        "email": "liudongdong3@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/20230129105140.29921-10-liudongdong3@huawei.com/mbox/",
    "series": [
        {
            "id": 26679,
            "url": "https://patches.dpdk.org/api/series/26679/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=26679",
            "date": "2023-01-29T10:51:32",
            "name": "net/hns3: some bugfixes for rss",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/26679/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/122625/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/122625/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 C7A10424B3;\n\tSun, 29 Jan 2023 11:53:18 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 613B742FD4;\n\tSun, 29 Jan 2023 11:52:25 +0100 (CET)",
            "from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255])\n by mails.dpdk.org (Postfix) with ESMTP id 7FBDB40EDF;\n Sun, 29 Jan 2023 11:52:17 +0100 (CET)",
            "from kwepemi500017.china.huawei.com (unknown [172.30.72.57])\n by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4P4Skx5HCsz16N3Q;\n Sun, 29 Jan 2023 18:50:17 +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:15 +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 09/10] net/hns3: fix bad memory structure conversion",
        "Date": "Sun, 29 Jan 2023 18:51:39 +0800",
        "Message-ID": "<20230129105140.29921-10-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": "dggems704-chm.china.huawei.com (10.3.19.181) 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\nWhen the type in 'struct rte_flow_action' is RTE_FLOW_ACTION_TYPE_RSS, the\n'conf' pointer references the 'struct rte_flow_action_rss' instead of the\n'struct hns3_rss_conf' in driver. But driver uses 'struct hns3_rss_conf' to\nconvert this 'conf' pointer to get RSS action configuration.\n\nIn addition, RSS filter configuration is directly cloned to RSS filter node\ninstead of coping it after successfully setting to hardware.\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_flow.c | 57 +++++++++++++-----------------------\n 1 file changed, 20 insertions(+), 37 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c\nindex fbc38dd3d4..307aba75a7 100644\n--- a/drivers/net/hns3/hns3_flow.c\n+++ b/drivers/net/hns3/hns3_flow.c\n@@ -95,8 +95,8 @@ static const struct rte_flow_action *\n hns3_find_rss_general_action(const struct rte_flow_item pattern[],\n \t\t\t     const struct rte_flow_action actions[])\n {\n+\tconst struct rte_flow_action_rss *rss_act;\n \tconst struct rte_flow_action *act = NULL;\n-\tconst struct hns3_rss_conf *rss;\n \tbool have_eth = false;\n \n \tfor (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {\n@@ -115,8 +115,8 @@ hns3_find_rss_general_action(const struct rte_flow_item pattern[],\n \t\t}\n \t}\n \n-\trss = act->conf;\n-\tif (have_eth && rss->conf.queue_num) {\n+\trss_act = act->conf;\n+\tif (have_eth && rss_act->queue_num) {\n \t\t/*\n \t\t * Pattern have ETH and action's queue_num > 0, indicate this is\n \t\t * queue region configuration.\n@@ -1296,30 +1296,6 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,\n \t\t\tsizeof(*with->queue) * with->queue_num));\n }\n \n-static int\n-hns3_rss_conf_copy(struct hns3_rss_conf *out,\n-\t\t   const struct rte_flow_action_rss *in)\n-{\n-\tif (in->key_len > RTE_DIM(out->key) ||\n-\t    in->queue_num > RTE_DIM(out->queue))\n-\t\treturn -EINVAL;\n-\tif (in->key == NULL && in->key_len)\n-\t\treturn -EINVAL;\n-\tout->conf = (struct rte_flow_action_rss) {\n-\t\t.func = in->func,\n-\t\t.level = in->level,\n-\t\t.types = in->types,\n-\t\t.key_len = in->key_len,\n-\t\t.queue_num = in->queue_num,\n-\t};\n-\tout->conf.queue = memcpy(out->queue, in->queue,\n-\t\t\t\tsizeof(*in->queue) * in->queue_num);\n-\tif (in->key)\n-\t\tout->conf.key = memcpy(out->key, in->key, in->key_len);\n-\n-\treturn 0;\n-}\n-\n static bool\n hns3_rss_input_tuple_supported(struct hns3_hw *hw,\n \t\t\t       const struct rte_flow_action_rss *rss)\n@@ -1733,9 +1709,10 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,\n \t\t\t  struct rte_flow *flow)\n {\n \tstruct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tconst struct rte_flow_action_rss *rss_act;\n \tstruct hns3_rss_conf_ele *rss_filter_ptr;\n \tstruct hns3_rss_conf_ele *filter_ptr;\n-\tconst struct hns3_rss_conf *rss_conf;\n+\tstruct hns3_rss_conf *new_conf;\n \tint ret;\n \n \trss_filter_ptr = rte_zmalloc(\"hns3 rss filter\",\n@@ -1745,19 +1722,25 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,\n \t\treturn -ENOMEM;\n \t}\n \n-\t/*\n-\t * After all the preceding tasks are successfully configured, configure\n-\t * rules to the hardware to simplify the rollback of rules in the\n-\t * hardware.\n-\t */\n-\trss_conf = (const struct hns3_rss_conf *)act->conf;\n-\tret = hns3_flow_parse_rss(dev, rss_conf, true);\n+\trss_act = (const struct rte_flow_action_rss *)act->conf;\n+\tnew_conf = &rss_filter_ptr->filter_info;\n+\tmemcpy(&new_conf->conf, rss_act, sizeof(*rss_act));\n+\tif (rss_act->queue_num > 0) {\n+\t\tmemcpy(new_conf->queue, rss_act->queue,\n+\t\t       rss_act->queue_num * sizeof(new_conf->queue[0]));\n+\t\tnew_conf->conf.queue = new_conf->queue;\n+\t}\n+\tif (rss_act->key_len > 0) {\n+\t\tmemcpy(new_conf->key, rss_act->key,\n+\t\t       rss_act->key_len * sizeof(new_conf->key[0]));\n+\t\tnew_conf->conf.key = new_conf->key;\n+\t}\n+\n+\tret = hns3_flow_parse_rss(dev, new_conf, true);\n \tif (ret != 0) {\n \t\trte_free(rss_filter_ptr);\n \t\treturn ret;\n \t}\n-\n-\thns3_rss_conf_copy(&rss_filter_ptr->filter_info, &rss_conf->conf);\n \trss_filter_ptr->filter_info.valid = true;\n \n \t/*\n",
    "prefixes": [
        "09/10"
    ]
}