get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 108774,
    "url": "https://patches.dpdk.org/api/patches/108774/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220318031650.2580-1-ting.xu@intel.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": "<20220318031650.2580-1-ting.xu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220318031650.2580-1-ting.xu@intel.com",
    "date": "2022-03-18T03:16:50",
    "name": "net/ice: fix raw flow input pattern value change in FDIR",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9aff0946362d9a2b3c0dd6d514c0a098666f63d1",
    "submitter": {
        "id": 1363,
        "url": "https://patches.dpdk.org/api/people/1363/?format=api",
        "name": "Xu, Ting",
        "email": "ting.xu@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220318031650.2580-1-ting.xu@intel.com/mbox/",
    "series": [
        {
            "id": 22182,
            "url": "https://patches.dpdk.org/api/series/22182/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=22182",
            "date": "2022-03-18T03:16:50",
            "name": "net/ice: fix raw flow input pattern value change in FDIR",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/22182/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/108774/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/108774/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 EEA2DA0093;\n\tFri, 18 Mar 2022 04:15:26 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8DE1740E28;\n\tFri, 18 Mar 2022 04:15:26 +0100 (CET)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id 59E8340DF7;\n Fri, 18 Mar 2022 04:15:24 +0100 (CET)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 17 Mar 2022 20:15:23 -0700",
            "from dpdk-xuting-second.sh.intel.com ([10.67.116.150])\n by orsmga007.jf.intel.com with ESMTP; 17 Mar 2022 20:15:21 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1647573324; x=1679109324;\n h=from:to:cc:subject:date:message-id;\n bh=Z8htglFzUEvWtIi7OJAc5NmmjTG+hU3liCDvuwthaGw=;\n b=JsQSHlY0aPYWpOIYOGMnINzc5bw/aIBrSQG/y7eXQ9zpVHGhmOPL+h3Q\n 81jq0VpLGl9yV3boVwHJRlu95pp9Ga5reX/RqRYWtcgGHZTR2cdB4xBqF\n iG+eBIqTxAZJ1FKbzgpRpmjK/MNVAIx30iGvQPsABFBaNnWsl/ww3Ph19\n eBNssd7qGHJMJDY5NGw3wHbL6G5DiU87vcjuzo6v5TjfMsLj5Tuhdu80d\n uD8xiExY9rwrfHttcVqEarbbozYDhV58MdVABS1Yymygkk2du2HU2MuG9\n xMWSqHpAke1r6ua0uh5egtEYA2f0WlUnz/LBoFjamc/VSU94naqLwGfpb g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10289\"; a=\"255863404\"",
            "E=Sophos;i=\"5.90,191,1643702400\"; d=\"scan'208\";a=\"255863404\"",
            "E=Sophos;i=\"5.90,191,1643702400\"; d=\"scan'208\";a=\"541642653\""
        ],
        "X-ExtLoop1": "1",
        "From": "Ting Xu <ting.xu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "junfeng.guo@intel.com, Ting Xu <ting.xu@intel.com>, stable@dpdk.org,\n Qiming Yang <qiming.yang@intel.com>, Qi Zhang <qi.z.zhang@intel.com>",
        "Subject": "[PATCH] net/ice: fix raw flow input pattern value change in FDIR",
        "Date": "Fri, 18 Mar 2022 11:16:50 +0800",
        "Message-Id": "<20220318031650.2580-1-ting.xu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "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": "When parsing raw flow pattern in FDIR, the input parameter spec and\nmask are used directly and the original value will be changed. It\nwill cause error if these values are used in other functions. In this\npatch, temporary variables are created to store the spec and mask.\n\nFixes: 25be39cc1760 (\"net/ice: enable protocol agnostic flow offloading in FDIR\")\n\nCc: stable@dpdk.org\n\nSigned-off-by: Ting Xu <ting.xu@intel.com>\n---\n drivers/net/ice/ice_fdir_filter.c | 25 +++++++++++++++++++------\n 1 file changed, 19 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c\nindex 7954c6d8ea..6e3851a71b 100644\n--- a/drivers/net/ice/ice_fdir_filter.c\n+++ b/drivers/net/ice/ice_fdir_filter.c\n@@ -1868,14 +1868,15 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,\n \t\t\t\tbreak;\n \n \t\t\t/* convert raw spec & mask from byte string to int */\n-\t\t\tunsigned char *tmp_spec =\n+\t\t\tunsigned char *spec_pattern =\n \t\t\t\t(uint8_t *)(uintptr_t)raw_spec->pattern;\n-\t\t\tunsigned char *tmp_mask =\n+\t\t\tunsigned char *mask_pattern =\n \t\t\t\t(uint8_t *)(uintptr_t)raw_mask->pattern;\n \t\t\tuint16_t udp_port = 0;\n \t\t\tuint16_t tmp_val = 0;\n \t\t\tuint8_t pkt_len = 0;\n \t\t\tuint8_t tmp = 0;\n+\t\t\tuint8_t *tmp_spec, *tmp_mask;\n \t\t\tint i, j;\n \n \t\t\tpkt_len = strlen((char *)(uintptr_t)raw_spec->pattern);\n@@ -1883,8 +1884,18 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,\n \t\t\t\tpkt_len)\n \t\t\t\treturn -rte_errno;\n \n+\t\t\ttmp_spec = rte_zmalloc(NULL, pkt_len / 2, 0);\n+\t\t\tif (!tmp_spec)\n+\t\t\t\treturn -rte_errno;\n+\n+\t\t\ttmp_mask = rte_zmalloc(NULL, pkt_len / 2, 0);\n+\t\t\tif (!tmp_mask) {\n+\t\t\t\trte_free(tmp_spec);\n+\t\t\t\treturn -rte_errno;\n+\t\t\t}\n+\n \t\t\tfor (i = 0, j = 0; i < pkt_len; i += 2, j++) {\n-\t\t\t\ttmp = tmp_spec[i];\n+\t\t\t\ttmp = spec_pattern[i];\n \t\t\t\tif (tmp >= 'a' && tmp <= 'f')\n \t\t\t\t\ttmp_val = tmp - 'a' + 10;\n \t\t\t\tif (tmp >= 'A' && tmp <= 'F')\n@@ -1893,7 +1904,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,\n \t\t\t\t\ttmp_val = tmp - '0';\n \n \t\t\t\ttmp_val *= 16;\n-\t\t\t\ttmp = tmp_spec[i + 1];\n+\t\t\t\ttmp = spec_pattern[i + 1];\n \t\t\t\tif (tmp >= 'a' && tmp <= 'f')\n \t\t\t\t\ttmp_spec[j] = tmp_val + tmp - 'a' + 10;\n \t\t\t\tif (tmp >= 'A' && tmp <= 'F')\n@@ -1901,7 +1912,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,\n \t\t\t\tif (tmp >= '0' && tmp <= '9')\n \t\t\t\t\ttmp_spec[j] = tmp_val + tmp - '0';\n \n-\t\t\t\ttmp = tmp_mask[i];\n+\t\t\t\ttmp = mask_pattern[i];\n \t\t\t\tif (tmp >= 'a' && tmp <= 'f')\n \t\t\t\t\ttmp_val = tmp - 'a' + 10;\n \t\t\t\tif (tmp >= 'A' && tmp <= 'F')\n@@ -1910,7 +1921,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,\n \t\t\t\t\ttmp_val = tmp - '0';\n \n \t\t\t\ttmp_val *= 16;\n-\t\t\t\ttmp = tmp_mask[i + 1];\n+\t\t\t\ttmp = mask_pattern[i + 1];\n \t\t\t\tif (tmp >= 'a' && tmp <= 'f')\n \t\t\t\t\ttmp_mask[j] = tmp_val + tmp - 'a' + 10;\n \t\t\t\tif (tmp >= 'A' && tmp <= 'F')\n@@ -1953,6 +1964,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,\n \n \t\t\tfilter->parser_ena = true;\n \n+\t\t\trte_free(tmp_spec);\n+\t\t\trte_free(tmp_mask);\n \t\t\tbreak;\n \t\t}\n \n",
    "prefixes": []
}