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 44B0E432BB; Mon, 6 Nov 2023 18:05:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 38DA740DD8; Mon, 6 Nov 2023 18:05:37 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 6EEBE40E01; Mon, 6 Nov 2023 18:05:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699290335; x=1730826335; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cga2VCUwyfs1uu3uCbZxe2s5ay4rREOmZHOZ8qao2NE=; b=OnOK0pB7P458asN5uoXq3HemLjb36q5p82NGxDU3HTS3eGUd4LknxL7P ILU8swajHw91xwk0dtamARl7kPEdoe6Wj96iNP7avwUEZ55dhon1eOdyR RwWxa/vdX9exMQ+cjZcvRShiHyGaIfgd1tibYtaWFeGqm9E+8rhYUcZd9 sr4hESRQSXNVg7e4EaOkpCNOE6IFq6eeSsviX96gq9Mu/wu6DdCrFbf8b rhLsCUnldibMc1rv0jLy+r6mtMknySfBMHqK9V6IhU1mkaWx6X84Ov/23 KKW0l6R2HAnVikYFmgrQ++194/evAH9QuT2VTsoswdj/cbwejQwTX61jG Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="475553798" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="475553798" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 09:05:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="10512056" Received: from txanpdk02.an.intel.com ([10.123.117.76]) by fmviesa001.fm.intel.com with ESMTP; 06 Nov 2023 09:05:32 -0800 From: Abdullah Sevincer To: dev@dpdk.org Cc: jerinj@marvell.com, mike.ximing.chen@intel.com, bruce.richardson@intel.com, thomas@monjalon.net, Abdullah Sevincer , stable@dpdk.org Subject: [PATCH v7 2/2] event/dlb2: fix disable PASID Date: Mon, 6 Nov 2023 11:05:21 -0600 Message-Id: <20231106170521.3064038-3-abdullah.sevincer@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231106170521.3064038-1-abdullah.sevincer@intel.com> References: <20231106170521.3064038-1-abdullah.sevincer@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 In vfio-pci driver when PASID is enabled by default DLB hardware puts DLB in SIOV mode. This breaks DLB PF-PMD mode. For DLB PF-PMD mode to function properly PASID needs to be disabled. In this commit this issue is addressed and PASID is disabled by writing a zero to PASID control register. Fixes: 5433956d5185 ("event/dlb2: add eventdev probe") Cc: stable@dpdk.org Signed-off-by: Abdullah Sevincer --- drivers/event/dlb2/pf/dlb2_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/event/dlb2/pf/dlb2_main.c b/drivers/event/dlb2/pf/dlb2_main.c index aa03e4c311..61a7b39eef 100644 --- a/drivers/event/dlb2/pf/dlb2_main.c +++ b/drivers/event/dlb2/pf/dlb2_main.c @@ -26,6 +26,7 @@ #define PF_ID_ZERO 0 /* PF ONLY! */ #define NO_OWNER_VF 0 /* PF ONLY! */ #define NOT_VF_REQ false /* PF ONLY! */ +#define DLB2_PCI_PASID_CAP_OFFSET 0x148 /* PASID capability offset */ static int dlb2_pf_init_driver_state(struct dlb2_dev *dlb2_dev) @@ -514,6 +515,16 @@ dlb2_pf_reset(struct dlb2_dev *dlb2_dev) } } + /* Disable PASID if it is enabled by default, which + * breaks the DLB if enabled. + */ + off = DLB2_PCI_PASID_CAP_OFFSET + RTE_PCI_PASID_CTRL; + if (rte_pci_pasid_set_state(pdev, off, false)) { + DLB2_LOG_ERR("[%s()] failed to write the pcie config space at offset %d\n", + __func__, (int)off); + return -1; + } + return 0; } -- 2.25.1