From patchwork Wed Jun 7 04:24:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gupta, Nipun" X-Patchwork-Id: 128266 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF7E942C46; Wed, 7 Jun 2023 06:24:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 842D5410F6; Wed, 7 Jun 2023 06:24:42 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2052.outbound.protection.outlook.com [40.107.243.52]) by mails.dpdk.org (Postfix) with ESMTP id B16EB40A84 for ; Wed, 7 Jun 2023 06:24:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gMFz7v9KOwdymDcPZ4rH2vUlKafT4M8uO3jT+xP9qDOBd4ztGbZmxnPvDS6x4Grqp74MIxm41QmiSHOkFRcyrE+XzHqwVuGbLrhsQQTMIpPh9uIqI3B+6dR+STThOuXDM/NN9ekYmSM9hvyEaZeprASpQBHLwFuonMt4F2zaAN+C9VUGZ6PSXXYsIAWujWj7wXmHrwibaefN1HHIIvgwUgWXXJ4O6A5w4rTYamVA1/ur5i6VDkvSIpVoa8khHrMMEDkGS1NUh4wHVqo/a2vV9GjAempG9gbufQSYbeUEaJFV+OwmNcP+JbzXT5JrGUT92vYPgjb0NbptAkq2SJ/XvA== 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=omVEEjAkKoX/K/10u54IXc44aaAKj2TLJQwnj/F9FoE=; b=PJXwIUYI3+KRYdlyTGVHa151G+k11NYfHJZgLVQnCm7PwmoER56yOeQTeFUqPoIx0cmnzzCLIUP28O0S2dDpO1Wt1om+SepPGtvlHsB50OHf/zxPylOZckuJRgka78oBpHFxf73fpFKsHowEClwwxdKtWxwJ1yHeouBZxUg/PqcxWwOt4Oc/wgwX0BfSS9f0BCjIBgP+x7tYVML9yoGx3ucLK4Km4By89ge6hPUVjWsB61TdW0G6jO5vKdOGXqnBFwirqwfkUWJeZAK4NnRUMEwwdoVcJ2wMVejLtaBtNfhRBfjbIujk3J7H7dza6CtZ1gq+DeboyDpOGv/jSg8tAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=omVEEjAkKoX/K/10u54IXc44aaAKj2TLJQwnj/F9FoE=; b=SzLhAZL4sHN6k79mG9Sbi3O7suvHoT5mlO9Gsbdrxd56XDp52gK/4FvBhk2LyEYemEkFCHKqpE9kuXWaU/Yp+AXVH4zGzi2nm1/AFLBXNUTEPFOJWRXdg0IPKOnOkNmrLJZSC0l08wI3kiFZCBJ4ZGCWzTmZ/24yVHhy/ddfeOw= Received: from CY5PR22CA0037.namprd22.prod.outlook.com (2603:10b6:930:1d::7) by DS7PR12MB5958.namprd12.prod.outlook.com (2603:10b6:8:7d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Wed, 7 Jun 2023 04:24:39 +0000 Received: from CY4PEPF0000EE3C.namprd03.prod.outlook.com (2603:10b6:930:1d:cafe::a) by CY5PR22CA0037.outlook.office365.com (2603:10b6:930:1d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.19 via Frontend Transport; Wed, 7 Jun 2023 04:24:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CY4PEPF0000EE3C.mail.protection.outlook.com (10.167.242.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6477.13 via Frontend Transport; Wed, 7 Jun 2023 04:24:38 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 6 Jun 2023 23:24:38 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 6 Jun 2023 23:24:38 -0500 Received: from xhdipdslab41.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 6 Jun 2023 23:24:35 -0500 From: Nipun Gupta To: , , , , , CC: , , , Nipun Gupta Subject: [PATCH v8 0/4] Support AMD CDX bus Date: Wed, 7 Jun 2023 09:54:21 +0530 Message-ID: <20230607042425.30714-1-nipun.gupta@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230124140746.594066-1-nipun.gupta@amd.com> References: <20230124140746.594066-1-nipun.gupta@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3C:EE_|DS7PR12MB5958:EE_ X-MS-Office365-Filtering-Correlation-Id: 0de2ba36-4453-48f9-4f08-08db670f1bb4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WuNyscQtzzL2Hoi+ZdEU3CPMqbyOiNN/khCXN24IoJb1qVLG4IrhQg8x/g1pztwxXdvqg77nMWJJwcPpV0wcdi/by81JGA9KNXU/F3RabefFTtr1KVMVykxe1xD4Ho8IIUdmja+7SUwC7PMRqhUwxJz+fRhQbUyV88vHjcIQhnFlRvy6CnhtPpfpx5cOQgZhDurqAly9P8iUjogaX4QFbE1XrFeRZfQNivv8BUpEBSarbhP1lk1foA/GShQW2ZjGlfgE6KaROtQyGWfZAtzmhPOT42OPYNwU6RpKbpor3J+QAYYenolJSxvPVH/0KY9ktSGWELgw1GT+tQNnxKqZWOTShRZscm/mwrm9JW7Mpeaj6Gm8CHRhACTH+Y+HFnFLNVvVZI0ZBh9h74rD0G2fuAj5MbLIaB1MuUYhpdepuN5CgKg1mD4k5EzB3NaOUW381N6NTK7/tTcSfP8HA9Rr7PgBxrEVPiq1mP3ETtkSpsoWySeS6BCyOmODxC8ICPU2W7R3jAQR+/QtsoqHbTvzlfvw9b6fHk/OybqESHHN/a1FXFW0nakCKvn5QEjd96/078zBNQysyceUgtMv8xOmBnmGLHFf+JbltjnHs+LUdSNJrQeqa6MBw8/91fFQefwNrh2eCB9w83DeDHx0l+bcM9KzhkR/LbysTkj0bI28JvC1Qg9f1puFXDEQgQmO6aPoxDvlxewt/RwNcJgwtnIoK2YhUPR88cb9IXD9ZX9lJJvdo3ucoLOgV9712guuhWR9NHmFHwYhx1XuVMbhHv/NbkcRO6PVSX3I5Na6++UwVeE= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230028)(4636009)(136003)(396003)(346002)(376002)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(1076003)(40460700003)(26005)(966005)(36860700001)(36756003)(81166007)(336012)(426003)(83380400001)(47076005)(82310400005)(86362001)(82740400003)(356005)(186003)(40480700001)(2616005)(8676002)(41300700001)(44832011)(110136005)(54906003)(4326008)(478600001)(70586007)(2906002)(316002)(8936002)(70206006)(5660300002)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2023 04:24:38.8935 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0de2ba36-4453-48f9-4f08-08db670f1bb4 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE3C.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5958 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 The CDX devices are memory mapped on system bus for embedded CPUs. It uses sysfs interface and the vfio-cdx driver to discover and initialize the CDX devices. The CDX bus and VFIO support is available at Xilinx/AMD open source tree: https://github.com/Xilinx/linux-xlnx (drivers/cdx/ and drivers/vfio/cdx) Linux AMD CDX bus patches has been added into linux tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/cdx VFIO patches are also submitted in upstream: https://www.spinics.net/lists/kvm/msg310623.html CDX is a Hardware Architecture designed for AMD FPGA devices. It consists of mechanism for interaction between FPGA, Firmware and the APUs (Application CPUs). Firmware resides on RPU (Realtime CPUs) which interacts with the FPGA program manager and the APUs. The RPU provides memory-mapped interface (RPU if) which is used to communicate with APUs. VFIO CDX driver provides the CDX device resources like MMIO and interrupts to map to user-space. DPDK CDX bus uses sysfs interface and the vfio-cdx driver to discover and initialize the CDX devices for user-space applications. Changes v7->v8 - Renamed CDX_BUS_DEVICES_PATH to RTE_CDX_BUS_DEVICES_PATH - Renamed CDX_MAX_RESOURCE to RTE_CDX_MAX_RESOURCE Changes v6->v7 - removed redundant references to rte_cdx_sysfs_path(). - Fixed naming of cdx_vfio_setup_device() API from the first patch itself. - Added dot after few sentences in comments. Changes v5->v6 - Removed newly introduce irq_count parameter, and use num_intr instead. - Removed rte_cdx_sysfs_path(), and directly used the macro for the sysfs path. - Removed few unrequired param checks in multiple APIs - add name variable in rte_cdx_device - moved rte_cdx_bus from bus_cdx_driver.h to private.h - Other code cleanup Changes v4->v5 - Split patch and have a separate commit for eal interrupt field (irq_count) and corresponding set/get APIs (rte_intr_irq_count_set, rte_intr_irq_count_get) - Renamed "CDX bus" to "AMD CDX bus" in documentation/commit headings - Removed unnecessary headers Changes v3->v4: - removed platform specific patch (adding config for ARM CDX) from this series Changes v2->v3: - merged cdx bus compilation enablement in the first patch - fixed issue reported by check-git-log.sh - updated release notes - updated offset to uint64_t instead of off_t in cdx_map_resource Changes v1->v2: - Moved file rte_cdx_bus.h to internal bus_cdx_driver.h and added this file to deivce_cdx_headers - Moved cdx.h to private.h - Removed rte_ prefix from the static symbols in .c files. Changes RFC->v1: - Marked few API's as internal which were not required to be provided to user. Nipun Gupta (4): bus/cdx: introduce AMD CDX bus bus/cdx: add DMA map and unmap support bus/cdx: add support for MSI bus/cdx: support plug unplug and dev iterator MAINTAINERS | 5 + doc/guides/rel_notes/release_23_07.rst | 6 + drivers/bus/cdx/bus_cdx_driver.h | 192 +++++++ drivers/bus/cdx/cdx.c | 666 +++++++++++++++++++++++++ drivers/bus/cdx/cdx_logs.h | 37 ++ drivers/bus/cdx/cdx_vfio.c | 598 ++++++++++++++++++++++ drivers/bus/cdx/meson.build | 13 + drivers/bus/cdx/private.h | 53 ++ drivers/bus/cdx/version.map | 12 + drivers/bus/meson.build | 1 + 10 files changed, 1583 insertions(+) create mode 100644 drivers/bus/cdx/bus_cdx_driver.h create mode 100644 drivers/bus/cdx/cdx.c create mode 100644 drivers/bus/cdx/cdx_logs.h create mode 100644 drivers/bus/cdx/cdx_vfio.c create mode 100644 drivers/bus/cdx/meson.build create mode 100644 drivers/bus/cdx/private.h create mode 100644 drivers/bus/cdx/version.map