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 3F0B3A00C2; Sat, 25 Apr 2020 18:49:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ED9781C13A; Sat, 25 Apr 2020 18:49:39 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 4F61A1C139 for ; Sat, 25 Apr 2020 18:49:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587833377; 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=hA1yHq8QWRc94Ppsf8uPfwACiMUv/qTa1+J2lU2ru4M=; b=MAGzgLaU5w0HF0sqgQLI3x0BLDF2Asg03YSvw8AH1Qg2CRMD4BkDNYWdEd/t843TBv3/pC FkRGt5zXsjyfc4wkwZ7o903g6wzZy6jX734QvNB0WF2Q8R7QSVXVAFK5Fy6aoZocvIbcA9 0MK43vG8k42shnJdTh8whQS3neVL2tE= Received: from mail-ua1-f69.google.com (mail-ua1-f69.google.com [209.85.222.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-322-qzFPxLxPM86U_HRgK198DQ-1; Sat, 25 Apr 2020 12:49:35 -0400 X-MC-Unique: qzFPxLxPM86U_HRgK198DQ-1 Received: by mail-ua1-f69.google.com with SMTP id q18so7057699uap.4 for ; Sat, 25 Apr 2020 09:49:35 -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=onfueUKC2GUR5JColhPLhKUpApjz2PNYhdIkoRKNv5M=; b=Viqkt4EEcGqtOYc9PYzrFQWUGucvh6XgN60Yz5V213LzPvPEtDZL16QoWyMGhdMY1I /r1i47qOI7Xixy1PgeffEwRY0gpcbNbBmjDVM+QKJWAbUyBSCqKQDBbelTU/hXoXV5te 850XoUdxmaEsYfu6/QFryY1On8N5W1hQqX4HRUXCqiQTbxo8pkByjDurZpiQqMjX+Ub/ I1XxHGevoeCdPawX2f6910gCEno4l60om967DzJn4ymfiTjWJPZCOzxx2AbyYZT7E+WP HWQpc4XUylTaJ1PTrz1K6tPBn2Ef7n4xVnzcEe3cx/5jFiPHULkPStOafkJ8V8Gr+QbU jUsA== X-Gm-Message-State: AGi0PubqngcgI+OYyxsB4QNGfYXKAM08TR6V3QnBRA2xMTkNLYc9Hl3N 0h9z4X3brRCzEmJmKsboaugrwebgMFMluDbPoCv7Bl1mls0J/USnKcg9H6iZWgAu0m/y672CKpY Q87VPHyseH4KbZMxWRsk= X-Received: by 2002:a1f:a844:: with SMTP id r65mr11637887vke.56.1587833374821; Sat, 25 Apr 2020 09:49:34 -0700 (PDT) X-Google-Smtp-Source: APiQypLJEVkBUctcTdu4LLTSkVQoLmd/nXuwn4i42rAY5RAX0ACNJFUUHYdPvEokMl0eH0eEazEXcXuWm+IdatQwvLg= X-Received: by 2002:a1f:a844:: with SMTP id r65mr11637881vke.56.1587833374520; Sat, 25 Apr 2020 09:49:34 -0700 (PDT) MIME-Version: 1.0 References: <20200104013341.19809-1-stephen@networkplumber.org> <20200104013341.19809-6-stephen@networkplumber.org> In-Reply-To: <20200104013341.19809-6-stephen@networkplumber.org> From: David Marchand Date: Sat, 25 Apr 2020 18:49:23 +0200 Message-ID: To: Stephen Hemminger Cc: dev 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 05/14] eal: intr: cleanup resources 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: > > When rte_eal_cleanup is called the interrupt thread and > associated resources should be cleaned up. > > Signed-off-by: Stephen Hemminger > --- > lib/librte_eal/common/eal_private.h | 10 ++++++++++ > lib/librte_eal/linux/eal/eal.c | 1 + > lib/librte_eal/linux/eal/eal_interrupts.c | 9 +++++++++ > 3 files changed, 20 insertions(+) > > diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/= eal_private.h > index 38682e79827c..c62f35d3ac0f 100644 > --- a/lib/librte_eal/common/eal_private.h > +++ b/lib/librte_eal/common/eal_private.h > @@ -191,6 +191,16 @@ int rte_eal_tailqs_init(void); > */ > int rte_eal_intr_init(void); > > +/** > + * Cleanup interrupt handling. > + * > + * This function is private to EAL. > + * > + * @return > + * 0 on success, negative on error > + */ > +void rte_eal_intr_cleanup(void); > + > /** > * Init alarm mechanism. This is to allow a callback be called after > * specific time. > diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/ea= l.c > index d98a2afe85da..eb95f4f0c317 100644 > --- a/lib/librte_eal/linux/eal/eal.c > +++ b/lib/librte_eal/linux/eal/eal.c > @@ -1338,6 +1338,7 @@ rte_eal_cleanup(void) > } > > rte_service_finalize(); > + rte_eal_intr_cleanup(); > rte_eal_alarm_cleanup(); > rte_mp_channel_cleanup(); > eal_cleanup_config(&internal_config); > diff --git a/lib/librte_eal/linux/eal/eal_interrupts.c b/lib/librte_eal/l= inux/eal/eal_interrupts.c > index 14ebb108cee9..fa08ac4171bd 100644 > --- a/lib/librte_eal/linux/eal/eal_interrupts.c > +++ b/lib/librte_eal/linux/eal/eal_interrupts.c > @@ -1137,6 +1137,15 @@ rte_eal_intr_init(void) > return ret; > } > > +void > +rte_eal_intr_cleanup(void) > +{ > + pthread_cancel(intr_thread); > + pthread_join(intr_thread, NULL); > + close(intr_pipe.readfd); > + close(intr_pipe.writefd); What happens to the intr_sources callbacks? I am unsure we can expect the application to clean this before the eal clea= nup. It would be worth a followup patch. > +} > + > static void > eal_intr_proc_rxtx_intr(int fd, const struct rte_intr_handle *intr_handl= e) > { > -- > 2.20.1 > --=20 David Marchand