get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77392,
    "url": "http://patches.dpdk.org/api/patches/77392/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200911131954.15999-6-qi.z.zhang@intel.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": "<20200911131954.15999-6-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200911131954.15999-6-qi.z.zhang@intel.com",
    "date": "2020-09-11T13:19:19",
    "name": "[v2,05/40] net/ice/base: cleanup stack hog",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0febfb29b5a990c6e69f1b1bf046fb186eafc610",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200911131954.15999-6-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 12148,
            "url": "http://patches.dpdk.org/api/series/12148/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12148",
            "date": "2020-09-11T13:19:15",
            "name": "ice base code update",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/12148/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77392/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77392/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B6AF1A04B7;\n\tFri, 11 Sep 2020 15:16:55 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 40D3E1C11C;\n\tFri, 11 Sep 2020 15:16:12 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id 0B4341C0DA\n for <dev@dpdk.org>; Fri, 11 Sep 2020 15:16:06 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 11 Sep 2020 06:16:06 -0700",
            "from dpdk51.sh.intel.com ([10.67.111.82])\n by FMSMGA003.fm.intel.com with ESMTP; 11 Sep 2020 06:16:04 -0700"
        ],
        "IronPort-SDR": [
            "\n p5IQphfpXfGzOLbQf3NQmWYLppkCK9oBTL/G7xJgjix0nYYa4MoRtRFVz1Y9MYJBYxzaTe7hh9\n jERYn8F5gdEQ==",
            "\n FB/oZK9duB2fFkPwxJ/2DarmsH/v+PyLDRMOZxdzY2EBg8wNeaE6sT+Xp7kTTLgiwvPHJps/Dd\n /kCMzb5ghgYQ=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9740\"; a=\"146482121\"",
            "E=Sophos;i=\"5.76,415,1592895600\"; d=\"scan'208\";a=\"146482121\"",
            "E=Sophos;i=\"5.76,415,1592895600\"; d=\"scan'208\";a=\"342296457\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "ferruh.yigit@intel.com",
        "Cc": "dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>,\n Bruce Allan <bruce.w.allan@intel.com>",
        "Date": "Fri, 11 Sep 2020 21:19:19 +0800",
        "Message-Id": "<20200911131954.15999-6-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20200911131954.15999-1-qi.z.zhang@intel.com>",
        "References": "<20200907112826.48493-1-qi.z.zhang@intel.com>\n <20200911131954.15999-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 05/40] net/ice/base: cleanup stack hog",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "In ice_flow_add_prof_sync(), struct ice_flow_prof_params has recently\ngrown in size hogging stack space when allocated there.  Hogging stack\nspace should be avoided.  Change allocation to be on the heap when needed.\n\nSigned-off-by: Bruce Allan <bruce.w.allan@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\nAcked-by: Qiming Yang <qiming.yang@intel.com>\n---\n drivers/net/ice/base/ice_flow.c | 55 +++++++++++++++++++++++------------------\n 1 file changed, 31 insertions(+), 24 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c\nindex 552e58f9b..0169da995 100644\n--- a/drivers/net/ice/base/ice_flow.c\n+++ b/drivers/net/ice/base/ice_flow.c\n@@ -1815,52 +1815,57 @@ ice_flow_add_prof_sync(struct ice_hw *hw, enum ice_block blk,\n \t\t       struct ice_flow_action *acts, u8 acts_cnt,\n \t\t       struct ice_flow_prof **prof)\n {\n-\tstruct ice_flow_prof_params params;\n+\tstruct ice_flow_prof_params *params;\n \tenum ice_status status;\n \tu8 i;\n \n \tif (!prof || (acts_cnt && !acts))\n \t\treturn ICE_ERR_BAD_PTR;\n \n-\tice_memset(&params, 0, sizeof(params), ICE_NONDMA_MEM);\n-\tparams.prof = (struct ice_flow_prof *)\n-\t\tice_malloc(hw, sizeof(*params.prof));\n-\tif (!params.prof)\n+\tparams = (struct ice_flow_prof_params *)ice_malloc(hw, sizeof(*params));\n+\tif (!params)\n \t\treturn ICE_ERR_NO_MEMORY;\n \n+\tparams->prof = (struct ice_flow_prof *)\n+\t\tice_malloc(hw, sizeof(*params->prof));\n+\tif (!params->prof) {\n+\t\tstatus = ICE_ERR_NO_MEMORY;\n+\t\tgoto free_params;\n+\t}\n+\n \t/* initialize extraction sequence to all invalid (0xff) */\n \tfor (i = 0; i < ICE_MAX_FV_WORDS; i++) {\n-\t\tparams.es[i].prot_id = ICE_PROT_INVALID;\n-\t\tparams.es[i].off = ICE_FV_OFFSET_INVAL;\n+\t\tparams->es[i].prot_id = ICE_PROT_INVALID;\n+\t\tparams->es[i].off = ICE_FV_OFFSET_INVAL;\n \t}\n \n-\tparams.blk = blk;\n-\tparams.prof->id = prof_id;\n-\tparams.prof->dir = dir;\n-\tparams.prof->segs_cnt = segs_cnt;\n+\tparams->blk = blk;\n+\tparams->prof->id = prof_id;\n+\tparams->prof->dir = dir;\n+\tparams->prof->segs_cnt = segs_cnt;\n \n \t/* Make a copy of the segments that need to be persistent in the flow\n \t * profile instance\n \t */\n \tfor (i = 0; i < segs_cnt; i++)\n-\t\tice_memcpy(&params.prof->segs[i], &segs[i], sizeof(*segs),\n+\t\tice_memcpy(&params->prof->segs[i], &segs[i], sizeof(*segs),\n \t\t\t   ICE_NONDMA_TO_NONDMA);\n \n \t/* Make a copy of the actions that need to be persistent in the flow\n \t * profile instance.\n \t */\n \tif (acts_cnt) {\n-\t\tparams.prof->acts = (struct ice_flow_action *)\n+\t\tparams->prof->acts = (struct ice_flow_action *)\n \t\t\tice_memdup(hw, acts, acts_cnt * sizeof(*acts),\n \t\t\t\t   ICE_NONDMA_TO_NONDMA);\n \n-\t\tif (!params.prof->acts) {\n+\t\tif (!params->prof->acts) {\n \t\t\tstatus = ICE_ERR_NO_MEMORY;\n \t\t\tgoto out;\n \t\t}\n \t}\n \n-\tstatus = ice_flow_proc_segs(hw, &params);\n+\tstatus = ice_flow_proc_segs(hw, params);\n \tif (status) {\n \t\tice_debug(hw, ICE_DBG_FLOW,\n \t\t\t  \"Error processing a flow's packet segments\\n\");\n@@ -1868,24 +1873,26 @@ ice_flow_add_prof_sync(struct ice_hw *hw, enum ice_block blk,\n \t}\n \n \t/* Add a HW profile for this flow profile */\n-\tstatus = ice_add_prof(hw, blk, prof_id, (u8 *)params.ptypes,\n-\t\t\t      params.attr, params.attr_cnt, params.es,\n-\t\t\t      params.mask);\n+\tstatus = ice_add_prof(hw, blk, prof_id, (u8 *)params->ptypes,\n+\t\t\t      params->attr, params->attr_cnt, params->es,\n+\t\t\t      params->mask);\n \tif (status) {\n \t\tice_debug(hw, ICE_DBG_FLOW, \"Error adding a HW flow profile\\n\");\n \t\tgoto out;\n \t}\n \n-\tINIT_LIST_HEAD(&params.prof->entries);\n-\tice_init_lock(&params.prof->entries_lock);\n-\t*prof = params.prof;\n+\tINIT_LIST_HEAD(&params->prof->entries);\n+\tice_init_lock(&params->prof->entries_lock);\n+\t*prof = params->prof;\n \n out:\n \tif (status) {\n-\t\tif (params.prof->acts)\n-\t\t\tice_free(hw, params.prof->acts);\n-\t\tice_free(hw, params.prof);\n+\t\tif (params->prof->acts)\n+\t\t\tice_free(hw, params->prof->acts);\n+\t\tice_free(hw, params->prof);\n \t}\n+free_params:\n+\tice_free(hw, params);\n \n \treturn status;\n }\n",
    "prefixes": [
        "v2",
        "05/40"
    ]
}