From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690081.outbound.protection.outlook.com [40.107.69.81]) by dpdk.org (Postfix) with ESMTP id EA9761B062 for ; Tue, 10 Jul 2018 09:00:29 +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=ueG00QGRNCNbRTSfG014ymggNDKwW5M88Evi3eQpn5c=; b=jVfcyUQIQwka67/fqTlKTTS9xGRXcXCnnLm429C+dDZbwmVu31slF3bH8pBOzj39h7CjfW0D7i1aVEZ3medYGvW3oZuAD54iwOUVLr9lOth8aZlo46DVlBJuHN2cfgj8AaN+pIRWsXqEfWXNffeWwmw66DAituPWZrGb9Rn4Zr0= 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 MWHPR07MB2958.namprd07.prod.outlook.com (2603:10b6:300:1f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.19; Tue, 10 Jul 2018 06:55:17 +0000 From: Krzysztof Kanas To: krzysztof.kanas@caviumnetworks.com, dev@dpdk.org, Wenzhuo Lu , Jingjing Wu Cc: Nithin Dabilpuram , tdu@semihalf.com Date: Tue, 10 Jul 2018 08:50:59 +0200 Message-Id: <20180710065100.29511-1-krzysztof.kanas@caviumnetworks.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: CY4PR2201CA0034.namprd22.prod.outlook.com (2603:10b6:910:3e::23) To MWHPR07MB2958.namprd07.prod.outlook.com (2603:10b6:300:1f::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 05c85d67-4c33-47b5-2c10-08d5e6321947 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(2017052603328)(7153060)(7193020); SRVR:MWHPR07MB2958; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB2958; 3:vlAnF0W9oPtCvJTIlxovmg97jdpOCX3f7v9VlMU81hqY0AyR50V5+qXFExOyLFhs/e9iFLEsvjJJFzn31j2x9+smiyCg3fGu2C8qZc6nFJwHOsEyuCkllkOPXxqWBE7O/dVxV3heh3jdpVf2uCYCPYI5Nt4JsY9SaSb8N1VgMQ3hrwiGq3IOYrM3yVk0tBI0ggm9RrjBWANzhhXj1hHKfvfYsIxt1qD1b7yd3c8f3fX9wyRcCj1JSUsHnzsHs1Co; 25:FIDm1TuZCCg4E4B1w48EVhGGwzNgiowvmBGSByLKlG5UCi3DK0f9WpgfE4g2kA994gJsNmbDAig3oqfB7UrCYlZ0FHy76AXvoNUsOnBbXFfl41hGklQA+I8CeWufMwrpgFREn3h/rq0qmaDnXWlp3ouCR93J2ddp2O6ByCiKQCUbkVl04tJpnJn92o+2thlS/aTfjyBlxhmcOd+geS2GzPIpJO/zTm4i+t3EOBtfHswiC/5BVfDQtj0tcfbZB8sgwL9Fy9IqxFVKBdhQPT2pvkInQ4RDUES2fwUBSNOqpX2TbGyfNCZGPjhef8l3pYdiWnJCFkRmFOnsuqO9eU+K2Q==; 31:FD0uyAqp64qjRGEHAL1HROGTYBOJkYRVeJKUaG3apG9RlE1nHoeYzl6d0g7G5IeOLUhN7H9RQIFb9xHaDuXeggn8HaN45er8aiNVutgL1lQkf5eJc7RHCfqEgihY/rOFVXh4/FA9gBT6A68xLLDlclBXtAm8Qml6gSsfdMq6tQtxAQSuNn9nYj8OhBg4E7rBtBLg84npoaiEGxCGU0JNUyN6aDML+Y8LqkK598GEnIU= X-MS-TrafficTypeDiagnostic: MWHPR07MB2958: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB2958; 20:ueDSxkWJBqxse/5iTNs8LGKedjn0sqD3QjpWQigAxLQ3YComxY2UP/wg+674YW0C2ZAvgzJwDqMl7igjdt/wGBYk2wjtzVNEmvV/S1QLoKs6BCx8utOHot4GCu9N8GCjYRnqwYczel5VmLdaUnENuPmdPXvVEkyDyOCtwKRij3LeQxSflh3sAGsBKqTb8buyIuGsISJTzTCRW5QhusjKAgIVjCll+13OUSJIJcEyyGLfbVpHZ9hnlOuJag8CjkFa+zsQKwesn1T17/6kEz3BK0x+g9TCZs4p2DVTNa5aasiU04o1gne58r0ofJrWyUtSeS1gejJA7/I/G/QIuH1M0+wRdeYecepNU8uTFXycIllQxCnJlUe7SDeCM1ICeQpS4XoQhiQWz+q9ewNO2dovLQZ+6S6CiTdPXGpSB7M7jdhBdaq0yhJyxFDx4vsnxQ0a+quQiKXwWUVX7M+85m/YXKlQa2n3NuS7wnx7ZMHn7GQPhvctfd28a1zFlSmgxUICQScIkOabP12kMkDJsUEuXTE/Tmqze2/6jmoYEC2VbimTdYqjhpNjnjJcO44USIZk2D+WdSlUZQ+7kUFAaEEFo0P4vJWrdl8azOC0wm1JA14=; 4:cZQPndrwOzoujr/2fHmswxOAMPRwZeYhO0UDVw36/ySKzHYaT2Y9FfM9LZSuwyzPCgcbM2p37qpI4GI+wonq/v/Y2yX6aApKxO4IKZKAODzMx0y4H3wimr8Tt6rITEihSaRZEdAAMJ4k6N3C9P3ZBG4r64tj5IKWImVNlcEzYdexFkQhpGiGElcVJ8C2UTfaNYHntP+pjxVMYseaRA3Qk9UK57HGMDpLnN/VPr1kejJv0Kc4iSixWWr996OlE04MbBZ4Sp1uEnorPCsvmvlElg== X-Microsoft-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)(5005006)(8121501046)(3231311)(944501410)(52105095)(3002001)(10201501046)(93006095)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:MWHPR07MB2958; BCL:0; PCL:0; RULEID:; SRVR:MWHPR07MB2958; X-Forefront-PRVS: 0729050452 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39860400002)(366004)(136003)(189003)(199004)(16586007)(478600001)(6506007)(2906002)(316002)(386003)(305945005)(105586002)(72206003)(48376002)(8676002)(97736004)(81166006)(81156014)(2616005)(956004)(16526019)(44832011)(26005)(106356001)(476003)(52116002)(14444005)(51416003)(42882007)(36756003)(110136005)(486006)(7736002)(575784001)(3846002)(6116002)(5660300001)(1076002)(6512007)(66066001)(50466002)(6666003)(53936002)(50226002)(47776003)(4326008)(8936002)(6486002)(68736007)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB2958; H:kk-box-0.semihalf.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB2958; 23:daJTd1utqnZJP/MkRGcnzvspDJTTyCRFQo/CH2FHQ?= =?us-ascii?Q?6xoTN8TYiezsOZJL70aYVEGUZn1Dr3XaIA9iCMZ3BIn0sp4QVue4zmdAEx97?= =?us-ascii?Q?G6RhOfIwVVTHP61SwOx1Z4IPpSzB12+sl7eQlR7aSPCeEfcMtOTjeEoiB5WL?= =?us-ascii?Q?KiivFXSviDFJwFMcGQvsWa3bJPr7uN7DMmMcvP6H1owM6J3iUvTaxJzJjheL?= =?us-ascii?Q?0C51PRiYLUPm5sFPAg/oyIWNfCwFpb0Sw6+V6iNyfQ1nol5ePqS2FjMD3FwU?= =?us-ascii?Q?2zNJfzjebjmsKRrrouUENawKnf0NIEBH383JSEqmGBskWb2dh8XZtyddaNVt?= =?us-ascii?Q?ipKXTarzS1OL0z3tsDYXh7xomr2DEu9472/AWkAQewGeaJu3lKtsNqHLRiVh?= =?us-ascii?Q?lQ93yhpwlIRUjNQLOIJd58jEXtcRULW6Qw4fpnJU1NFiFbKcL863sCqNVXBN?= =?us-ascii?Q?dY16iQmF/RTh1d7bBRmC/nusn9OTmrfjLAwVwgamSkNr7udOXs41CztoG3Bm?= =?us-ascii?Q?dV1Zhmr481b+FIBqMwAV/3gd3eYXx7VnJSczgXa5+XOXfo2QN6VrWfAHFhn8?= =?us-ascii?Q?sx4jWArJLWVR76ek8Loy01JOmT6C09zbX0Q+ipubzHCij/WH/XI9FznoJv8M?= =?us-ascii?Q?8ORz6h//OleTNxVLR1OIVbOGwfnTV75MouiqhC7gsJ0MENyjlhblub27BWeh?= =?us-ascii?Q?vqBirq6kBuQtb4e9uCz2WgRjsLaqpNm7JGkW21S0vZVIf26aMkOJqXOT6ydz?= =?us-ascii?Q?yt/BO0FbSB9F7kGLcWSRrOSwjfH7kE15v73rpAfOihprbEFvWAFlQxuJuhqp?= =?us-ascii?Q?LOYiQAP7IovdntwBfQkytshE8HfIBRMfDCb8AM6F2lOftOdgekOE5QsNzdTy?= =?us-ascii?Q?lXVBlo4M/oCI6fhTGFZ+wHmbYt4Adn0YhSKYiQ+0LJJNPq2LyPeRhtkHl5Bd?= =?us-ascii?Q?jW+jP5iwULQAfK6s0rfqUYBGZdrkl0i7SHzFeA62SGnFyeKAKd1V5jWumswK?= =?us-ascii?Q?iEehzeZ10acYxIDrE47qmbfbLnVo+hjwjHdVZMDXgpJpCo0jaQ2tSH9uOrOd?= =?us-ascii?Q?JOhG3P3xZzxXUkKxtx6z5ErOCptcSUb9pledXMhS7xslN4bp3Cxh725rs+Oc?= =?us-ascii?Q?9XoyQ3tSIABt+d7dLq4kv+tECYzJlG0GLJBa7evJ+ksdKAP3zEEhpk8I1B/K?= =?us-ascii?Q?/5YLhKkW6nNHdu0q1J1wxHuLqm7FwIJRCPZ?= X-Microsoft-Antispam-Message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1ZC+1wXs1o0Zwt7WOj235A3gME43sus++zPPnaoEzWc5qo4pWi94eU8DsWzuUEwThEtJ7Rshd5EVhL1901H5Q1tCeXI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB2958; 7:yf8BTacUoYdfJX7ws7tjJ8Nq9F17ARGxqwMbT+7knQOszPOiMJ+fk0chwoauPXT2HSpgTIF5qOZ8V2OzWvfbT0eU0xwMgDqsH78DliawnJ3GZ/DbQ0HGT3dHIoTcpgMorkqLe10y82qzSGpyXwhC1Ne7NWSk91pv/L/FG3aCiQtU+ih9pfrh5IXYMgzOITorIijGp1fdFrpW2jRY7oDt5yfyDENgUQhJHGiE/qjWjoJf4mf3d956xTilhR8wWfrm X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2018 06:55:17.5739 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05c85d67-4c33-47b5-2c10-08d5e6321947 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB2958 Subject: [dpdk-dev] [PATCH 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: Tue, 10 Jul 2018 07:00:30 -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 --- 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