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 16AD5A0C43; Wed, 14 Jul 2021 16:42:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EB4AC40E3C; Wed, 14 Jul 2021 16:42:26 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id 1F3CC4069F for ; Wed, 14 Jul 2021 16:42:25 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 8880C5C00F8; Wed, 14 Jul 2021 10:42:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 14 Jul 2021 10:42:24 -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= gSlxovDM3XzXs/bwxId17Uc0tUMJcy0pBBHvgAvvqeQ=; b=Y9m4b7eo0td+aj6d IAVpwRFM5VGQdnemfWqOvVmBYJLEqUxgzRXh5QFmHCKogJ89mhIpAt6ZaV0+EfLu 9iZMGeY837tAsMM6eVsKjrZ3iN113m8iTkcf3dye7sESoT/ud0zeyc5whub2K9Lo CD8OoyM/uEhVgVycXfn5PY6gN71WgXI5rizNWKOFWX2obchZOfXJnBPT2nm32zrY p1sSm9zqU2SQY6xuIAHTjBUZRBr66sXkLw4+QgZ7yJaOY+H9AxOm8fDLGSPv9tpt DEPOAbRp4d6d4ltP9HFoZzCwuyKR4YNqtHkCtjw+5y4NClqSrC5Ab9Hf3kpSMN0Z 0zmouw== 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=gSlxovDM3XzXs/bwxId17Uc0tUMJcy0pBBHvgAvvq eQ=; b=rNgVYTAY38quLf8qgrDXlX+tp6sx3+bHMIVTm9183ymSrOOONmkSVXGED H5W9ipira8uVqEVYDaMBXM2fHJGUI6u602QZ/vIrzTs8WnmsAD5Fj2d7gDMIBWb8 paX7Zw/n4DHW5Uu4orfplqrss4jCL7sD3DnmbexZh8Bvn3wUS0aGPuRa1uzrx+1T j2TX6MVLZBFjp3KEtC6cd9L1DA1TxIWF5xsfOnxw4C3M+r9iNmME07TXH9cRE97U Fmpys5Imv4+FOyi+f9ujemQq+LVqhAFrZGdrS8Dp4rfLBhoEhTIcpW/8Xay4zZPU 9hoI7jrEMcSrHJxiIE3GmClSjV21Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekgdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Jul 2021 10:42:23 -0400 (EDT) From: Thomas Monjalon To: Matan Azrad Cc: "dev@dpdk.org" , Ferruh Yigit , Andrew Rybchenko Date: Wed, 14 Jul 2021 16:42:27 +0200 Message-ID: <4457539.Pa9PMCDbyH@thomas> In-Reply-To: References: <20210713131714.964500-1-thomas@monjalon.net> <2065780.Orf5z9Lfyc@thomas> 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" 14/07/2021 16:16, Matan Azrad: > From: Thomas Monjalon > > 13/07/2021 15:42, Matan Azrad: > > > 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 > > > > --- > > > > --- a/lib/ethdev/rte_ethdev.c > > > > +++ b/lib/ethdev/rte_ethdev.c > > > > @@ -4649,8 +4649,6 @@ rte_eth_dev_callback_register(uint16_t > > > > } 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. > > Sure, > I understand that memory error is serious, > Do you think it is a fatal error? If so, maybe we should use rte_exit? We don't call rte_exit in the lib, so the app can do whatever it wants. > That way or others, I think the behavior should be a convention for all the file functions(at least). What do you mean "all the file functions"? > I tend to do cleanup on any error. I would like to hear opinions from others as well.