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 A803BA00BE for ; Mon, 7 Mar 2022 18:07:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F85C41223; Mon, 7 Mar 2022 18:07:07 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 4309F4014E; Mon, 7 Mar 2022 18:07:05 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E589F5C03AB; Mon, 7 Mar 2022 12:07:04 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 07 Mar 2022 12:07:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; bh=zGA6gIDyuEtohD UE/tBTmD5qkfH6DvFH07xdxzbZEH0=; b=nl+hiumQebxYMUaGDBpUnDvivTxb/1 Azh9MXVCHPAxfAKV1Itxn4xTdqMW6yHBCcX3LDbWxVKR3Sw3VrQxyVD7elupB1MH BSMFMJctX9pxJyGNRhhI0FJy2httRfm+tqhlw6xMJkpiAG1Souw0zTdhsEDOUw+T hWRoVUiShfSUi0vROH1d8MIxyKAZfJ38zseKIMr5PrYjIHEX4b/DLINTWd8UuMX0 b5xEtIA7h3HQ2z1f7K5Tk3GBmBSDM6CTiqQ2YWINJS879SAN+KY4XuNsEDbuXKNY XjrcF/loq00iJGxkaGEJEqR3zoD9ckdebkr70B1Hzr838VsYSTLAaVSQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=zGA6gIDyuEtohDUE/tBTmD5qkfH6DvFH07xdxzbZE H0=; b=E+TiYL3GtKO9LnYY/Dnws9ZoFO6hr0SN9XODc+7cCkhWxRQhZcq/eLS6g aY0pzbyMkgulAe70TjYHl7jOSE1Owna7eDVjT2ey5ynPJd17dVxlOFUiK2f5587+ IjYqDRICODNGqZsFpC/9/P0pdWlUFQosoyb8aReOvzyHpza25XNGKYczr7qjD63q LwQxjUzqD0kBJ5o0D7CrLOnsAK4sLZrvOp+cXYlVwvMjWTJEgEoej/SkOGITMUq5 fdHxSiAw3LaR//CiSeXO0TXTp4yu21VeBUYVtm0Qy360KGY1ZDSaMTP7WlEEpSOg v5syr4YiQ4CVivMz5vFew0YyyRh9Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddugedgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Mar 2022 12:07:04 -0500 (EST) From: Thomas Monjalon To: "Wu, Jingjing" , "Guo, Junfeng" Cc: dev@dpdk.org, "stable@dpdk.org" Subject: Re: [PATCH] raw/ntb: add check for DB intr handler registering Date: Mon, 07 Mar 2022 18:07:03 +0100 Message-ID: <7235133.6fTUFtlzNn@thomas> In-Reply-To: References: <20220210062841.646294-1-junfeng.guo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 10/02/2022 11:43, Guo, Junfeng: > > > -----Original Message----- > > From: Guo, Junfeng > > Sent: Thursday, February 10, 2022 15:18 > > To: Wu, Jingjing > > Cc: dev@dpdk.org; stable@dpdk.org > > Subject: RE: [PATCH] raw/ntb: add check for DB intr handler registering > > > > > > > > > -----Original Message----- > > > From: Wu, Jingjing > > > Sent: Thursday, February 10, 2022 15:05 > > > To: Guo, Junfeng > > > Cc: dev@dpdk.org; stable@dpdk.org > > > Subject: RE: [PATCH] raw/ntb: add check for DB intr handler registering > > > > > > > > > > > > > -----Original Message----- > > > > From: Guo, Junfeng > > > > Sent: Thursday, February 10, 2022 2:29 PM > > > > To: Wu, Jingjing > > > > Cc: dev@dpdk.org; stable@dpdk.org; Guo, Junfeng > > > > > > > Subject: [PATCH] raw/ntb: add check for DB intr handler registering > > > > > > > > The callback registering of doorbell interrupt handler should be > > > > finished before enabling the interrupt event fd. Thus add the return > > > > value check for this callback registering. > > > > > > > > Fixes: 62012a76811e ("raw/ntb: add handshake process") > > > > Cc: stable@dpdk.org > > > > > > > > Signed-off-by: Junfeng Guo > > > > --- > > > > drivers/raw/ntb/ntb.c | 8 ++++++-- > > > > 1 file changed, 6 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c > > > > index cc611dfbb9..0801e6d1ae 100644 > > > > --- a/drivers/raw/ntb/ntb.c > > > > +++ b/drivers/raw/ntb/ntb.c > > > > @@ -1403,8 +1403,12 @@ ntb_init_hw(struct rte_rawdev *dev, > > struct > > > rte_pci_device > > > > *pci_dev) > > > > > > > > intr_handle = pci_dev->intr_handle; > > > > /* Register callback func to eal lib */ > > > > - rte_intr_callback_register(intr_handle, > > > > - ntb_dev_intr_handler, dev); > > > > + ret = rte_intr_callback_register(intr_handle, > > > > + ntb_dev_intr_handler, dev); > > > > + if (ret) { > > > > + NTB_LOG(ERR, "Unable to register doorbell intr > > > handler."); > > > > + return ret; > > > > + } > > > When will this register failure happen? Have you checked what is the > > root > > > cause? > > > > When bind with vfio-pci, the DB interrupt callback function often cannot > > work as expected. > > I think this is due to that, the intr callback registering not finished before > > event fd enabled. > > Add the check of the return value here can make sure about correct > > processing sequence. > > I think some compiler optimization would lead to this condition. > So add return value check can prevent this (i.e., registering not finished). There is no formal ack. What is the status of this patch?