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 818BCA00C2; Sat, 25 Apr 2020 18:32:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 25D2C1C036; Sat, 25 Apr 2020 18:32:54 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 47F301BF7C for ; Sat, 25 Apr 2020 18:32:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587832372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gDJVt2H0hjaT/Y3Beb04dNqTcHjXnMm/1LXKEZbPqEA=; b=FSv19K01Nh7t/gp+U9ffJRP7DPEPohPfa48v65OluDMMHXECFzdUufGZMJGhU5YbmY0TPw sp4GcWfiCIqNc79CGXie+qUBRd8MX0/a5Hp7dpWgcie3BhC1f3QSzPyYEqJPVArUIEGPMO CCSRmgwfasX6apclD2nwLyWj3Cd8L/Q= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-125-NYmwOOGGNKCa-7TPy6aldw-1; Sat, 25 Apr 2020 12:32:50 -0400 X-MC-Unique: NYmwOOGGNKCa-7TPy6aldw-1 Received: by mail-vk1-f198.google.com with SMTP id v191so4298668vkv.5 for ; Sat, 25 Apr 2020 09:32:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rd+kPz/yxDW2f0vO/QcV1HScCp2ivH3hvR1ECwm1vaA=; b=XCCUIOGXPpU2NacY3MQEYdNfJUr3njmj0BQtaShYikukwsS7Ru8UlAYUEQyT+iaC0t LJg7PCJ6ecuIWIpXUO3xoffx1IT+G0e2pm9YYRoeh3qQPIXHzyYXScGuLVoo94kKGHAh 8fKPZ77gbKdFZswbR2D19PxAb+5Ijk492sai693lQmLgSEr53lF9Q5DMXZ3qpmeJ+In4 eS0v2Gn4/+S1A6WN8WIdoJkN/265E5AuCmLLX9dbQxqJsLOCqRxJ9Y7tecNl5L6OQgTJ bUNQrz1CcCI/8kzNsPLQ0xKtrphvPtjIGItG/6SF7XCGc9P8MTDEkDogBebywaLfcLc8 4mEA== X-Gm-Message-State: AGi0PuaGXTGYiUJxiOvChs2CF8xGdrXc8zuR6FKIBKnwtLMW1mRGxn0T +FmMBTVzHlHhnS3fWcJNhrS//OV+3tQ1SvLt/3WD4gAx1aKaXcUGG531PgUY3l5DEQiQJ36NnrS F5CFrGTRhVAh36rwHWMs= X-Received: by 2002:ab0:485:: with SMTP id 5mr11369051uaw.86.1587832370484; Sat, 25 Apr 2020 09:32:50 -0700 (PDT) X-Google-Smtp-Source: APiQypL4nbHgCqNCjnQQSh73+fe4v0/ihWB5uVn7srolE5xNvxy1o2bWBEFh9wUVgg20jIS/0Cz4knmmztNjqF8cdA8= X-Received: by 2002:ab0:485:: with SMTP id 5mr11369042uaw.86.1587832370265; Sat, 25 Apr 2020 09:32:50 -0700 (PDT) MIME-Version: 1.0 References: <20200104013341.19809-1-stephen@networkplumber.org> <20200104013341.19809-4-stephen@networkplumber.org> In-Reply-To: <20200104013341.19809-4-stephen@networkplumber.org> From: David Marchand Date: Sat, 25 Apr 2020 18:32:39 +0200 Message-ID: To: Stephen Hemminger Cc: dev , Bruce Richardson X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH 03/14] eal: alarm: close timerfd on eal cleanup 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" On Sat, Jan 4, 2020 at 2:34 AM Stephen Hemminger wrote: > > Calling rte_eal_cleanup() should cause DPDK to cleanup all > outstanding resources including file descriptors. > > Signed-off-by: Stephen Hemminger > --- > lib/librte_eal/common/eal_private.h | 7 +++++++ > lib/librte_eal/linux/eal/eal.c | 1 + > lib/librte_eal/linux/eal/eal_alarm.c | 11 +++++++++++ > 3 files changed, 19 insertions(+) I won't merge this as my FreeBSD vm is broken but I suppose the bits for FreeBSD would be: diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c index 540b7d38c5..582ff0920a 100644 --- a/lib/librte_eal/freebsd/eal.c +++ b/lib/librte_eal/freebsd/eal.c @@ -973,6 +973,7 @@ int rte_eal_cleanup(void) { rte_service_finalize(); + rte_eal_alarm_cleanup(); rte_mp_channel_cleanup(); rte_trace_save(); eal_trace_fini(); diff --git a/lib/librte_eal/freebsd/eal_alarm.c b/lib/librte_eal/freebsd/eal_alarm.c index c38b2e04f8..b2089d0b53 100644 --- a/lib/librte_eal/freebsd/eal_alarm.c +++ b/lib/librte_eal/freebsd/eal_alarm.c @@ -61,6 +61,16 @@ rte_eal_alarm_init(void) return 0; } +void +rte_eal_alarm_cleanup(void) +{ + if (intr_handle.fd =3D=3D -1) + return; + + close(intr_handle.fd); + intr_handle.fd =3D -1; +} + static inline int timespec_cmp(const struct timespec *now, const struct timespec *at) { --=20 David Marchand