From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0085.outbound.protection.outlook.com [104.47.2.85]) by dpdk.org (Postfix) with ESMTP id B49017D52 for ; Fri, 19 Oct 2018 17:21:44 +0200 (CEST) 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=b0/XepOgXwrv5V0NGsEdEiL2K40ZgW85fTKV40y5lZA=; b=FKGbh8/a5gl3ObevY5jug92weHOU0ul29cm0MMthkeCW/NUq4p2ulNQ4/LgET91ksXuHet2Afq1k6uKYEJnnbJ9MORIHKaGuJtLX1xVXXGRIYZ18omgU2dJAF/GaT7/vfBtICFrzyPmtJipkQKkpaHtCRYneaGetDf8oO+kv4xo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM4PR05MB3268.eurprd05.prod.outlook.com (2603:10a6:205:4::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.31; Fri, 19 Oct 2018 15:21:35 +0000 From: Viacheslav Ovsiienko To: shahafs@mellanox.com, yskoh@mellanox.com Cc: dev@dpdk.org, Viacheslav Ovsiienko Date: Fri, 19 Oct 2018 15:21:05 +0000 Message-Id: <1539962470-10950-2-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1539962470-10950-1-git-send-email-viacheslavo@mellanox.com> References: <1539784438-29242-1-git-send-email-viacheslavo@mellanox.com> <1539962470-10950-1-git-send-email-viacheslavo@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: CWXP265CA0079.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:39::19) To AM4PR05MB3268.eurprd05.prod.outlook.com (2603:10a6:205:4::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b27cff15-ffdf-41e0-e241-08d635d68ee6 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB3268; X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3268; 3:L2sBTujGbLlyUuB2TxXE7VCPR70FGIBff4Z7jYsI60gfF6i9OBy8sUm1OyJsqIxw5vr1LhSuO95UKCgwEAGa/M0p9MHH2yIB75jR66WfY81VHPFbcE/l75vlC9kLMKaDIZpPhVOB2bkiESG8URIjXhCqQlDcowkrjET59jTQBiFmUWMPuFjjpyKk6u3ZAumoi8D9Rflcq/OymsODd1tgugrgXdT7eUWfqMMwUMbaDfmhX+1wkw/J09rIZFsFJMcw; 25:gh/1hnZO12gLP1S81pSuLPk+wChXSchel+5VTbq7Ypkm2yEXJ736gO8SAL3H2XqzovoC1XOoISUSqlVBm93qd+ApScqwFSUb1+mcQkReUDGD0h2HbSp/1laYzHFeXAuAkLfLfbASbqFRjmedTh8Mw07g6+tMYVkB6VHhd0P1oiVwC3384bphEJ4gKlmJt0IOYlPBtpqBLcpRVyifMOnH7MvioW22BkMojflgLKVFyg3TmCxz3yAIayznRruTLZujkMsO4GLXFIvG02aIVzF3wQKLj5+/7cngkG6MeNMXXksUSobZlvzL5IIRwYmqFw1scQa4LNlUDjHM0TTkcnK5fQ==; 31:TZ+NQdUwXvMNJC+bc3r86t33c7t1bAElqo9nCusU8Oo+U/+OiGUyPki/demI5QKt9yG3r24X1cUKxOerMfuLg32J8clX2G+CSObK+DQrq6dDohtFgnMY5KCkIRY4z3y99x+z7CgAFvQRO7HOa7ZAGuxEMU+GSUfSCRO4fxjBEPUISCsJksSrPdL/NCw520pn3BXMmWfVgP6c7LzIUBqQW9Rppf3E9HmqZADSHYG9xac= X-MS-TrafficTypeDiagnostic: AM4PR05MB3268: X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3268; 20:BP144vwkngfvWGlCDaE5CiwFbw3rrfqGEW4+ReX9lLOCgeCmuFhp3PwyjIIcAQSUpzPXpO6lrAdkBRyvke3lRfZwOpc+1RGeaz3nLfu1tvx1DkWTq1xh8UYGBepELFbc5XBgV9+SegLDemryuuzjqs+wqHbdrwiD8fj5fJ2mSe93Je0Eeazl9KJjlJa1k4VA4D2gJOdbdUUAm6eh0yN9D7GiPKvYzNEXUB1PIO29nu1LoQsugKW7cCv8sNiOFxkdQU+yrVfnY9DhTOq7lajFDi0/pahNx4dJNpVCegaagjSBKKAfw9FJ5gIMJraJCLUwjwtN1K7cCpX4VHM+O/T+5BndzYVIpmLqLs+DJMjksxpRVpz5W2brnHpTS9bDIooWnN0dZtYw0BWcMkJ6mwpvGKK5zu509GJgFBai6MZFWSbF6DecAU0zvTIuBTho9t/2EG2g+rmy9Y/aIX8XI7V9GqY8lNp49czLRCD2qn04dRXTm5oJQGl4MEHf4BNI2tKi; 4:zv9WRdWn/58lE/H+5+pxJEzfx7fmrOq0yaJKtTphK3CKnE2VI3TfctpEOTcNvs+Xcy51TIlf4FUrqGAJAwfcS4TVQ23XB1RWQtsfbcLxJJkjunHVStZ2AOiH+6bE7bacqnD1FiEaiwTP02nU6shtmZwe3IScBuwesinBFuz/It0S2Dqhd9bL+5HWL+tF1pDAAWp6cW06DXMXuF/eu/1HfIxFeC587mPWGk5TybVXaeX+OfxYaNi6QBD1OJ4Ns2RnkmPiYLMDixBcdJzqqap3sQ== 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)(10201501046)(93006095)(93001095)(3002001)(3231355)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB3268; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3268; X-Forefront-PRVS: 0830866D19 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39850400004)(376002)(366004)(136003)(396003)(199004)(189003)(2906002)(8676002)(50226002)(69596002)(33026002)(6116002)(3846002)(476003)(446003)(4326008)(11346002)(76176011)(7696005)(486006)(51416003)(386003)(186003)(956004)(81156014)(81166006)(8936002)(25786009)(2616005)(36756003)(14444005)(105586002)(86362001)(66066001)(47776003)(97736004)(16526019)(26005)(316002)(16586007)(52116002)(68736007)(50466002)(5660300001)(478600001)(48376002)(8886007)(55016002)(21086003)(4720700003)(6636002)(6666004)(106356001)(107886003)(53936002)(7736002)(85306007)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3268; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR05MB3268; 23:1IIDqjzwzuchg8jwkGXMJFt2DzByyxqL7L70nJHP0?= =?us-ascii?Q?+7tObAItGXhVi+jcViBofnSXTkXRRIbX73oznG7AqOtQgAQvRBo19LMBZPAL?= =?us-ascii?Q?495TALyxGowMXRj3e8mJVyvggGiVJBQJ3cYExmsfKOOX2tBLrBZxQiQ6GbQk?= =?us-ascii?Q?pTiidqdYDzPeqzbLV2jOiw2D97UhSrrw9wwAVfG1s5cvcFIC0jkgP8wilcTq?= =?us-ascii?Q?cFCuE32pq9n972f4AEWpeAQpS4f2BdCvFWb8CMY7OZfVm4NYWZVG+Ip82PwV?= =?us-ascii?Q?hp1ahvgImTmmo6yDJJRgT/f9K1sbNcJJc49vDhUJqpL2F9KFv8mj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14Ulkcj1hNwq/SKzrzyK4qHsekN0XScotFDGlatE3OJ11lxleaJHzAVxfLHylci3b8GxkAJBNThFwvvbjz1vjAiBZevZFAPYlMG68QJZVye6Q9zynLz2TOknSR3OfoSxW/fdWwwKoxVrawOZVaL+NEqXDuNkyE=; 7:M+pLrUqHHfs5tHfOfNPLpt4nOMQXoRg9LPlDa98MxFDfhOUGPgTphQ/IvFs8qB/moYyoD6AO1maLFXrvFuQ01ABNBhovhKnI0T0ZmGDP60hurPa5rNqZsOKXBfBo3BKATiKCJOP0xWJN0jR+NBS0CFKHdn/OD4AVTObxCYsiZW0CwSBPkDEP4JxUbyyom8bqVJctOPpUD4PMk9yvs7yZ9FFMOo7pslLxRqBxxFFQa8e1BparM9/2u1Th9hUA7TCL SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2018 15:21:35.1116 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b27cff15-ffdf-41e0-e241-08d635d68ee6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3268 Subject: [dpdk-dev] [PATCH v3 1/6] net/mlx5: flow counters object create function bugfix 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: Fri, 19 Oct 2018 15:21:44 -0000 The first part of patchset provides the separate commit for bugfix. Flow counter object was not freed in case of memory allocation error. The call of counter Verbs object deallocating function is added. The initial value of reference counter is set to one in order to provide the correct counter object freeing in the flow_verbs_counter_release() function. Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_verbs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c index 4ae974b..6ddb13b 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -72,6 +72,7 @@ }), .hits = 0, .bytes = 0, + .ref_cnt = 1, }; if (!tmpl.cs) { @@ -80,6 +81,7 @@ } cnt = rte_calloc(__func__, 1, sizeof(*cnt), 0); if (!cnt) { + claim_zero(mlx5_glue->destroy_counter_set(tmpl.cs)); rte_errno = ENOMEM; return NULL; } -- 1.8.3.1