Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/106108/?format=api
http://patchwork.dpdk.org/api/patches/106108/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220120025931.574106-3-stevex.yang@intel.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": "<20220120025931.574106-3-stevex.yang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220120025931.574106-3-stevex.yang@intel.com", "date": "2022-01-20T02:59:31", "name": "[2/2] app/testpmd: fix stack overflow for EEPROM display", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "e6cf5539010c903e95edbdb1a7718a96980fee88", "submitter": { "id": 1883, "url": "http://patchwork.dpdk.org/api/people/1883/?format=api", "name": "Steve Yang", "email": "stevex.yang@intel.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/20220120025931.574106-3-stevex.yang@intel.com/mbox/", "series": [ { "id": 21270, "url": "http://patchwork.dpdk.org/api/series/21270/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=21270", "date": "2022-01-20T02:59:29", "name": "add module EEPROM ops for ice", "version": 1, "mbox": "http://patchwork.dpdk.org/series/21270/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/106108/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/106108/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 77B3FA00C3;\n\tThu, 20 Jan 2022 04:06:17 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4A12841C28;\n\tThu, 20 Jan 2022 04:06:11 +0100 (CET)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id 0955941238\n for <dev@dpdk.org>; Thu, 20 Jan 2022 04:06:09 +0100 (CET)", "from orsmga007.jf.intel.com ([10.7.209.58])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 Jan 2022 19:06:09 -0800", "from intel-cd-odc-steve.cd.intel.com ([10.240.178.135])\n by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 Jan 2022 19:06:07 -0800" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1642647970; x=1674183970;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=9HVSITo1RgLPNkvZaiyZZKtYPJmWZpAL5Fo2geAtj+8=;\n b=Q8ceKoHHy4zKEYz8cDmnyTW2kzwsj/sBUhosDBfuQ8cc5gtIUkGYXkvk\n x+4smvc0bePr9k5VR4FmzmSH4vO5sl5JTj3B0MpxdHgoErktQUG1nJ7op\n Js+IC0UZ90N2D4ltvHUWynx4gAn6oDpFVtbQcxZUFSyV2T9KodR3u1e7u\n wInG5LxBZJSV6lHf1BZ0ebLboR67ijvILaSGEayShKBOpNTUol7f1A7Px\n Y/xrZeAgVTa1yGG7zCzaQ3kOq/obug1SaPsmyFBbztBofJhXo6w7wIbN2\n BKyIbqJvAhhx+6OyLEUl44cPdOj0BhSYkRcy4aKEKeX83sw4VVZGxaKOL Q==;", "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10232\"; a=\"331609506\"", "E=Sophos;i=\"5.88,301,1635231600\"; d=\"scan'208\";a=\"331609506\"", "E=Sophos;i=\"5.88,301,1635231600\"; d=\"scan'208\";a=\"518444170\"" ], "From": "Steve Yang <stevex.yang@intel.com>", "To": "dev@dpdk.org", "Cc": "Yuying.Zhang@intel.com, aman.deep.singh@intel.com, qiming.yang@intel.com,\n qi.z.zhang@intel.com, Steve Yang <stevex.yang@intel.com>", "Subject": "[PATCH 2/2] app/testpmd: fix stack overflow for EEPROM display", "Date": "Thu, 20 Jan 2022 02:59:31 +0000", "Message-Id": "<20220120025931.574106-3-stevex.yang@intel.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20220120025931.574106-1-stevex.yang@intel.com>", "References": "<20220120025931.574106-1-stevex.yang@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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 the size of EEPROM exceeds the default thread stack size(8MB),\ne.g.: 10Mb size, it will be cashed with stack overflow.\n\nAllocate the data of EPPROM information on the heap.\n\nFixes: 6b67721dee2a (\"app/testpmd: add EEPROM command\")\n\nSigned-off-by: Steve Yang <stevex.yang@intel.com>\n---\n app/test-pmd/config.c | 22 ++++++++++++++++++----\n 1 file changed, 18 insertions(+), 4 deletions(-)", "diff": "diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex 1722d6c8f8..e812f57151 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -912,10 +912,15 @@ port_eeprom_display(portid_t port_id)\n \t\treturn;\n \t}\n \n-\tchar buf[len_eeprom];\n \teinfo.offset = 0;\n \teinfo.length = len_eeprom;\n-\teinfo.data = buf;\n+\teinfo.data = calloc(1, len_eeprom);\n+\tif (!einfo.data) {\n+\t\tfprintf(stderr,\n+\t\t\t\"Allocation of port %u eeprom data failed\\n\",\n+\t\t\tport_id);\n+\t\treturn;\n+\t}\n \n \tret = rte_eth_dev_get_eeprom(port_id, &einfo);\n \tif (ret != 0) {\n@@ -933,10 +938,12 @@ port_eeprom_display(portid_t port_id)\n \t\t\tfprintf(stderr, \"Unable to get EEPROM: %d\\n\", ret);\n \t\t\tbreak;\n \t\t}\n+\t\tfree(einfo.data);\n \t\treturn;\n \t}\n \trte_hexdump(stdout, \"hexdump\", einfo.data, einfo.length);\n \tprintf(\"Finish -- Port: %d EEPROM length: %d bytes\\n\", port_id, len_eeprom);\n+\tfree(einfo.data);\n }\n \n void\n@@ -972,10 +979,15 @@ port_module_eeprom_display(portid_t port_id)\n \t\treturn;\n \t}\n \n-\tchar buf[minfo.eeprom_len];\n \teinfo.offset = 0;\n \teinfo.length = minfo.eeprom_len;\n-\teinfo.data = buf;\n+\teinfo.data = calloc(1, minfo.eeprom_len);\n+\tif (!einfo.data) {\n+\t\tfprintf(stderr,\n+\t\t\t\"Allocation of port %u eeprom data failed\\n\",\n+\t\t\tport_id);\n+\t\treturn;\n+\t}\n \n \tret = rte_eth_dev_get_module_eeprom(port_id, &einfo);\n \tif (ret != 0) {\n@@ -994,11 +1006,13 @@ port_module_eeprom_display(portid_t port_id)\n \t\t\t\tret);\n \t\t\tbreak;\n \t\t}\n+\t\tfree(einfo.data);\n \t\treturn;\n \t}\n \n \trte_hexdump(stdout, \"hexdump\", einfo.data, einfo.length);\n \tprintf(\"Finish -- Port: %d MODULE EEPROM length: %d bytes\\n\", port_id, einfo.length);\n+\tfree(einfo.data);\n }\n \n int\n", "prefixes": [ "2/2" ] }{ "id": 106108, "url": "