Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/108796/?format=api
http://patches.dpdk.org/api/patches/108796/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220322071833.199619-1-ke1x.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": "<20220322071833.199619-1-ke1x.zhang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220322071833.199619-1-ke1x.zhang@intel.com", "date": "2022-03-22T07:18:33", "name": "app/testpmd: fix quit testpmd with vfs and pf", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "ec399504737f79600f0b20ba42bb8720e78701fd", "submitter": { "id": 2503, "url": "http://patches.dpdk.org/api/people/2503/?format=api", "name": "Zhang, Ke1X", "email": "ke1x.zhang@intel.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220322071833.199619-1-ke1x.zhang@intel.com/mbox/", "series": [ { "id": 22201, "url": "http://patches.dpdk.org/api/series/22201/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=22201", "date": "2022-03-22T07:18:33", "name": "app/testpmd: fix quit testpmd with vfs and pf", "version": 1, "mbox": "http://patches.dpdk.org/series/22201/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/108796/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/108796/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 845FFA04FF;\n\tTue, 22 Mar 2022 08:23:29 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2E8B7427ED;\n\tTue, 22 Mar 2022 08:23:29 +0100 (CET)", "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by mails.dpdk.org (Postfix) with ESMTP id EE155410E5\n for <dev@dpdk.org>; Tue, 22 Mar 2022 08:23:27 +0100 (CET)", "from orsmga007.jf.intel.com ([10.7.209.58])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 22 Mar 2022 00:23:02 -0700", "from intel-corei7-64.sh.intel.com (HELO localhost.localdomain)\n ([10.239.251.104])\n by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 22 Mar 2022 00:23:00 -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=1647933808; x=1679469808;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=Ewbbdi4a/XKwq1RYUd/PtZyLWQ2tC9KAV1eKCA55MgM=;\n b=UlJR+UH2YstW8+MxUllzjqpJiVl+ZObM1Z8BSKQfFCDE+Z9XYbC9qZBe\n 8sgyGeiEL+BGv/bFl01bcKhTcrzV79+93lKDJDfcCqZ2ILsL9H70YlzEX\n 0n8DOdFHccWm0H6cj+TQoaoizvNqxGcjib/IS3cKmyHvlEMbW+Mw5v4aG\n 5V6a/XHWb+fWJS/paddyEuwT96EW95iAKM3DdhzDMTA+5I7sJMJ+nWwnl\n SZc/cXNJOcDs7kzs/hk3ksXMgzW4Y6bFRJ+GaAzzR6XdyU95Bn0s0+pFz\n /qOq145wA8atcFmULtfrmdSGecy9CIB9SaQYGBLCUpqyi+UEUgtd8dEPB Q==;", "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10293\"; a=\"320948674\"", "E=Sophos;i=\"5.90,201,1643702400\"; d=\"scan'208\";a=\"320948674\"", "E=Sophos;i=\"5.90,201,1643702400\"; d=\"scan'208\";a=\"543572812\"" ], "From": "Ke Zhang <ke1x.zhang@intel.com>", "To": "xiaoyun.li@intel.com, aman.deep.singh@intel.com, yuying.zhang@intel.com,\n dev@dpdk.org", "Cc": "Ke Zhang <ke1x.zhang@intel.com>", "Subject": "[PATCH] app/testpmd: fix quit testpmd with vfs and pf", "Date": "Tue, 22 Mar 2022 07:18:33 +0000", "Message-Id": "<20220322071833.199619-1-ke1x.zhang@intel.com>", "X-Mailer": "git-send-email 2.25.1", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "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 testpmd startups with pf and vfs,this error occurs when quitting,\nresults in pf is released before vfs ,so the vf would access an\nfreed heap memory.\n\nThe solution is two steps:\n1. Fetch the valid port value from RTE_ETH_FOREACH_DEV.\n2. free the port in reverse order.\n\nSigned-off-by: Ke Zhang <ke1x.zhang@intel.com>\n---\n app/test-pmd/testpmd.c | 28 +++++++++++++++++++++++-----\n 1 file changed, 23 insertions(+), 5 deletions(-)", "diff": "diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex f7e18aee25..ca6c77b14b 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -3378,8 +3378,11 @@ detach_devargs(char *identifier)\n void\n pmd_test_exit(void)\n {\n+\tunsigned int ports[RTE_MAX_ETHPORTS];\n+\tunsigned int count = 0;\n \tportid_t pt_id;\n \tunsigned int i;\n+\tint index;\n \tint ret;\n \n \tif (test_done == 0)\n@@ -3396,15 +3399,30 @@ pmd_test_exit(void)\n #endif\n \tif (ports != NULL) {\n \t\tno_link_check = 1;\n+\t\ti = 0;\n+\n+\t\t/* Fetch the valid port id from port list*/\n \t\tRTE_ETH_FOREACH_DEV(pt_id) {\n-\t\t\tprintf(\"\\nStopping port %d...\\n\", pt_id);\n+\t\t\tports[i] = pt_id;\n+\t\t\ti++;\n+\t\t}\n+\n+\t\tcount = i;\n+\t\t/*\n+\t\t * Free the port from Reverse order, as general,\n+\t\t * PF port < VF port, VF should be free before PF\n+\t\t * be free.\n+\t\t */\n+\t\tfor (index = count - 1 ; index >= 0 ; index--) {\n+\t\t\tprintf(\"\\nStopping port %d...\\n\", ports[index]);\n \t\t\tfflush(stdout);\n-\t\t\tstop_port(pt_id);\n+\t\t\tstop_port(ports[index]);\n \t\t}\n-\t\tRTE_ETH_FOREACH_DEV(pt_id) {\n-\t\t\tprintf(\"\\nShutting down port %d...\\n\", pt_id);\n+\n+\t\tfor (index = count - 1 ; index >= 0 ; index--) {\n+\t\t\tprintf(\"\\nShutting down port %d...\\n\", ports[index]);\n \t\t\tfflush(stdout);\n-\t\t\tclose_port(pt_id);\n+\t\t\tclose_port(ports[index]);\n \t\t}\n \t}\n \n", "prefixes": [] }{ "id": 108796, "url": "