From patchwork Sat Apr 22 01:06:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brett Creeley X-Patchwork-Id: 13220862 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76B85C7618E for ; Sat, 22 Apr 2023 01:07:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234182AbjDVBHt (ORCPT ); Fri, 21 Apr 2023 21:07:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234140AbjDVBHh (ORCPT ); Fri, 21 Apr 2023 21:07:37 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2088.outbound.protection.outlook.com [40.107.223.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 208FB269E; Fri, 21 Apr 2023 18:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LyaHsb+FbZUuQ6A3ZiDhmWgSNSdQcH3JTy0GCt6ipg/Z1YsMWyrX4xAqxCS4LWqA3mjWYera/dWXHPCTEXivBKOCOMCoofWScMtqdX7st2xNfD5t2hWdvVG8vA4NrRgif9h/CmTgocHLNqxWOaCfMd1iPDqmSpNbHd3MzNstX31rUtF5kLFp2lcn8z5aK3tsF8FWnRvluL4nCZxsXTuDUSeLQS6kfbJp42eFyYd0efedDCe+GQsBsDJ+BkkIwetj/mvUVqAljoZ9XUvQEjwS+30Kbf2kgFT8/YzKg+WKTMJOSgfPrQVzMrncUpWlst7HdwNmGwT1Kcz6iT/hS/ZrKA== 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=fySxURFxhBfMeWykpyJOwgXivkTgR94ltVVXbx7NImA=; b=WF7RnIAxmaBBAD8VPXSd10kVF7+hMRyZZWVKEQ8ETT26U7lcggjA491NcQhnBfmTaHVklLl9PsT3PD4m01R138zAyr/PrAuT1SFydTbp6ji0o+5e8jmbbeBcu5cRqLDRmXKjOdWyaL2MpSTDV+GV0KXX38WjiwkgE9FXruF82zTwC/0Ex2IMW7GzVa9EfnLlUG5xRZ7IOi30oAfgXZQhBXmPKhdyQlpk3kqTJszuxXs0SvkQoUETLgS9QCpcS1oLGiikqshXnZF7qa8eUfwPYCVmz07ogggPlteT0lBL165amcFJtZJ8/H+/3K0EA2DrIbXxGLTjZRnV/APR0/qH0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.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=fySxURFxhBfMeWykpyJOwgXivkTgR94ltVVXbx7NImA=; b=uqlJdxcIm+akQLURAJf7Ze6bkIa0gwpIG3n5fyIgrs6pmznA77Hbi5+nX1Fq0aVLFH3C6sgiGrrsGwysnHs+PU4qU29amwwWpiIgwiSzuRxXaoKOLmBdl1juHzivxSsIrCC1mu8Z+fFkt6bMnV1uaPEiDoT7B2CDu4oo+7Fn13I= Received: from BN9PR03CA0359.namprd03.prod.outlook.com (2603:10b6:408:f6::34) by DS7PR12MB6096.namprd12.prod.outlook.com (2603:10b6:8:9b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Sat, 22 Apr 2023 01:07:22 +0000 Received: from BN8NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f6:cafe::48) by BN9PR03CA0359.outlook.office365.com (2603:10b6:408:f6::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.25 via Frontend Transport; Sat, 22 Apr 2023 01:07:21 +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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT005.mail.protection.outlook.com (10.13.176.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6319.27 via Frontend Transport; Sat, 22 Apr 2023 01:07:21 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 21 Apr 2023 20:07:20 -0500 From: Brett Creeley To: , , , , , , CC: , , Subject: [PATCH v9 vfio 7/7] vfio/pds: Add Kconfig and documentation Date: Fri, 21 Apr 2023 18:06:42 -0700 Message-ID: <20230422010642.60720-8-brett.creeley@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230422010642.60720-1-brett.creeley@amd.com> References: <20230422010642.60720-1-brett.creeley@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT005:EE_|DS7PR12MB6096:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f0ee63a-3560-4ab9-4c31-08db42cded2a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zTgrUQ9T0B009fnjYFSGhDvQPRPG4Ww5XJGgLANRohMnqLkniXxj+FNRzkUViRj+yOJKOACcU4JpN2nO+vw61LqicAmo0U5WiYFA+S8srKwsmvECEoHDgysq01tJEsjKQ5m9RVt7aqvnylYj/btD/CzJyU502jItrg5g6YZzxNwXoQxkVJjLZ4y1hLHI7B+Az/tErVff8i3reI9uEvLTqwr6rTsQlZApMkRe7OItzIJwwnWfvQpUA1pvUJ+SzFcRNnwvm7D0I7Vu06zNdpXAw3mE52QSPLZW+jdAFT9HUaHjjCZ+snoAFi1rAdfXR6ckm0iiytE+rd33VIngr9J5Cwojs8Ck0gwaxO0DEaNpSOb62EfHGCquhjjVG9WPuYGuU27ymJ5QXxhuzL0OLORp7Ji/inATmUDQc5dIM73Xt9IjRfN0B5x5fA3w/8c5XioQBtPtUN05hc/mesdCYGP0lew9M0D1x+pa8GDgd+mgGGlYuUFg5/6Cz5JihRv3w1ksx8qiRGG82YENACiskhR17JIfsx9JWEO1HDypU8czk7xykNrWQncipxBT9Yuht1sMxN+b9JNdsagxlUhpdMdNMiXkhJsfmLyWYpGPnUmAZeeC5fEeMjaq2iPSAsFU0R0WbSemN7/Dj1V8JdZ701jmyKGHVW6K1XE33XgpqooylM0Pya8vSRCYUu+kKUQop5xfXKA0l1TiXe8FO6YsyC/+P14K9nmfYg5MVdO9ot7v7A8= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(376002)(136003)(396003)(451199021)(46966006)(40470700004)(36840700001)(16526019)(40460700003)(44832011)(36756003)(2906002)(8676002)(86362001)(40480700001)(5660300002)(41300700001)(316002)(8936002)(82310400005)(70586007)(4326008)(70206006)(356005)(47076005)(336012)(82740400003)(36860700001)(426003)(83380400001)(2616005)(110136005)(1076003)(478600001)(26005)(54906003)(186003)(81166007)(6666004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2023 01:07:21.7289 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9f0ee63a-3560-4ab9-4c31-08db42cded2a 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT005.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6096 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Add Kconfig entries and pds_vfio.rst. Also, add an entry in the MAINTAINERS file for this new driver. It's not clear where documentation for vendor specific VFIO drivers should live, so just re-use the current amd ethernet location. Signed-off-by: Brett Creeley Signed-off-by: Shannon Nelson Reviewed-by: Simon Horman --- .../device_drivers/ethernet/amd/pds_vfio.rst | 79 +++++++++++++++++++ .../device_drivers/ethernet/index.rst | 1 + MAINTAINERS | 7 ++ drivers/vfio/pci/Kconfig | 2 + drivers/vfio/pci/pds/Kconfig | 20 +++++ 5 files changed, 109 insertions(+) create mode 100644 Documentation/networking/device_drivers/ethernet/amd/pds_vfio.rst create mode 100644 drivers/vfio/pci/pds/Kconfig diff --git a/Documentation/networking/device_drivers/ethernet/amd/pds_vfio.rst b/Documentation/networking/device_drivers/ethernet/amd/pds_vfio.rst new file mode 100644 index 000000000000..7bddde0c7c9d --- /dev/null +++ b/Documentation/networking/device_drivers/ethernet/amd/pds_vfio.rst @@ -0,0 +1,79 @@ +.. SPDX-License-Identifier: GPL-2.0+ +.. note: can be edited and viewed with /usr/bin/formiko-vim + +========================================================== +PCI VFIO driver for the AMD/Pensando(R) DSC adapter family +========================================================== + +AMD/Pensando Linux VFIO PCI Device Driver +Copyright(c) 2023 Advanced Micro Devices, Inc. + +Overview +======== + +The ``pds_vfio`` module is a PCI driver that supports Live Migration +capable Virtual Function (VF) devices in the DSC hardware. + +Using the device +================ + +The pds_vfio device is enabled via multiple configuration steps and +depends on the ``pds_core`` driver to create and enable SR-IOV Virtual +Function devices. + +Shown below are the steps to bind the driver to a VF and also to the +associated auxiliary device created by the ``pds_core`` driver. This +example assumes the pds_core and pds_vfio modules are already +loaded. + +.. code-block:: bash + :name: example-setup-script + + #!/bin/bash + + PF_BUS="0000:60" + PF_BDF="0000:60:00.0" + VF_BDF="0000:60:00.1" + + # Prevent non-vfio VF driver from probing the VF device + echo 0 > /sys/class/pci_bus/$PF_BUS/device/$PF_BDF/sriov_drivers_autoprobe + + # Create single VF for Live Migration via VFIO + echo 1 > /sys/bus/pci/drivers/pds_core/$PF_BDF/sriov_numvfs + + # Allow the VF to be bound to the pds_vfio driver + echo "pds_vfio" > /sys/class/pci_bus/$PF_BUS/device/$VF_BDF/driver_override + + # Bind the VF to the pds_vfio driver + echo "$VF_BDF" > /sys/bus/pci/drivers/pds_vfio/bind + +After performing the steps above, a file in /dev/vfio/ +should have been created. + + +Enabling the driver +=================== + +The driver is enabled via the standard kernel configuration system, +using the make command:: + + make oldconfig/menuconfig/etc. + +The driver is located in the menu structure at: + + -> Device Drivers + -> VFIO Non-Privileged userspace driver framework + -> VFIO support for PDS PCI devices + +Support +======= + +For general Linux networking support, please use the netdev mailing +list, which is monitored by Pensando personnel:: + + netdev@vger.kernel.org + +For more specific support needs, please use the Pensando driver support +email:: + + drivers@pensando.io diff --git a/Documentation/networking/device_drivers/ethernet/index.rst b/Documentation/networking/device_drivers/ethernet/index.rst index 417ca514a4d0..0dd88e6f4e7c 100644 --- a/Documentation/networking/device_drivers/ethernet/index.rst +++ b/Documentation/networking/device_drivers/ethernet/index.rst @@ -15,6 +15,7 @@ Contents: amazon/ena altera/altera_tse amd/pds_core + amd/pds_vfio aquantia/atlantic chelsio/cxgb cirrus/cs89x0 diff --git a/MAINTAINERS b/MAINTAINERS index 6ac562e0381e..df9cc59bc858 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21991,6 +21991,13 @@ S: Maintained P: Documentation/driver-api/vfio-pci-device-specific-driver-acceptance.rst F: drivers/vfio/pci/*/ +VFIO PDS PCI DRIVER +M: Brett Creeley +L: kvm@vger.kernel.org +S: Maintained +F: Documentation/networking/device_drivers/ethernet/amd/pds_vfio.rst +F: drivers/vfio/pci/pds/ + VFIO PLATFORM DRIVER M: Eric Auger L: kvm@vger.kernel.org diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig index f9d0c908e738..2c3831dd60ef 100644 --- a/drivers/vfio/pci/Kconfig +++ b/drivers/vfio/pci/Kconfig @@ -59,4 +59,6 @@ source "drivers/vfio/pci/mlx5/Kconfig" source "drivers/vfio/pci/hisilicon/Kconfig" +source "drivers/vfio/pci/pds/Kconfig" + endif diff --git a/drivers/vfio/pci/pds/Kconfig b/drivers/vfio/pci/pds/Kconfig new file mode 100644 index 000000000000..149d4986bf43 --- /dev/null +++ b/drivers/vfio/pci/pds/Kconfig @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2023 Advanced Micro Devices, Inc. + +config PDS_VFIO_PCI + tristate "VFIO support for PDS PCI devices" + depends on PDS_CORE + depends on VFIO_PCI_CORE + help + This provides generic PCI support for PDS devices using the VFIO + framework. + + More specific information on this driver can be + found in + . + + To compile this driver as a module, choose M here. The module + will be called pds_vfio. + + If you don't know what to do here, say N. +