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 4A3B6A0C41; Tue, 19 Oct 2021 23:39:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19D17410F1; Tue, 19 Oct 2021 23:39:48 +0200 (CEST) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by mails.dpdk.org (Postfix) with ESMTP id 60B7640142 for ; Tue, 19 Oct 2021 23:39:46 +0200 (CEST) Received: by mail-lf1-f49.google.com with SMTP id y15so10495751lfk.7 for ; Tue, 19 Oct 2021 14:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NneL9tgrW7gVd4P4rH+9DSpGCxxwRmKyIT3K7jMr++8=; b=PzLhC3HOK3+nyiPBvDVhlrr0rlZKSOASzt0b19gma9lQLPGPq/7aPoZVkC/Y78AwVB B+3HgE06eLEMbbTwwvBYfM59dUhFqcZYRLMBB6RqV6ty9RhHdQEfRgAk4GFF8vYSOuBQ SqjZrD8fPHVoHSP8GekjFelVWS3CLTHGHE4kQVq6EkrOCs6ijVn4q9Lywc+nz9isajkO nnk3/TTAldcgm/5sMsw7ZRL5PaJEhADAKIGfDD/EL/AKWPA3QKThBdbWoF5ImGkiHMA2 Q667Ium8kCqPFNqNpgL+T3eQ99lsg7Y9e7zg5z3h+AR09e/TzJ7pKZZqNAFo09PcPp7h xxow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NneL9tgrW7gVd4P4rH+9DSpGCxxwRmKyIT3K7jMr++8=; b=CuYVqTfTOpwwDhT3vCqnwYQtvfjSsAYpnO7x2O60uWlSnzITpu6UUCXSGuZzsGrcOe Oe/TrIupDR73XxFh36IrHzetxL+2Tx9G1S8m8NPBR0Z5Je0hUox23rBMngjFJwhg/V8T 6idmdYdfrSx2MSfsFqQbDCm0MyjCb+tawPUUvZXLBB3zbjlp0YYoOX184a2xy/UwPCdG GXDv83xOJgw2Lju0/pcHS4tYFuBOXSkhdJqhFKNd1pRzBt1VR6caX/SJXazOFQphHVKE yL81aqup1w7M4lFieKbGqGk5+2SJfka2yjxyRaHas03zeB28NQdRuteYPOWIS3XnO8Y1 03yQ== X-Gm-Message-State: AOAM5317xIxZiMPOK+fIkPzWX97KPrJ5DDsnT4whu3qFRTHdjcaI9BeW +l17qV6DfAuy8uW/OfIy5sg= X-Google-Smtp-Source: ABdhPJzoeZzmu85OLomirL9EEWZi9ch6RvJjpxZbCNBzQB4XJJzwS/bDta/GwrHG6yk3kP9uCFeSmQ== X-Received: by 2002:a05:6512:3ba3:: with SMTP id g35mr8229665lfv.651.1634679585910; Tue, 19 Oct 2021 14:39:45 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id y16sm21042ljn.74.2021.10.19.14.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Oct 2021 14:39:45 -0700 (PDT) Date: Wed, 20 Oct 2021 00:39:44 +0300 From: Dmitry Kozlyuk To: Harman Kalra Cc: , Bruce Richardson , , , Message-ID: <20211020003944.37030e3c@sovereign> In-Reply-To: <20211019183543.132084-8-hkalra@marvell.com> References: <20210826145726.102081-1-hkalra@marvell.com> <20211019183543.132084-1-hkalra@marvell.com> <20211019183543.132084-8-hkalra@marvell.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 7/7] eal/alarm: introduce alarm fini routine 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 Sender: "dev" 2021-10-20 00:05 (UTC+0530), Harman Kalra: > Implementing alarm cleanup routine, where the memory allocated > for interrupt instance can be freed. > > Signed-off-by: Harman Kalra > --- > lib/eal/common/eal_private.h | 11 +++++++++++ > lib/eal/freebsd/eal.c | 1 + > lib/eal/freebsd/eal_alarm.c | 7 +++++++ > lib/eal/linux/eal.c | 1 + > lib/eal/linux/eal_alarm.c | 10 +++++++++- > 5 files changed, 29 insertions(+), 1 deletion(-) > > diff --git a/lib/eal/common/eal_private.h b/lib/eal/common/eal_private.h > index 86dab1f057..7fb9bc1324 100644 > --- a/lib/eal/common/eal_private.h > +++ b/lib/eal/common/eal_private.h > @@ -163,6 +163,17 @@ int rte_eal_intr_init(void); > */ > int rte_eal_alarm_init(void); > > +/** > + * Init alarm mechanism. This is to allow a callback be called after > + * specific time. > + * > + * This function is private to EAL. > + * > + * @return > + * 0 on success, negative on error > + */ The comment does not match the function. > +void rte_eal_alarm_fini(void); > + > /** > * Function is to check if the kernel module(like, vfio, vfio_iommu_type1, > * etc.) loaded. [...] > diff --git a/lib/eal/freebsd/eal_alarm.c b/lib/eal/freebsd/eal_alarm.c > index cd971036cd..167384e79a 100644 > --- a/lib/eal/freebsd/eal_alarm.c > +++ b/lib/eal/freebsd/eal_alarm.c > @@ -46,6 +46,13 @@ static rte_spinlock_t alarm_list_lk = RTE_SPINLOCK_INITIALIZER; > static struct rte_intr_handle *intr_handle; > static void eal_alarm_callback(void *arg); > > +void > +rte_eal_alarm_fini(void) > +{ > + if (intr_handle) intr_handle != NULL > + rte_intr_instance_free(intr_handle); > +} > + > int > rte_eal_alarm_init(void) > { [...] > diff --git a/lib/eal/linux/eal_alarm.c b/lib/eal/linux/eal_alarm.c > index cf8e2f2066..56f69d8e6d 100644 > --- a/lib/eal/linux/eal_alarm.c > +++ b/lib/eal/linux/eal_alarm.c > @@ -58,6 +58,13 @@ static struct rte_intr_handle *intr_handle; > static int handler_registered = 0; > static void eal_alarm_callback(void *arg); > > +void > +rte_eal_alarm_fini(void) > +{ > + if (intr_handle) Ditto. > + rte_intr_instance_free(intr_handle); > +} > + > int > rte_eal_alarm_init(void) > { > @@ -68,7 +75,8 @@ rte_eal_alarm_init(void) > goto error; > } > > - rte_intr_type_set(intr_handle, RTE_INTR_HANDLE_ALARM); > + if (rte_intr_type_set(intr_handle, RTE_INTR_HANDLE_ALARM)) > + goto error; > > /* create a timerfd file descriptor */ > if (rte_intr_fd_set(intr_handle, This belongs to a patch 5/7, doesn't it?