From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v8] eal_interrupts: add option for pending callback unregister Date: Sat, 09 Mar 2019 01:40:35 +0100 Message-ID: <2246346.ABkemhhLro@xps> References: <20181217123009.23501-1-jgrajcia@cisco.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Jakub Grajciar Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 01215F94 for ; Sat, 9 Mar 2019 01:40:38 +0100 (CET) In-Reply-To: <20181217123009.23501-1-jgrajcia@cisco.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Sorry for the delay in review. I hoped someone else would review this patch. Let's get this patch in DPDK 19.05, after doing some small changes (see below). 17/12/2018 13:30, Jakub Grajciar: > use case: if callback is used to receive message form socket, > and the message received is disconnect/error, this callback needs > to be unregistered, but cannot because it is still active. > > With this patch it is possible to mark the callback to be > unregistered once the interrupt process is done with this > interrupt source. > > Signed-off-by: Jakub Grajciar > --- > .../common/include/rte_interrupts.h | 32 +++++++ > lib/librte_eal/linuxapp/eal/eal_interrupts.c | 85 ++++++++++++++++++- > lib/librte_eal/rte_eal_version.map | 1 + > 3 files changed, 116 insertions(+), 2 deletions(-) We are missing the BSD implementation. Please add at least a function returning -ENOTSUP. > +/** > + * It unregisters the callback according to the specified interrupt handle, > + * after it's no longer acive. Failes if source is not active. Suggested reword: Unregister the callback according to the specified interrupt handle, after it's no longer active. Fail if source is not active. > + * > + * @param intr_handle > + * pointer to the interrupt handle. > + * @param cb The parameter is cb_fn. Please check doxygen with "make doc-api-html" > + * callback address. > + * @param cb_arg > + * address of parameter for callback, (void *)-1 means to remove all > + * registered which has the same callback address. > + * @param ucb_fn > + * callback to call before cb is unregistered (optional). > + * can be used to close fd and free cb_arg. > + * > + * @return > + * - On success, return the number of callback entities marked for remove. > + * - On failure, a negative value. > + */ > +int __rte_experimental > +rte_intr_callback_unregister_pending(const struct rte_intr_handle *intr_handle, > + rte_intr_callback_fn cb_fn, void *cb_arg, > + rte_intr_unregister_callback_fn ucb_fn);