From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EE0FFA00BE; Fri, 11 Feb 2022 08:13:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC6DB41C3B; Fri, 11 Feb 2022 08:13:17 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id C249B410E5 for ; Fri, 11 Feb 2022 08:13:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644563596; x=1676099596; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=fC/ES/6+tRkY9o8rhA4d3uQs/D61/3V+FYMuvCA0LmA=; b=HYzE1+Sv+m9HJFOCOhskFB+CkOtSQT4rT9LhUjGY/08VeGelnNVO3t5u WD0Yck+OJ9ztnRioYHGaqti4warolX+uIHUfXuqgV/73hh06makmPXA5i k5+nKotAuU6vxfxhEOXX7SVml5O6P9ASpIiykSt4GIAH0CkrDXIbQNUH0 Wn/KBum32Mnw8dsIX/EB6lYE5xRy/FjMrEyqr2op89TpJ9kdRBZZRdCmc SnXshyTCFDf+W/7NJWpwHtifPHqnt33SH0FYDQe7QsMRwjfYPGzwEMQrm OOV4b3fKD8r5/tP5ZUHUSefmOMI9zAVISbGSkxRUnfA5JIHwmyeP3S17p w==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="249885956" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="249885956" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 23:13:15 -0800 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="702001430" Received: from unknown (HELO localhost.localdomain) ([10.239.251.3]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 23:13:13 -0800 From: wenxuanx.wu@intel.com To: qiming.yang@intel.com, qi.z.zhang@intel.com, nhorman@tuxdriver.com Cc: dev@dpdk.org, longli@microsoft.com Subject: [PATCH] eal/linux: fix fail to stop device monitor error Date: Fri, 11 Feb 2022 06:53:15 +0000 Message-Id: <20220211065315.66814-1-wenxuanx.wu@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Wenxuan Wu The ret value stands for whether the device monitor has been successfully closed, and has nothing to do with rte_intr_callback_unregister funcs once it return a value greater than 0 .So if the closure procedure has gone to the right exit point ,we should set this value to 0. Also ,the refmonitor has been carefully evaluted .at the beginning of ret_dev_event_monitor_stop ,the value is 1, at the end of this func ,the value is 0, it reveals that the monitor has been succefully closed. Signed-off-by: Wenxuan Wu --- lib/eal/linux/eal_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c index babd444d9d..8cf7ea5520 100644 --- a/lib/eal/linux/eal_dev.c +++ b/lib/eal/linux/eal_dev.c @@ -366,7 +366,7 @@ rte_dev_event_monitor_stop(void) if (!monitor_refcount) { RTE_LOG(ERR, EAL, "device event monitor already stopped\n"); - + goto exit; } @@ -381,7 +381,7 @@ rte_dev_event_monitor_stop(void) RTE_LOG(ERR, EAL, "fail to unregister uevent callback.\n"); goto exit; } - + close(rte_intr_fd_get(intr_handle)); rte_intr_instance_free(intr_handle); intr_handle = NULL; -- 2.25.1