get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 122626,
    "url": "http://patchwork.dpdk.org/api/patches/122626/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230129105140.29921-11-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-11-liudongdong3@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230129105140.29921-11-liudongdong3@huawei.com",
    "date": "2023-01-29T10:51:40",
    "name": "[10/10] net/hns3: fix incorrect check for duplicate RSS rule",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d4bbfb6c875fbcc5144925b79a6e7ebeddd70202",
    "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-11-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/122626/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/122626/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 45253424B3;\n\tSun, 29 Jan 2023 11:53:27 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7521842FEE;\n\tSun, 29 Jan 2023 11:52:27 +0100 (CET)",
            "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id 00B3142F8E;\n Sun, 29 Jan 2023 11:52:21 +0100 (CET)",
            "from kwepemi500017.china.huawei.com (unknown [172.30.72.57])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4P4SnB0hmmzfZ8f;\n Sun, 29 Jan 2023 18:52:14 +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:20 +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 10/10] net/hns3: fix incorrect check for duplicate RSS rule",
        "Date": "Sun, 29 Jan 2023 18:51:40 +0800",
        "Message-ID": "<20230129105140.29921-11-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": "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, the interface for verifying duplicate RSS rules has\nsome problems:\n1) If the value of 'func' in configuring RSS rule is default\n   value, this rule is mistakenly considered as a duplicate rule.\n2) If key length is zero or 'key' is NULL in configuring RSS rule\n   this rule is also mistakenly considered as a duplicate rule.\n3) If 'key' or 'queue' in struct rte_flow_action_rss being NULL\n   is used to memcpy, which may cause segment fault.\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 | 58 ++++++++++++++++++++++++++----------\n 1 file changed, 42 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c\nindex 307aba75a7..f76ceb18d1 100644\n--- a/drivers/net/hns3/hns3_flow.c\n+++ b/drivers/net/hns3/hns3_flow.c\n@@ -1272,28 +1272,54 @@ hns3_filterlist_flush(struct rte_eth_dev *dev)\n \t}\n }\n \n+static bool\n+hns3_flow_rule_key_same(const struct rte_flow_action_rss *comp,\n+\t\t\tconst struct rte_flow_action_rss *with)\n+{\n+\tif (comp->key_len != with->key_len)\n+\t\treturn false;\n+\n+\tif (with->key_len == 0)\n+\t\treturn true;\n+\n+\tif (comp->key == NULL && with->key == NULL)\n+\t\treturn true;\n+\n+\tif (!(comp->key != NULL && with->key != NULL))\n+\t\treturn false;\n+\n+\treturn !memcmp(comp->key, with->key, with->key_len);\n+}\n+\n+static bool\n+hns3_flow_rule_queues_same(const struct rte_flow_action_rss *comp,\n+\t\t\t   const struct rte_flow_action_rss *with)\n+{\n+\tif (comp->queue_num != with->queue_num)\n+\t\treturn false;\n+\n+\tif (with->queue_num == 0)\n+\t\treturn true;\n+\n+\tif (comp->queue == NULL && with->queue == NULL)\n+\t\treturn true;\n+\n+\tif (!(comp->queue != NULL && with->queue != NULL))\n+\t\treturn false;\n+\n+\treturn !memcmp(comp->queue, with->queue, with->queue_num);\n+}\n+\n static bool\n hns3_action_rss_same(const struct rte_flow_action_rss *comp,\n \t\t     const struct rte_flow_action_rss *with)\n {\n-\tbool rss_key_is_same;\n-\tbool func_is_same;\n+\tbool same_func;\n \n-\tfunc_is_same = (with->func != RTE_ETH_HASH_FUNCTION_DEFAULT) ?\n-\t\t\t(comp->func == with->func) : true;\n+\tsame_func = (comp->func == with->func);\n \n-\tif (with->key_len == 0 || with->key == NULL)\n-\t\trss_key_is_same = 1;\n-\telse\n-\t\trss_key_is_same = comp->key_len == with->key_len &&\n-\t\t!memcmp(comp->key, with->key, with->key_len);\n-\n-\treturn (func_is_same && rss_key_is_same &&\n-\t\tcomp->types == with->types &&\n-\t\tcomp->level == with->level &&\n-\t\tcomp->queue_num == with->queue_num &&\n-\t\t!memcmp(comp->queue, with->queue,\n-\t\t\tsizeof(*with->queue) * with->queue_num));\n+\treturn same_func && hns3_flow_rule_key_same(comp, with) &&\n+\t\thns3_flow_rule_queues_same(comp, with);\n }\n \n static bool\n",
    "prefixes": [
        "10/10"
    ]
}