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 3209CA034E; Wed, 9 Feb 2022 05:39:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B4D8C410FD; Wed, 9 Feb 2022 05:39:32 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 94CDE410F3; Wed, 9 Feb 2022 05:39:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644381570; x=1675917570; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3CTKObUNl6e5F6v1txyEggddb6yeaFVZIHiddkJh1po=; b=Aza9VeB0d2iozVd7SZVLgCwH2adbhUNe6M1YW87bTvFwgJIY2OC160yL aXMpF/7fEGJBaJRmtbbuOenA2q5T9Vx1ftkBs0HI7n9RAngtSrsdMBxmc Bnj6fSzYtBHWwNzdKgibht9SksU1SRcv6M+ozd60TJSOBkLVAUi6+yyLh GyLLas/fe79z/ttmEonHbzIqfIPgjHWPMgWNbe312vCfkIOSwXiRvSTaG VMOPco0aOz/cGCGwa1y2deZALcC+hxFFg+NZeA8p/tWjrzeZ+bvLNWSRb +Vij7m68fi1XKuBDOG0CKhUoj2ozv6o/9EVtjhFcGpe3PVSnWBPjmG7cN w==; X-IronPort-AV: E=McAfee;i="6200,9189,10252"; a="246702253" X-IronPort-AV: E=Sophos;i="5.88,354,1635231600"; d="scan'208";a="246702253" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2022 20:39:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,354,1635231600"; d="scan'208";a="585435543" Received: from dpdk-jf-ntb-v1.sh.intel.com ([10.67.119.116]) by fmsmga008.fm.intel.com with ESMTP; 08 Feb 2022 20:39:28 -0800 From: Junfeng Guo To: jingjing.wu@intel.com Cc: dev@dpdk.org, stable@dpdk.org, junfeng.guo@intel.com Subject: [PATCH v2] raw/ntb: clear all valid DB bits when DB init Date: Wed, 9 Feb 2022 12:39:03 +0800 Message-Id: <20220209043903.3699229-1-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220209043528.3694747-1-junfeng.guo@intel.com> References: <20220209043528.3694747-1-junfeng.guo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Before registering the doorbell interrupt handler callback function, all the valid doorbell bits within the NTB private data struct should be cleared to avoid the confusion of the handshake timing sequence diagram when setting up the NTB connection in back-to-back mode. Fixes: 62012a76811e ("raw/ntb: add handshake process") Cc: stable@dpdk.org Signed-off-by: Junfeng Guo --- drivers/raw/ntb/ntb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c index 46ac02e5ab..6f15b13585 100644 --- a/drivers/raw/ntb/ntb.c +++ b/drivers/raw/ntb/ntb.c @@ -1398,6 +1398,8 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev) /* Init doorbell. */ hw->db_valid_mask = RTE_LEN2MASK(hw->db_cnt, uint64_t); + /* Clear all valid doorbell bits before registering intr handler*/ + (*hw->ntb_ops->db_clear)(dev, hw->db_valid_mask); intr_handle = pci_dev->intr_handle; /* Register callback func to eal lib */ -- 2.25.1