get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 109767,
    "url": "https://patches.dpdk.org/api/patches/109767/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220418065908.57171-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": "<20220418065908.57171-1-ting.xu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220418065908.57171-1-ting.xu@intel.com",
    "date": "2022-04-18T06:59:08",
    "name": "[v3] net/ice: fix raw flow input pattern value change in FDIR",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "dc2cab0601e9ea7214fd63064b39faf29d1d6ff2",
    "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/20220418065908.57171-1-ting.xu@intel.com/mbox/",
    "series": [
        {
            "id": 22533,
            "url": "https://patches.dpdk.org/api/series/22533/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=22533",
            "date": "2022-04-18T06:59:08",
            "name": "[v3] net/ice: fix raw flow input pattern value change in FDIR",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/22533/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/109767/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/109767/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 A3DA6A00C4;\n\tMon, 18 Apr 2022 08:57:55 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 474344014F;\n\tMon, 18 Apr 2022 08:57:55 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by mails.dpdk.org (Postfix) with ESMTP id 2B41A40141;\n Mon, 18 Apr 2022 08:57:53 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 17 Apr 2022 23:57:51 -0700",
            "from dpdk-xuting-second.sh.intel.com ([10.67.116.150])\n by orsmga007.jf.intel.com with ESMTP; 17 Apr 2022 23:57:48 -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=1650265074; x=1681801074;\n h=from:to:cc:subject:date:message-id:in-reply-to: references;\n bh=/EHNOOTh5I2hdNVwyUTQEQGYI5M5jP1TQQ5EUzFxTKo=;\n b=iR8Qq/o3Ubyihqxz7HqUYVwv7cYt7cFKesAO5mwsoiUdWx0O6xCEg9B1\n 8FpDWCRG1sbgXI3OzQZPXFYDBiG88W77nCx8G+3pjKMsL8fRtotwnxyBT\n DAivBuOV4+B3znCRR7lrJpq/TquVTWcxdxYq6ZNkyi7XN/2PSzC60/86V\n x3TcwUB6r3nTr+SgzAo4prFrBn+NwxmLdAvRPy1HJ0H5h1aCbYsME9CWC\n fRGsyJ5XN4b7H3wVTGXbo77RsxBEKbJ9itzB4PkHdfj2UPzjkBFUIrqNZ\n 7NcfN+T9ovQ8heUu3Fg8F7sFahtIKLyIF85rabdvUmNlE/Q+mePNs/4zm g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10320\"; a=\"244048303\"",
            "E=Sophos;i=\"5.90,269,1643702400\"; d=\"scan'208\";a=\"244048303\"",
            "E=Sophos;i=\"5.90,269,1643702400\"; d=\"scan'208\";a=\"554123343\""
        ],
        "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 v3] net/ice: fix raw flow input pattern value change in FDIR",
        "Date": "Mon, 18 Apr 2022 14:59:08 +0800",
        "Message-Id": "<20220418065908.57171-1-ting.xu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20220318031650.2580-1-ting.xu@intel.com>",
        "References": "<20220318031650.2580-1-ting.xu@intel.com>",
        "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 0982478feb..7914ba9407 100644\n--- a/drivers/net/ice/ice_fdir_filter.c\n+++ b/drivers/net/ice/ice_fdir_filter.c\n@@ -1870,10 +1870,11 @@ 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\tuint8_t *tmp_spec, *tmp_mask;\n \t\t\tuint16_t tmp_val = 0;\n \t\t\tuint8_t pkt_len = 0;\n \t\t\tuint8_t tmp = 0;\n@@ -1884,8 +1885,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@@ -1894,7 +1905,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@@ -1902,7 +1913,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@@ -1911,7 +1922,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@@ -1947,6 +1958,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": [
        "v3"
    ]
}