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 65DE642D7C; Wed, 28 Jun 2023 09:53:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 38A0E406B3; Wed, 28 Jun 2023 09:53:29 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id F02C340151; Wed, 28 Jun 2023 09:53:27 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 8726B5C0162; Wed, 28 Jun 2023 03:53:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 28 Jun 2023 03:53:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type: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=fm2; t= 1687938805; x=1688025205; bh=G2G6LeO/+h3r9WUNAvtR2zY5CBAKkPPlrlb G524kAnk=; b=wYNKQx7xsm+a9ZI6PoduA68W60gK1K67r1pMIMyheoL2gGieU/n +FZ4+2HzP0CZu4y2quYZbZIsnHhEYQyg6qjkgjSULZR7FR4qSuR4XU9yqEuZCanK QvG5CKKfGNMCwx6rK0C97p9lo/8SH6O/StfIJ4oedDLgDmXN1/kqJxLO5JEcbsON Lv1z6QWriI2g4GLWmjAcOD62AjW6GtN6dosQ1GAc3qYfFtSjwAe1lSkKusZgn1v9 gp5y7Zl/UL7Ud5AYobsNlljG5h1fkMB/fO4dfhuIjUmPqrnZEMOTr2WfTmrpl5Uc 9SEgCR46qTT8voNhPnnBdI4XzcH9sX7uZ1w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :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; t= 1687938805; x=1688025205; bh=G2G6LeO/+h3r9WUNAvtR2zY5CBAKkPPlrlb G524kAnk=; b=L7Zz4ORTJhZlmZAi17I4xTMgEFiKO/nDNE/0XMQMYFARnzBl1WI y5W1yMDsTuB5YsA30tBzesIVP6dcOIgeHfySSmIGsrVaRPIybdQfNA7xd8MC+Z7W s665j6i/RfR7iOGoNMOXB3B+8QGKvXjiKGIKPAyEx2U2o8akSZv2pHkPCS1gyn4k YrGi8T6+pVaDCzjmPOdTmmaHfDRnc73HQG6sKtDjFkjDvrSuu58H3FC8B1BxSMx3 FzVXh/JMzBnaIZ7vFdoZ8UhXJE7A+rPzNcZjxR3Gt+3kDpwWbjbifYiLPBbRwZGe B0FZr3tEglbfZGSjSzl8r4Wj6m+y4UsYqpA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrtddugdduvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdei kefgkeduhedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 28 Jun 2023 03:53:24 -0400 (EDT) From: Thomas Monjalon To: "Wu, Jingjing" , "Guo, Junfeng" Cc: "dev@dpdk.org" , "stable@dpdk.org" , "He, Xingguang" , "Laatz, Kevin" , "Richardson, Bruce" Subject: Re: [PATCH] examples/ntb: remove redundant logic for dev close Date: Wed, 28 Jun 2023 09:53:21 +0200 Message-ID: <10294010.qUNvkh4Gvn@thomas> In-Reply-To: References: <20230614051423.176572-1-junfeng.guo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 28/06/2023 04:37, Guo, Junfeng: > From: Guo, Junfeng > > From: Thomas Monjalon > > > 14/06/2023 07:14, Junfeng Guo: > > > > During EAL cleanup stage, all bus devices are cleaned up properly. > > > > Based on this, there is no need to do extra device close process, > > > > which may call the dev ops '*dev->dev_ops->dev_close' twice. > > > > > > > > If this dev ops for ntb was called twice, the interrupt handle for > > > > EAL will be disabled twice and will lead to error for the seconde > > > > time. Like this: "EAL: Error disabling MSI-X interrupts for fd xx" > > > > > > You should fix ntb to not disable interrupt twice. > > > > Thanks for the comment! > > > > Yes, it is exactly what this patch did. > > Another solution is to add extra logic in dev_close, i.e., to do the > interrupt disabling process only when the interrupt handler is valid. > That is, to disable interrupt only when 'intr_handle->max_intr' or > 'intr_handle->nb_efd' is non-zero. > > But I'm not sure if this method is a better solution. > Please help give some advice, thanks! Yes this is what I suggest. You cannot fix all applications in the world, but you can fix the driver, so it is a better way :) > > The interrupt disabling process is part of 'dev_close' ops, and will be > > called twice (one in EAL cleanup, another in ntb example cleanup). > > > > Now that fixed & covered by the EAL cleanup, there is no need to > > run dev_close at ntb example. Just remove that redundant logic.