From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B3670A04AB; Sun, 30 Aug 2020 13:21:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EB6861C0D2; Sun, 30 Aug 2020 13:16:33 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00041.outbound.protection.outlook.com [40.107.0.41]) by dpdk.org (Postfix) with ESMTP id 788B11C0BC for ; Sun, 30 Aug 2020 13:16:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H9Q14eTjZl321YAHou5zW7JbQr3gzfWZFM2dIK/6lCR/YI6BcEY2/9eB9IeCskwIQPsAbYT5kKrqPJe9lrr6+HqbOMoE5YQhyKjQDtVO72cWHeBtyEGrjMOHSJkkX2Ir1hbnZnMPz8SK/JHWwsEkJNBrrXQyLgrIPMjjW5HhE9zMSFzPqZmxNYtvKD8V1P3+ee0i0zVemn9F/kgKrzHyPImSC2N3PxRjz3gF9s7u8g9CPMRitHVJ14960vsyf7oSrV3NQFkAJbhyvPx4JnU9Sab8bbclBXUAxntiugX8fnGiJS/crFMiDpO4aMgk0Gn7g774JZU2QHpRX9rDG2fRew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RC22mkX0dn4vr5hto5VQHflb95cJLHLvNOIoFB1FUUE=; b=kqDn5z85YT9WfJRHfsyHsZuehWrbKxcG/jXDwp9GrtYDIhxh4JMKO2bCsyE06eeGkJoiirV91k2TRxSY4dXH4epxJkLZfR/TViHWSlYqGvYXb/2nWXqGSCt3+4do8rVwQQfsp1iXRFUFwIAb/8i2IDZhdGOvWNt4BrdSkdBS5vLGZty93CNq9dWCeUe6UBcw8pm6zjIRmXmhOuT6YXB1f/yTEj9AHOgKvhc/AGBKpUOhy45iD3BYFyDBMSNsQHyGQZFdFaa6hUhckGV2kNrdn2IqanX3iuMR7f9J7yFcnPcd4Kk6eCoXMDpBAkmD/JmQjJ7ZIsgXgKQ1TV6e68RDsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RC22mkX0dn4vr5hto5VQHflb95cJLHLvNOIoFB1FUUE=; b=U8vA6pMwVE2hnh5Iw/nKMr0QovEDk2Olp6MQzgCGZA9mIOaqmHiitwQTvg8HhUzYARuhx3k84QC1R0N75UpCz/MU6PKCMxZLjz0SPCMlSzz8MSbCQpkTLgupzTark3yq+37flHk7wYb45OeOiIdHUXSq1D7IJ48UETOja22z7+Q= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) by AM0PR0502MB3762.eurprd05.prod.outlook.com (2603:10a6:208:1b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.21; Sun, 30 Aug 2020 11:16:28 +0000 Received: from AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::4c8a:9848:2e2a:3598]) by AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::4c8a:9848:2e2a:3598%6]) with mapi id 15.20.3326.025; Sun, 30 Aug 2020 11:16:28 +0000 From: Wisam Jaddo To: dev@dpdk.org, thomas@monjalon.net, asafp@mellanox.com, akozyrev@nvidia.com, akozyrev@mellanox.com, arybchenko@solarflare.com, jackmin@mellanox.com Cc: wisamm@mellanox.com Date: Sun, 30 Aug 2020 11:15:37 +0000 Message-Id: <20200830111544.4190-7-wisamm@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200830111544.4190-1-wisamm@mellanox.com> References: <20200830111544.4190-1-wisamm@mellanox.com> Content-Type: text/plain X-ClientProxiedBy: AM4PR05CA0008.eurprd05.prod.outlook.com (2603:10a6:205::21) To AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by AM4PR05CA0008.eurprd05.prod.outlook.com (2603:10a6:205::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Sun, 30 Aug 2020 11:16:27 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6a75f377-04a2-4be2-4994-08d84cd623d6 X-MS-TrafficTypeDiagnostic: AM0PR0502MB3762: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2043; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2mwE7G8RSC0Nhr0ZwmZ5G8BGOZF8osXWxy2gW5gBKuauuF/ejBQi4Qs5cLhqOBocBchrTRGWOQM6mBow4mzj+k9v0c5JoZqRjy9XrapQx08SmTLvgNpO23+ONpjMnyk08K5R7uS/yr96aeoTCgyjqxeVZnH8LHMr3YmvgV6aAZVgyl7Gb5GP8bxY4u7bkBh63XO0uGnhoqiRQwTW7Mg/55RJFMir+NwmkKpHByJJKaRPrB5HrWaxWdUiXoBBy63LVhOFigBTvfDCqpUPy2LkU2z8aV5sH2qXq0JqXC7HesLE/Oe6e/n119+fqYQh8tqyIvRexb8GRk1Jw1Lg3TAEGA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6610.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(136003)(39860400002)(376002)(346002)(478600001)(107886003)(316002)(5660300002)(8886007)(2906002)(6636002)(4326008)(86362001)(36756003)(6666004)(1076003)(55016002)(8936002)(26005)(2616005)(7696005)(66946007)(66556008)(52116002)(83380400001)(16526019)(8676002)(186003)(956004)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: biK4iQ1gvlNLUnoiAOfDH8kXiqVvpGPiFjHOZqbKaqr7a8SkhEuqnOVZmHtk/1J+D/jHkABphrs7jZCQLh5RWrSRTtQ9DMyWC8MhW0kFBGz6DHImsN3gw+jrbmT15VhsCxKl/UNQiTlsiMVv+6Y9C8/K7I9PDKP/B6yZXPpiv62eD9nXMnRIEd8krOZue6xNQtCY2XTkP/I6vU5cad1qp8donBPts7RlIGBAQGm42q1zhd3J/B+n0zpO7fWfdNMRWJRDsiA4LEVKi/RtYfjpKkiQAPI4cRrbwA5Ab8eiTZKAVtWPWPiRW8FlReBwykaCnAOf52dbtF2B4qsEl+IkZ38GgNcYPVsgkiDipitcg0StUcbq2eI3QutjAQiJUMEnR5bYj8O5aijLvmjn9WX84VLFQ477UL8bwINqwjUP/wbiY/c4G961E83ev68Mz/dk+fR3CgcBT3hnnXT67+EpXMVDUHmgKaSgheyVRb4TSxx4QVGa97diS6DyW4wRQWDe9qJFE0yubVeJ7jecnsPrd4Zb8Xvnvra2Eza0fBdyMAPZMk43fWOhsycNzL8rsucyFNGRdgObBriyMVyVw/uiCsM69j9ZNLrtR8H5mjUzFOebpCQ8/ip/sW8Zzg5QxeOXLZ3RSMzVW7YIcyAnFdGLKw== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a75f377-04a2-4be2-4994-08d84cd623d6 X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB6610.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2020 11:16:28.3112 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bnk/9FOACssmXR5ZmSnSoJdZkLQgz3QgXJzkpFKbfyWXcYWYNTPKalstX/ILu5BLArQTfSGGHuCtjPsaXcKbIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3762 Subject: [dpdk-dev] [PATCH 06/13] app/flow-perf: fix memory leak from RSS action 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Currently, each call for add_rss_action will allocate extra memory for rss_data, which will reflect bad results on memory consumption for all flows, and will leads into memory leak. In this fix, it will check if it's allocated before reallocating it. Fixes: bf3688f1e816 ("app/flow-perf: add insertion rate calculation") Cc: wisamm@mellanox.com Signed-off-by: Wisam Jaddo Acked-by: Alexander Kozyrev --- app/test-flow-perf/actions_gen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/test-flow-perf/actions_gen.c b/app/test-flow-perf/actions_gen.c index 9fe11abc94..99e47bf786 100644 --- a/app/test-flow-perf/actions_gen.c +++ b/app/test-flow-perf/actions_gen.c @@ -86,8 +86,9 @@ add_rss(struct rte_flow_action *actions, uint16_t queue; - rss_data = rte_malloc("rss_data", - sizeof(struct action_rss_data), 0); + if (rss_data == NULL) + rss_data = rte_malloc("rss_data", + sizeof(struct action_rss_data), 0); if (rss_data == NULL) rte_exit(EXIT_FAILURE, "No Memory available!"); -- 2.17.1