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 E7D8FA0A0C; Wed, 14 Jul 2021 13:42:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 630B240E3C; Wed, 14 Jul 2021 13:42:51 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id 52B154069F for ; Wed, 14 Jul 2021 13:42:50 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C90C85C013A; Wed, 14 Jul 2021 07:42:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 14 Jul 2021 07:42:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= OF0lQsW60PyqnVSlBJhUhekrw3i/AyWas5FQ5ROqpw0=; b=zipWevTEsf5eDyde s2G1QLhztdY+Fbj7Ty+qrbXmt0Wn1ryPOv6SoGQjZIaceIocFyPjVB69hu2S2mNR nvppjFZx7Dbvx0aKkzOYUYc+IqBhwRtttVg74FnYRnt8e8PNvZQQrbkZaR41e5Yt P8vlNaITCtCVbEkGkDdg6twDbxymo3DZRTNtIOabMLg3Rd5brHJ2IuxuBbM3do/N xSzedEUryKz5Dcye2TsTPGDQx18omL9FJ+rBDo6rKpHLzM8S6lsQfhkqWa0y5Yft fInqyi9fl+NNzWZXmim/NTygg47IzRqTDyNhBKturAR7+Sr+9Nafm4Ub8XXPMHOo 67TImA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=OF0lQsW60PyqnVSlBJhUhekrw3i/AyWas5FQ5ROqp w0=; b=aTDe+6TSr//oX1nsUJQjoNCz/tP0psjcn2r7pCCwoVbQlIfiIbVBnurXi Sa8ien7s9O81gXBNENLKpN9uTEAmrry87GAcDikagPyNQj38KiuhGYX8qlBuohpr NvgNvPUtz84XrlRkGUK8qcwgVnWT+zK4B6v/BXPL16g25euydE1G8vlwqeU5Pj8S TqB9D1dogTJutZdn0DahMIPaXbjhMHL3WL86shJpFdj18DCUyGTPsqjv4PyPLFpU kLW8JLUdUfns3fmsprhmjxE6dCgVLRKayWm8U19lczniBvjqmV3q9ioQjd3iENkL XP0dOZbfxrBkC3MfQQHJovLG9hLtQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekgdegvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Jul 2021 07:42:48 -0400 (EDT) From: Thomas Monjalon To: Matan Azrad Cc: "dev@dpdk.org" , Ferruh Yigit , Andrew Rybchenko Date: Wed, 14 Jul 2021 13:42:53 +0200 Message-ID: <2065780.Orf5z9Lfyc@thomas> In-Reply-To: References: <20210713131714.964500-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] ethdev: avoid unregistering a non-allocated callback 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" 13/07/2021 15:42, Matan Azrad: > Hi Thomas > > From: Thomas Monjalon > > When registering a new event callback, if allocation fails, there is no need for > > unregistering the callback, because it is not registered. > > > > Fixes: 9ec0b3869d8d ("ethdev: allow event registration for all ports") > > Cc: stable@dpdk.org > > > > Signed-off-by: Thomas Monjalon > > --- > > lib/ethdev/rte_ethdev.c | 2 -- > > 1 file changed, 2 deletions(-) > > > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index > > 9d95cd11e1..1731854628 100644 > > --- a/lib/ethdev/rte_ethdev.c > > +++ b/lib/ethdev/rte_ethdev.c > > @@ -4649,8 +4649,6 @@ rte_eth_dev_callback_register(uint16_t port_id, > > user_cb, next); > > } else { > > rte_spinlock_unlock(ð_dev_cb_lock); > > - rte_eth_dev_callback_unregister(port_id, event, > > - cb_fn, cb_arg); > > Please pay attention to the case of port_id=RTE_ETH_ALL where the user wants to register the event for all the ports. > > In this case, when a failure happens for one of the ports, this unregister call cleans the callback from all the ports. Yes I missed it. Now I better understand the intent, thanks. Next question: do we really want to rollback already registered ports? Anyway, if we are out of memory, I think it is better not doing more operations. There can be various opinions on this topic, please give yours.