From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0078.outbound.protection.outlook.com [104.47.1.78]) by dpdk.org (Postfix) with ESMTP id 69C4B1B367 for ; Tue, 13 Feb 2018 23:59:51 +0100 (CET) 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; bh=qzVjAq33Ns4VRT/Xzbz7dv1J/wIfL2D1PfDsjB7RRq0=; b=F54DViz0X9qECNn6ZYdj0+fXc8LdOCfZMNeXlyEqbz6iu8PZU0qk1DJ7G0JU3H1AfG2Dbctt1cDrvB/T5lZMw0ro6nAeFbmMmmzMUAuR5C8X4aSeOZWXaloRdD9UOBZ+m7PVZXo5me+D1o47z1EhKWEDy0fUIl2Q5cxJaVngU1g= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by DB6PR0501MB2661.eurprd05.prod.outlook.com (2603:10a6:4:80::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Tue, 13 Feb 2018 22:59:49 +0000 From: Matan Azrad To: Gaetan Rivet Cc: dev@dpdk.org Date: Tue, 13 Feb 2018 22:59:32 +0000 Message-Id: <1518562772-29823-1-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.9.5 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: HE1PR0102CA0044.eurprd01.prod.exchangelabs.com (2603:10a6:7:7d::21) To DB6PR0501MB2661.eurprd05.prod.outlook.com (2603:10a6:4:80::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 41fb7114-2b69-49ab-1b19-08d573357c67 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DB6PR0501MB2661; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2661; 3:6qV0lZGA5ibTY5eqRvXyzGkJ8EUpDH82edw4fKTHwGJwuPieeMKgwZtztdIgQO/RCPhml8nU7zVkr1uVBL/uxM9ZMAXEdLX5UiflluHRPq2KaOZEB3msqEMbzJledF46y5kGsNwe1hXgG3WQ9901r+tMs7iLc45U408d97aEOGVYuLAQ49ub/WryIfpB3AFQ24LfGDSKWdkxFm5b1dUXXF6184EIwDg1zjwWxVld32r0eqTQC+nXE/5R6UT5t4CB; 25:MA/3nZi5pOUCoxS8wahQKxtfUOMNE9j05nT7a24/oDgMkTJb5JQG0iQxGDDWqXHMUKJtwAmRQ2oSidIGE+k5AYNOFllJ5ICKPyP862QxKmSXtUZYGGSbGp9HEOgyHDTzXCDNb1agoj67ViOTSkW2OQyFC68Jn5yYBC+HJZlRIFuXs08f5qKLuotlMx9M/IaZXlbosv+nPisowC4ktNKKDSMQdCTpWHzcMmgW7vc3eeHOt4GtknqWLpH6eLVvsvOIBaX09npc9xnR2Q2tkPEBrJHPpYkBoITUF2XKE1FmQcdq6MWl3jq5hb0TCeYeXcC6O3wi8NJU7DYpF01dddTZgw==; 31:PG5sG7c5aJxKJBZI8JhnPUlSYwybvwFe6psDKZVRBIKtgz0Zl8gZenovGJmmRpNdM34jtDkDHkgYax/nyyDlDzgW9/FeMFt8quE6X1hnN0WKBtNTpg0FI2J/AEiUoQqYoTjyk8XDZeWavdZlJHCwGkm0q3oADDsp24NBvDBpzK19p138py3keuR5ZsGG5fedGx5I8haXacQamLwSa1Z507SUPjQ1gsLhDI5mKjpLymM= X-MS-TrafficTypeDiagnostic: DB6PR0501MB2661: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2661; 20:2bln9Pih2Vxp1Ek5+A79ZZpu2MPNz1kkJN2TkU29E0Ojp20WPYWRRGfwLDyuZd89MhhlrWYukIjr/RG0Y9vv9glgA/0FF3zkZv3bXwiXCUs1k+eCp5rZzTJNy2bzBcVQWjzXO69K5tVacTkxTTzJlWlFwBPavB7PYqEguXiihnCiHL2Y7AP+wefyIUrbKnVCyAW5vVCtLQQsHgJhSDUeLAKDeq0HucJ1OXh36KSEKGcOWzAj9+1jGnohWgCFb5dv8glDx0AwVTl2Zb4dXKBM1R3x/K/KCAz7vOoYrHo1NAZqwB8oDpC+Fx9SJeyjTaEsyDzrRWdyanDDgvKpH1ECNBk2cwAfPFQfU+dIPkoZOeIOsTWVsEYflLY7yxXtgn569hwPNiWRUpZXghklmGMRdmoCYF6LEo2Fpufw6eyOQtvCWPMSDvxNb+Bj6lx5tGVPLgNJ/fpXSTGZJDjG0OIfga+hYwhRap/JuauMCqgxtYXucUKrdBRu+FCs0P3rkiO7; 4:qD/ewWu0AFF2lWgsHINXVbda8JpC1c2mFDwLd2Ff0Wdys2zsYnZK2VbQyMUW9oxm4MEVgHGp5yzKvFWRraufmV8pamGCeudR5aa4RPqvz4zvcLXL2WDurxlP6uLgtRyH0PV2H6cAyjD5tGKLV0iTppo3YrcpOG/3x3OCnzEf/WBfzVZjWvWXcUwAHrB0khOS9+Fu4LC/5bN7AXt9SZRIXS8KC6A2JTtvDd+Z5qk0xQCQflfwJ2tzixRN3FosR3Eu1Gcuk3YK/ZX1KRjOl8S5Hg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231101)(944501161)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:DB6PR0501MB2661; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2661; X-Forefront-PRVS: 0582641F53 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(376002)(366004)(39860400002)(396003)(346002)(189003)(199004)(105586002)(50466002)(48376002)(66066001)(47776003)(106356001)(86362001)(33026002)(6666003)(8936002)(50226002)(8676002)(81156014)(81166006)(1857600001)(6916009)(21086003)(316002)(386003)(16586007)(59450400001)(5660300001)(25786009)(4326008)(7736002)(305945005)(186003)(16526019)(26005)(478600001)(69596002)(6116002)(3846002)(55016002)(97736004)(68736007)(53936002)(2906002)(52116002)(7696005)(51416003)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2661; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0501MB2661; 23:wXfs3pXGnvlyy4/iH8vo0Zcm1vDkGiLubealGPC?= =?us-ascii?Q?tNPqH0dSu3qLHKxNWFdR69AHS0A2SGeLDF5hQLHp2nTI58RgcPC03IQEclIa?= =?us-ascii?Q?lqaav+Yw+MQc5c4vFtMct1ZZd6xGX1uJm759g0NFWTlndZBgMaqdt7wV3yDx?= =?us-ascii?Q?XsHESBPLTQLdtUialu0H+dcL83gUQ6r/pr3IOfPh/UWgs+/Oxhi2/z0jYeKO?= =?us-ascii?Q?vdD0k1Zqy/EdoEvPzONO74sunUkBT+wNtLxoUpwu1g0qOgr5oqaRBo9yAxiF?= =?us-ascii?Q?9x/4g0ArDYqHqirv88PDY5Qmq0sX/ELhPZOxCDavzuHfHOOYUW5/X4hLjITB?= =?us-ascii?Q?+REJsm0k90xiCZhVnZY1nZxVbp8Uu6SqKxROxh5yZ0MsXv7InTKofP5H2k+C?= =?us-ascii?Q?dmpr7trO3Tx2fGiZ1TLseuQ3LCNBjqBOVEAgSxujb1LFDc5ucBticHnvsfCY?= =?us-ascii?Q?5/VgSr3d4vc743mPqGGMT7aB7TiRScfgAZD4Y//KUV/ikkzfR72IZu/yajtx?= =?us-ascii?Q?C+sliIJxb4ftQhQ07N0cki8PdGuH5XMXzzUYPegP35ATF7YbU5ZjnGcFVQai?= =?us-ascii?Q?5p6PTrCZ4iEciWrOve9zkVffMNX50wia5wH7W5f3AffhcoisQwpgN4LfjxeB?= =?us-ascii?Q?eUNMv4Kr4ksssS8+8AyPu9Xj0Qc+Rp4R6v05xwS0FjJFUtx/6oJS6fI5i9Fu?= =?us-ascii?Q?LjmMUocWeQgKXMMEQdQFHj3uGHADsHFOpn0tOMU+Fhri5ToW12Vmk6PBLG4E?= =?us-ascii?Q?MPznt42450HRkcJ9Vm1zZTzZaQAUwTcvZbnqkY1lLZJMDy6TYSRNBHuNrxtw?= =?us-ascii?Q?an5+aiq56HcB5yntVveuaz0gckB26SSALEMu2qqx2OxC94nPK/MLE05oZCLE?= =?us-ascii?Q?rZ+6PxTcb+ketti0//j0/ABOaXk4978nDwi6QwG0tKzCMYlvaE81IsCVK+c5?= =?us-ascii?Q?twO0TVuZWMyBNaFKs/pkHI9Ga2OCS2BwQMgnb9lI78qKrkIoCyO25+YLIVRG?= =?us-ascii?Q?kE/r0XPjUXEEaEXezgZB/OUwpPDY37ipeqcwChRFd2/bK1A6FCu+61J5jLar?= =?us-ascii?Q?VJszCIhKNzhNk8Y9Qr4ZYoMZQrmpnbQImq0sQZDokcWetsNXWMavL+4ebPzb?= =?us-ascii?Q?b89qpuRhUgDdd+R8XxG05XsBJtbp4CIfxU9scVloDy81EBLYupQ0RaQ=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2661; 6:xt9eRWZuBOpPuh2KAM/WEXW9X8YpFlhG7+nDtFLCJHWiz9AjLlR1OQD72MpRqA4GwiBGfkBo33m6dvvsswfrDuwmN2pqzWljq5X0mR+PGDi2Q3CSCDGWNs7b+t5HSwJntxLeS3xtpV9lJtttSrJZuxGGl7hHqBlDngDc5A32e8/ynfXq8tQelftfZ91FCFbP9YzyBZYZS5cRF2Traeqd56OKKzNVnkwrYmG3lanmfnzHxjbaZ6XKK7+sfsWdmvLfpFxJMIuJtFTnJqHduJEh9ZQHYT1HCpjwjVAIpiXdFufErXOg/caF5e8aYSRl62KchLCgsuQQI+FsXoYSpj2Oi2OVYHDaJGhw/kP9S9dtg+w=; 5:6BI63dM/inj8m6xuMggoRa+r679wK4NzfICssy10UsaeK5Zr7KavxuRllQq7U4tx/9rrHkQ1G5yFOdVq5xVFhBes+a+Ff4IqjWQhNeZTAIgzLJydeoomNM1OMMYsC/+MlcvLlPVUrI8HnnhxSzwcgHjjlToAruXYOD7NE1YZFjY=; 24:wsy6vL+bQgRVtanjkzHiOKXxCWY9BkcQEIE0IQHvn5FJhbQEADNNoFXzzroti9qSTSh+q5ia/9jy0xQ+D/2HQQBSox2hrj2Ok2judJcV/SM=; 7:IZlr+tIz2+GIw4538rbPDFzaufx+7KUIfBLOARto2a6Wu1onqh5SvUJ+32UVH0U6e3Ja6zNwTmHYhgP9ZyYmXXrKQZ+tKSLvuPHA/WcvVu19C2SLMIqmR8+Y9hXnrxtCjKxALik6BsC274z6J5XpVNK2+3VY26yeArT4eXatvLwmkr/AAuqzyaz6jhDrlHEAIShBjyR/0hGDIlaNlr7QyuTr0l+4QU3DQU+XnZ910dHFj5W265FXY01IPNdT/Eou SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2018 22:59:49.2573 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41fb7114-2b69-49ab-1b19-08d573357c67 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2661 Subject: [dpdk-dev] [PATCH] net/failsafe: fix Rx interrupt reinstallation 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, 13 Feb 2018 22:59:51 -0000 Fail-safe dev_start() operation can be called by both the application and the hot-plug alarm mechanism. The installation of Rx interrupt are triggered from dev_start() in any time it is called while actually the Rx interrupt should be installed only by the application calls. So, each plug-in event causes reinstallation which causes memory leak. Trigger the Rx interrupt installation only for application calls. Fixes: 9e0360aebf23 ("net/failsafe: register as Rx interrupt mode") Signed-off-by: Matan Azrad --- drivers/net/failsafe/failsafe_ops.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index 057e435..bbbd335 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -181,10 +181,12 @@ int ret; fs_lock(dev, 0); - ret = failsafe_rx_intr_install(dev); - if (ret) { - fs_unlock(dev, 0); - return ret; + if (PRIV(dev)->alarm_lock == 0) { + ret = failsafe_rx_intr_install(dev); + if (ret) { + fs_unlock(dev, 0); + return ret; + } } FOREACH_SUBDEV(sdev, i, dev) { if (sdev->state != DEV_ACTIVE) -- 1.9.5