From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0073.outbound.protection.outlook.com [104.47.41.73]) by dpdk.org (Postfix) with ESMTP id C871A1C01 for ; Wed, 25 Jul 2018 14:53:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3UbqZF43aNhFt8m3SnUUmR613cfugYAaIuyGPnJCBSw=; b=fjGo6BrTamdpqFBYoGRDNojvg54ngOsTAdmzjV3/YhcXKI1CL2xC9/e9XIiX0XvN0Si9jKYSk7dEctsjJnieXYOBH9Hued/3xG4sTQKuzABF9qp/2DeMQI6Co2NgKwcc0O3NHmSeZvFND/yAA08BJtFPMCBhSGI/gZB5mntsm80= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Krzysztof.Kanas@cavium.com; Received: from kk-box-0.semihalf.local (31.172.191.173) by CY4PR07MB2950.namprd07.prod.outlook.com (2603:10b6:903:27::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.16; Wed, 25 Jul 2018 12:43:01 +0000 From: Krzysztof Kanas To: "Iremonger, Bernard" , krzysztof.kanas@caviumnetworks.com, dev@dpdk.org, Wenzhuo Lu , Jingjing Wu Cc: Nithin Dabilpuram , "Singh, Jasvinder" , tdu@semihalf.com Date: Wed, 25 Jul 2018 14:41:48 +0200 Message-Id: <20180725124149.2734-1-krzysztof.kanas@caviumnetworks.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <8CEF83825BEC744B83065625E567D7C260CCEC76@IRSMSX107.ger.corp.intel.com> References: <8CEF83825BEC744B83065625E567D7C260CCEC76@IRSMSX107.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: AM3PR07CA0108.eurprd07.prod.outlook.com (2603:10a6:207:7::18) To CY4PR07MB2950.namprd07.prod.outlook.com (2603:10b6:903:27::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cb63e2f6-430e-4ac6-ad88-08d5f22c29a3 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:CY4PR07MB2950; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB2950; 3:86ujksXe7wFbcplYGCtnNEzzSDUcx+8ZTwYGSKDL/GfXRgO+8lHpJ+Ri127vfVunkQBOgc7GYMQ42xfJCAR4pZhmyrtahd0avGsnO4aPGJ8I52FWMt4wc4qRlY+AvbOU2mki1kwM6bdpJ9Q1lx/2Gerqz0gidGvrRRMHO49DnEK0DV+YN4YfC7l4ZMqKb/DJaoVlDkzmiSlbFg2VwbLGsIk7j0Igo/tkIkxdseCk8CXbBOPS5wJsrUGANFvLmkSy; 25:j9NHXMEhRBu0TWsC9mX5G8BXSOz1WcSoppr9wyX70PorQ3OzZMAAqwF7yLJbQytgrfSU77VINPF+A4MEOgpsOyaiER8mtCT8LaTj8L7/hyQgST9H51nJOFZEb5jkEO0BNi7MwX/MsBl9BY9lPyC5accQ2p/OOO/sSyjC05fHZH8W9kIyS8UL4oBMy2xCawOmJTXzXVEmUPCfI/LnRRtkgdNPGALoJLLgze+cKonJbg6ps5UDhXYThn98uNWkkN8fXD2h936LpGFD4eNoPbFoqsPV9rkHc8cD5CfmkGQX6KrNfYee9qofc9aTgKqh2I9gjuvUtsEl+V93UMa0MZMdbA==; 31:JmvNkaF76rGYjgJTIsPF99FKDfjSJkP41o1Gsm8mOxOj0BJGGWDV73P92R7oWQhKDXaVY+Vy8SXYohgO3YMFk9ABH8NbjdeqNDkRB2zbvaU0aXd8ClvH+t4vn3n5RdAZJ20TN/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-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:CY4PR07MB2950; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB2950; X-Forefront-PRVS: 0744CFB5E8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(346002)(136003)(396003)(376002)(199004)(189003)(486006)(81156014)(3846002)(316002)(105586002)(52116002)(106356001)(51416003)(4326008)(25786009)(76176011)(97736004)(26005)(6506007)(16526019)(575784001)(476003)(50226002)(42882007)(47776003)(386003)(6116002)(66066001)(36756003)(6486002)(8676002)(54906003)(186003)(81166006)(478600001)(8936002)(2906002)(53936002)(7736002)(305945005)(5660300001)(48376002)(50466002)(1076002)(956004)(6512007)(2616005)(446003)(68736007)(11346002)(44832011)(110136005)(14444005)(72206003)(6666003)(16586007); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB2950; H:kk-box-0.semihalf.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB2950; 23:CRrh/55X3rbZMQEpA3ZYqyiUknHYreh5yos1ejDUi?= =?us-ascii?Q?ZgYosh26+kugTDZ8QXh+16iIdnZdOZk7tS6s1DcOSUj+DLfaSCNmJ/ETsyMd?= =?us-ascii?Q?NECSicTPGboQISY2C6Hqvx8/eQk9W3nGgjWZyQf3mJTKbykiH0/ZcNFdrudW?= =?us-ascii?Q?0LS7+ZkXnMqT1sIn45AzW/m4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8zJ9hlAIQbp2Jr4IIyB0S2mA6OCt3kCRYk7XINugA/eHJen3zgjWqWBL7+t?= =?us-ascii?Q?RIQdmhTR+JpOAnpSpRARRlG1oTVq6sAzuwTv/nxyAavpTjjw5ABQCh3LTnLS?= =?us-ascii?Q?lCLW6HQmbYaqhaiUAnmXFbeU0s7NWaUMFkcqwP3vVkTijgBuESXK+2mj6J08?= =?us-ascii?Q?tYTWp5SGA2OHLHlfZKTgTHbQ4PWyo4S4P9+RD8tQRZ2IWucR9Pr8D1BqylZ6?= =?us-ascii?B?Zz09?= X-Microsoft-Antispam-Message-Info: YCYiMjvwG7Ipp2En/3zSOKKfKRgBYIvoKGtY5slkj+zpoEXvdjTP9ibQi1QvUuYzqcFWcrrBQfxkENIpGwz9IADBze7BugWvXYgI4CYovnwmiBDg8O1sB5pYiknlBQCoBSf8RMiA38ifyJwEckdJqafe80O7MULjpE55/ZplzrpnK3d9IvnlsLC4PyE6Dq1wc7gjAgFsGlgc8KMXVpbNANOvvE7I8j/m+qAdho+LYJ/vdv6aSRewPBmohBoYc28cPjmMvgNmNgsieft6b94N4dANLQlRjAb4pCzeceaO+MZMYWPLcHCKMjgrQC/ras2qieSY7ahJrMmFVU5yauz9EtW/KX2akvPPeYmJpQ8cX5o= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB2950; 6:/w4IOCxB3mMMuq1YzhPa/0OGnafayqS9DhamLOyjwb6b9gWv6PX4dUHJX7VhO2BoxQjY58NeZAvyywGVQi720uEbUice/Kw7/QGoKfYtuWJE1MEX/YJU2HPguHzUjdcT1bztA3GhvUXmyym93b3A75l5xUeG6o0cBXsOoKPDHXgjp4cKw05N3nn7x9/094oLJKN9+Fjy+o/fMLR4ygywWTuQdaQfeWzQ24Tca2xe3GcCIfMGYV5vLLc6A5IG9Zw6VlciQjUfSxGphReZU7WheIAitp23/d3PS81nNAsP/3fLBazLwvff4syneEI8PU9QgAgrWG0igAFvHgKORvXebz3SW29TfgD638yrK8hswYie8YSA6Jdc1HYfb7Mom6NYqGu8bgQtHGBuszP8N2fTAYVnevq7GQOBs3VRalysZdR7amgbd9tq6eX93zjQ20IdKajtmJTzh1/+m7kXUjPy3Q==; 5:V3erR+Dj7N4JAK+2X90lhjmaUqf2VP5DwknZXjHInmSLayIuwjEAyVJdAJBJ3M6g2bQuzgSfPY3xtBYT7Cm4i3Dhwju6dH/ob8KE6RALIoNfgCLEJ2qB9rO5ogej2qkdfGCvkzj84uFnkAv9dPK3eSepz9106YkRNZEgr+xw4Yg=; 7:wITheWrUd6x5nuDtzsWZgSZt/7pYH4PUXPezG+FeP/VtuyWI8Zh9mMTKG3i7a323cdoZ8HVmHkxfFNELGCrsGAqZ0UQjkmiJ1w93iwBAvvAoMF/cTY7CvO1eXsgzt46S8OuBCuP0+hZalHQRRZxpDxv1d0JKhksUEP4PcMp7L6q+ANvODL3Gg9mtgmWhrSGlf1g/K3QE+OlfaY3k4Zbq9cphNBaxwjU5NhkNavJUHK2awKdxu9mszvIfucKqMo9n SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 12:43:01.6924 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cb63e2f6-430e-4ac6-ad88-08d5f22c29a3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB2950 Subject: [dpdk-dev] [PATCH v3 1/2] app/testpmd: fix use of uninitialized field X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2018 12:53:36 -0000 print_err_msg uses message field that may be not initialized causing segmentation fault. Fixes: 12f76f5247e2 ("app/testpmd: add command to resume a TM node") Cc: tdu@semihalf.com Signed-off-by: Krzysztof Kanas --- v3: Fix the Fixes: commit message line --- app/test-pmd/cmdline_tm.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c index c904e44f0f2f..4f515241703a 100644 --- a/app/test-pmd/cmdline_tm.c +++ b/app/test-pmd/cmdline_tm.c @@ -234,6 +234,7 @@ static void cmd_show_port_tm_cap_parsed(void *parsed_result, return; memset(&cap, 0, sizeof(struct rte_tm_capabilities)); + memset(&error, 0, sizeof(struct rte_tm_error)); ret = rte_tm_capabilities_get(port_id, &cap, &error); if (ret) { print_err_msg(&error); @@ -374,6 +375,7 @@ static void cmd_show_port_tm_level_cap_parsed(void *parsed_result, return; memset(&lcap, 0, sizeof(struct rte_tm_level_capabilities)); + memset(&error, 0, sizeof(struct rte_tm_error)); ret = rte_tm_level_capabilities_get(port_id, level_id, &lcap, &error); if (ret) { print_err_msg(&error); @@ -498,6 +500,7 @@ static void cmd_show_port_tm_node_cap_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + memset(&error, 0, sizeof(struct rte_tm_error)); /* Node id must be valid */ ret = rte_tm_node_type_get(port_id, node_id, &is_leaf, &error); if (ret != 0) { @@ -615,6 +618,7 @@ static void cmd_show_port_tm_node_stats_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + memset(&error, 0, sizeof(struct rte_tm_error)); /* Port status */ if (!port_is_started(port_id)) { printf(" Port %u not started (error)\n", port_id); @@ -727,6 +731,7 @@ static void cmd_show_port_tm_node_type_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + memset(&error, 0, sizeof(struct rte_tm_error)); ret = rte_tm_node_type_get(port_id, node_id, &is_leaf, &error); if (ret != 0) { print_err_msg(&error); @@ -832,6 +837,7 @@ static void cmd_add_port_tm_node_shaper_profile_parsed(void *parsed_result, /* Private shaper profile params */ memset(&sp, 0, sizeof(struct rte_tm_shaper_params)); + memset(&error, 0, sizeof(struct rte_tm_error)); sp.peak.rate = res->tb_rate; sp.peak.size = res->tb_size; sp.pkt_length_adjust = pkt_len_adjust; @@ -919,6 +925,7 @@ static void cmd_del_port_tm_node_shaper_profile_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + memset(&error, 0, sizeof(struct rte_tm_error)); ret = rte_tm_shaper_profile_delete(port_id, shaper_id, &error); if (ret != 0) { print_err_msg(&error); @@ -1004,6 +1011,7 @@ static void cmd_add_port_tm_node_shared_shaper_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + memset(&error, 0, sizeof(struct rte_tm_error)); /* Command type: add */ if ((strcmp(res->cmd_type, "add") == 0) && (port_is_started(port_id))) { @@ -1098,6 +1106,7 @@ static void cmd_del_port_tm_node_shared_shaper_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + memset(&error, 0, sizeof(struct rte_tm_error)); ret = rte_tm_shared_shaper_delete(port_id, shared_shaper_id, &error); if (ret != 0) { print_err_msg(&error); @@ -1254,6 +1263,7 @@ static void cmd_add_port_tm_node_wred_profile_parsed(void *parsed_result, return; memset(&wp, 0, sizeof(struct rte_tm_wred_params)); + memset(&error, 0, sizeof(struct rte_tm_error)); /* WRED Params (Green Color)*/ color = RTE_TM_GREEN; @@ -1369,6 +1379,7 @@ static void cmd_del_port_tm_node_wred_profile_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + memset(&error, 0, sizeof(struct rte_tm_error)); ret = rte_tm_wred_profile_delete(port_id, wred_profile_id, &error); if (ret != 0) { print_err_msg(&error); @@ -1455,6 +1466,7 @@ static void cmd_set_port_tm_node_shaper_profile_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + memset(&error, 0, sizeof(struct rte_tm_error)); /* Port status */ if (!port_is_started(port_id)) { printf(" Port %u not started (error)\n", port_id); @@ -1571,6 +1583,7 @@ static void cmd_add_port_tm_nonleaf_node_parsed(void *parsed_result, return; memset(&np, 0, sizeof(struct rte_tm_node_params)); + memset(&error, 0, sizeof(struct rte_tm_error)); /* Node parameters */ if (res->parent_node_id < 0) @@ -1729,6 +1742,7 @@ static void cmd_add_port_tm_leaf_node_parsed(void *parsed_result, return; memset(&np, 0, sizeof(struct rte_tm_node_params)); + memset(&error, 0, sizeof(struct rte_tm_error)); /* Node parameters */ if (res->parent_node_id < 0) @@ -1844,6 +1858,7 @@ static void cmd_del_port_tm_node_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + memset(&error, 0, sizeof(struct rte_tm_error)); /* Port status */ if (port_is_started(port_id)) { printf(" Port %u not stopped (error)\n", port_id); @@ -1933,6 +1948,7 @@ static void cmd_set_port_tm_node_parent_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + memset(&error, 0, sizeof(struct rte_tm_error)); /* Port status */ if (!port_is_started(port_id)) { printf(" Port %u not started (error)\n", port_id); @@ -2008,6 +2024,7 @@ static void cmd_suspend_port_tm_node_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + memset(&error, 0, sizeof(struct rte_tm_error)); ret = rte_tm_node_suspend(port_id, node_id, &error); if (ret != 0) { print_err_msg(&error); @@ -2072,6 +2089,7 @@ static void cmd_resume_port_tm_node_parsed(void *parsed_result, if (port_id_is_invalid(port_id, ENABLED_WARN)) return; + memset(&error, 0, sizeof(struct rte_tm_error)); ret = rte_tm_node_resume(port_id, node_id, &error); if (ret != 0) { print_err_msg(&error); @@ -2143,6 +2161,7 @@ static void cmd_port_tm_hierarchy_commit_parsed(void *parsed_result, else clean_on_fail = 0; + memset(&error, 0, sizeof(struct rte_tm_error)); ret = rte_tm_hierarchy_commit(port_id, clean_on_fail, &error); if (ret != 0) { print_err_msg(&error); -- 2.18.0