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 3DFF7433D8 for ; Mon, 11 Dec 2023 11:23:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3875940E0F; Mon, 11 Dec 2023 11:23:49 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2041.outbound.protection.outlook.com [40.107.220.41]) by mails.dpdk.org (Postfix) with ESMTP id 4C72340F35 for ; Mon, 11 Dec 2023 11:23:47 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JJaz9A1D1Mv5ApIsiXuAN0eMfD6XT+21JuYquLitxr/ffsrxnANgJyKPs+1j22FoM+LqpWTr5mkiyAim2rWecdQdVR3XXtLypSp2mBH3XkiA0IGM+bxLcdFpZarUEhGUjfiy0Nvd4Oa/jF+bBTnjARh9dJbAzus1YZwV1/EKP7B2e12NFEJ+ACk5mhfplFy0pua0S9HdVr1JTnJZA3OUu+C9ubccqKnCLK+rGScO7R4aLpILz2rymwTSXYXUICdaLmDTlla2/Ds2DPXxIkYoLyGWulotmsM5VfsgTNeQIyMxdrhHfmaxJEZWMT5tMEoFm1RI+zmCwHqLZEMQ8joU6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ewnfFtfDOgVHurFopnZjHYBNe9lRoWcBcPQS9pOuG8E=; b=FPpvFS4a0q2vyFhPzdYqB5N1I0dGmWfmjNL5YZw4lTyJVu7iyFqspXoCazakqPkhBWThhWpIVu3jDWgkSuwxyiMHaPcU/1yuUv5FzwxgLbciYU7MidTRybJzbbWl0qBRwhQpU6rJcz1riXXP9PZtotZFDs7FwP6VhmmL1eN/4q5SQBb9cN2m0+de6E5EoR/j7X0Q4UTnRBnKu6r7Pemisy0RwDjMtMjn859cbadtMciajd4MnoCGgGH29wa/r7fBcuRSGbSq5SSOyxm9kfNfL7QVvPoTe67G7Y1I15+J/gk6Em+hX4fqPJYIhuEMu3ezFc6PoMh9dkZgXNwhMLK/AQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ewnfFtfDOgVHurFopnZjHYBNe9lRoWcBcPQS9pOuG8E=; b=CNZFxinKDtKmew3z+CIeeMsUnQSTJecaR8oOTdKB1dNMVurMGf1Agp82jlyAijM5Q6PTsBinWhLD5/if1CqEp0SIDtZ4HqGDWGFTtILMQX2WPu2juVT84GW4O0Uykg/mMNfMLs+jLM971qo3H+GR2vUhfD5D+MzPrFLEO93qgtjGUSXddG+RaaROUjM5epGLzxSbwsY3gVGUplTsAyQYPWRiXrqpQWTunc8jbmW1HrLqcMLSe0Z7F2Ce6qe5mjdLJ+ttlBr0fj+q4aM/CTtr8qM44KuTC6xGRsEpmUN+fvInu6TzFB3ErGDTG4Fw+BbyqU7X/LbR43hUKsM5+WJP5g== Received: from PH8PR05CA0006.namprd05.prod.outlook.com (2603:10b6:510:2cc::6) by SA1PR12MB7104.namprd12.prod.outlook.com (2603:10b6:806:29e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 10:23:43 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:510:2cc:cafe::45) by PH8PR05CA0006.outlook.office365.com (2603:10b6:510:2cc::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.21 via Frontend Transport; Mon, 11 Dec 2023 10:23:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 10:23:42 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 11 Dec 2023 02:23:29 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 11 Dec 2023 02:23:28 -0800 From: Xueming Li To: Abdullah Sevincer CC: dpdk stable Subject: patch 'event/dlb2: fix disable PASID' has been queued to stable release 22.11.4 Date: Mon, 11 Dec 2023 18:12:26 +0800 Message-ID: <20231211101226.2122-122-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231211101226.2122-1-xuemingl@nvidia.com> References: <20231022142250.10324-1-xuemingl@nvidia.com> <20231211101226.2122-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A1:EE_|SA1PR12MB7104:EE_ X-MS-Office365-Filtering-Correlation-Id: 52fde420-c51f-4949-b917-08dbfa334028 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G2S5NYzdEOx3Rqji/qUHBFOYij/6AaTFBJLIj5/i+/lb05NTVh+rCNoY9D8Q7At9ThFtdFPYxa9ZvmAgfkH0brBruHkTnUFvLatip3SqUHy1gnyRzWq7ZFrJSdWjYrJFcV1TYtRbBcRil2woDKtSgtcpr6PCVrYWrINQNJ3+4NObWGEUW+Swnctm2Mf55EOsLOmRdBTRxrzulUfjNdin7pE87mW3aEboG6xLEARZFXIGFVIxiOtfJHDNDgys2y5n+QUqFT3CMXncEf3ZNDPOu6ev7Ze6hquiampoXuP99dqCUfYhHDmVFGvSgFt8J334X4OVAtShXroExBPIfArsE+4LGQWA/1500rR+MM5HX5R/FptPZCccHRBwRL5nzzYKEluAFXyXaROo4fDO4ASkm7IgnqSv7+6l3bgynyI41TSmCeWVzBQSDXqNYr28n4oWa8/lLJBAZTLPZEHkNJ3ZsRRxjFI9igrSIRnttRoblGyfCnyFPZqq6oE5JBzbwkeDznaOOCrD2W83v/A13vfFXK6lULtmMuzNV9kIuyGM5Jc4VrOqUjMwtpNWB4hNMCksGlokQ3a7O1wN2vAz56Masr0Wt3jqBDGdYNnvlo0CFubXQnDZWensWkjNg1ta6q3++phchrPXYen9/UZP5gt35k/f8Q32xJMHDsppdnEUvUF9Smn/InxFhYRnXVQevvS2P3Fu2EtD7qRHKSG9kXDCIWaczcvNxVRfbfWKRHuyv6W1PJq6tFlebkWL1rXp8c0ZEXOiCw90POg+NYDQhhvlLRYzw0d5FsaKLnGNv+Rrdnc= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(396003)(346002)(376002)(39860400002)(136003)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(82310400011)(46966006)(40470700004)(36840700001)(55016003)(40480700001)(6286002)(1076003)(26005)(426003)(336012)(16526019)(2616005)(40460700003)(82740400003)(36756003)(7636003)(86362001)(356005)(47076005)(83380400001)(5660300002)(53546011)(7696005)(36860700001)(316002)(70586007)(70206006)(966005)(8936002)(8676002)(6916009)(41300700001)(4001150100001)(4326008)(2906002)(478600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 10:23:42.8337 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52fde420-c51f-4949-b917-08dbfa334028 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7104 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 Hi, FYI, your patch has been queued to stable release 22.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/13/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=6c688dec84856bd68682f8f6b082b11868906132 Thanks. Xueming Li --- >From 6c688dec84856bd68682f8f6b082b11868906132 Mon Sep 17 00:00:00 2001 From: Abdullah Sevincer Date: Thu, 9 Nov 2023 13:45:44 -0600 Subject: [PATCH] event/dlb2: fix disable PASID Cc: Xueming Li [ upstream commit 5a6878335b8179337ec2d9931debf1f46525e8fc ] 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") Signed-off-by: Abdullah Sevincer --- drivers/event/dlb2/pf/dlb2_main.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/event/dlb2/pf/dlb2_main.c b/drivers/event/dlb2/pf/dlb2_main.c index 64a59f7616..12b65c3b98 100644 --- a/drivers/event/dlb2/pf/dlb2_main.c +++ b/drivers/event/dlb2/pf/dlb2_main.c @@ -47,6 +47,7 @@ #define DLB2_PCI_CAP_ID_MSIX 0x11 #define DLB2_PCI_EXT_CAP_ID_PRI 0x13 #define DLB2_PCI_EXT_CAP_ID_ACS 0xD +#define DLB2_PCI_EXT_CAP_ID_PASID 0x1B /* Process Address Space ID */ #define DLB2_PCI_PRI_CTRL_ENABLE 0x1 #define DLB2_PCI_PRI_ALLOC_REQ 0xC @@ -65,6 +66,8 @@ #define DLB2_PCI_ACS_CR 0x8 #define DLB2_PCI_ACS_UF 0x10 #define DLB2_PCI_ACS_EC 0x20 +#define DLB2_PCI_PASID_CTRL 0x06 /* PASID control register */ +#define DLB2_PCI_PASID_CAP_OFFSET 0x148 /* PASID capability offset */ static int dlb2_pci_find_capability(struct rte_pci_device *pdev, uint32_t id) { @@ -258,12 +261,14 @@ dlb2_pf_reset(struct dlb2_dev *dlb2_dev) uint16_t rt_ctl_word; uint32_t pri_reqs_dword; uint16_t pri_ctrl_word; + uint16_t pasid_ctrl; int pcie_cap_offset; int pri_cap_offset; int msix_cap_offset; int err_cap_offset; int acs_cap_offset; + int pasid_cap_offset; int wait_count; uint16_t devsta_busy_word; @@ -583,6 +588,28 @@ dlb2_pf_reset(struct dlb2_dev *dlb2_dev) } } + /* The current Linux kernel vfio driver does not expose PASID capability to + * users. It also enables PASID by default, which breaks DLB PF PMD. We have + * to use the hardcoded offset for now to disable PASID. + */ + pasid_cap_offset = DLB2_PCI_PASID_CAP_OFFSET; + + off = pasid_cap_offset + DLB2_PCI_PASID_CTRL; + if (rte_pci_read_config(pdev, &pasid_ctrl, 2, off) != 2) + pasid_ctrl = 0; + + if (pasid_ctrl) { + DLB2_INFO(dlb2_dev, "DLB2 disabling pasid...\n"); + + pasid_ctrl = 0; + ret = rte_pci_write_config(pdev, &pasid_ctrl, 2, off); + if (ret != 2) { + DLB2_LOG_ERR("[%s()] failed to write the pcie config space at offset %d\n", + __func__, (int)off); + return ret; + } + } + /* Disable PASID if it is enabled by default, which * breaks the DLB if enabled. */ -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-12-11 17:56:26.949730200 +0800 +++ 0121-event-dlb2-fix-disable-PASID.patch 2023-12-11 17:56:23.247652300 +0800 @@ -1 +1 @@ -From 5a6878335b8179337ec2d9931debf1f46525e8fc Mon Sep 17 00:00:00 2001 +From 6c688dec84856bd68682f8f6b082b11868906132 Mon Sep 17 00:00:00 2001 @@ -3,2 +3,5 @@ -Date: Mon, 6 Nov 2023 11:05:21 -0600 -Subject: [PATCH] event/dlb2: disable PASID +Date: Thu, 9 Nov 2023 13:45:44 -0600 +Subject: [PATCH] event/dlb2: fix disable PASID +Cc: Xueming Li + +[ upstream commit 5a6878335b8179337ec2d9931debf1f46525e8fc ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -18,2 +20,2 @@ - drivers/event/dlb2/pf/dlb2_main.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) + drivers/event/dlb2/pf/dlb2_main.c | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) @@ -22 +24 @@ -index aa03e4c311..61a7b39eef 100644 +index 64a59f7616..12b65c3b98 100644 @@ -25,4 +27,13 @@ -@@ -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! */ +@@ -47,6 +47,7 @@ + #define DLB2_PCI_CAP_ID_MSIX 0x11 + #define DLB2_PCI_EXT_CAP_ID_PRI 0x13 + #define DLB2_PCI_EXT_CAP_ID_ACS 0xD ++#define DLB2_PCI_EXT_CAP_ID_PASID 0x1B /* Process Address Space ID */ + + #define DLB2_PCI_PRI_CTRL_ENABLE 0x1 + #define DLB2_PCI_PRI_ALLOC_REQ 0xC +@@ -65,6 +66,8 @@ + #define DLB2_PCI_ACS_CR 0x8 + #define DLB2_PCI_ACS_UF 0x10 + #define DLB2_PCI_ACS_EC 0x20 ++#define DLB2_PCI_PASID_CTRL 0x06 /* PASID control register */ @@ -31,3 +42,18 @@ - static int - dlb2_pf_init_driver_state(struct dlb2_dev *dlb2_dev) -@@ -514,6 +515,16 @@ dlb2_pf_reset(struct dlb2_dev *dlb2_dev) + static int dlb2_pci_find_capability(struct rte_pci_device *pdev, uint32_t id) + { +@@ -258,12 +261,14 @@ dlb2_pf_reset(struct dlb2_dev *dlb2_dev) + uint16_t rt_ctl_word; + uint32_t pri_reqs_dword; + uint16_t pri_ctrl_word; ++ uint16_t pasid_ctrl; + + int pcie_cap_offset; + int pri_cap_offset; + int msix_cap_offset; + int err_cap_offset; + int acs_cap_offset; ++ int pasid_cap_offset; + int wait_count; + + uint16_t devsta_busy_word; +@@ -583,6 +588,28 @@ dlb2_pf_reset(struct dlb2_dev *dlb2_dev) @@ -37,2 +63,3 @@ -+ /* Disable PASID if it is enabled by default, which -+ * breaks the DLB if enabled. ++ /* The current Linux kernel vfio driver does not expose PASID capability to ++ * users. It also enables PASID by default, which breaks DLB PF PMD. We have ++ * to use the hardcoded offset for now to disable PASID. @@ -40,3 +67,13 @@ -+ 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", ++ pasid_cap_offset = DLB2_PCI_PASID_CAP_OFFSET; ++ ++ off = pasid_cap_offset + DLB2_PCI_PASID_CTRL; ++ if (rte_pci_read_config(pdev, &pasid_ctrl, 2, off) != 2) ++ pasid_ctrl = 0; ++ ++ if (pasid_ctrl) { ++ DLB2_INFO(dlb2_dev, "DLB2 disabling pasid...\n"); ++ ++ pasid_ctrl = 0; ++ ret = rte_pci_write_config(pdev, &pasid_ctrl, 2, off); ++ if (ret != 2) { ++ DLB2_LOG_ERR("[%s()] failed to write the pcie config space at offset %d\n", @@ -44 +81,2 @@ -+ return -1; ++ return ret; ++ } @@ -47,3 +85,3 @@ - return 0; - } - + /* Disable PASID if it is enabled by default, which + * breaks the DLB if enabled. + */