From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matan Azrad Subject: [PATCH] net/failsafe: fix Rx interrupt reinstallation Date: Tue, 13 Feb 2018 22:59:32 +0000 Message-ID: <1518562772-29823-1-git-send-email-matan@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dev@dpdk.org To: Gaetan Rivet 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) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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