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 AB62DA0543 for ; Tue, 21 Jun 2022 10:12:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2083A42B86; Tue, 21 Jun 2022 10:12:35 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2080.outbound.protection.outlook.com [40.107.93.80]) by mails.dpdk.org (Postfix) with ESMTP id A215142B77 for ; Tue, 21 Jun 2022 10:12:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aNFGJkQdBkaOesOW0S70svvzcp6mCyzSy0d0ou90CPmpWdczJZfLDy7q1c7Xp9liyfeF7g5AXGdmsR6nmajMHWWbW3g0cXy+lI5gKK4Uk2YFNBtVQCQttHCI3MSy5QL7v9AWyyJZ59zotdNeqAOLjEEslTS6gv5jF011wv6VsgMXmV8qUGjD12w52QnXVhnqI4MfwFu2TrMv3iWKMmv6lLArkzR+cwBFWS4TgFEt8AKHfPSQRMEFWMFRL2w92gyb7L8kQFn2SRurYj2lL4LxY8TVP7Vo8U8SZNor7xki1EcaHiDLSDrdlPFlZOl/gyc/8q/Hfg6WdD7WnzOhEyySqg== 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=4yRX4guk+RdxfUH8+u7Vv4y4t0Z0URZkoYx8GP+q1uE=; b=ZEYKOF1SN5ZXgsbwSaZs8Gim5qIVvgmXOM++SOKCkQmCEtdOjhxI4dzz0C0q5XDNTlrfrL6GXmfitayuvvuxLMD9rcmmCrweRkvsj1Ou5yTqPnQKfZTwCBZZfcjQFUxQdH1afSevElJLRm17WsuFCsgq6ikHF2CGj1ZK8aj8Bau77tpH90uVxrhyYXn8toVhcKsD1q++GMxVawr/yumosAjv/8PfPlelJdhH8sjKS4klbktoR6djl50Jhpue7gDBHhn8B30qUT9ydaqylpb205eQRVSx3K7cX69MqPttcLwqiZf5LQ/6HZnUpjJHS0NoH39oObQzUqGZjfHHzvlTnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=dpdk.org 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 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=4yRX4guk+RdxfUH8+u7Vv4y4t0Z0URZkoYx8GP+q1uE=; b=sq4voN1x0LMLhGIzD4kdP2lJffoljX6ed3TU6cxlry3pfeaATLVsvGwnIz5XxmLyEoQhxhrBWdHFJXAMAB5TP92xRUgwCDAgvAn66pDyxKZ6EpUm33m/x5THEINwlRvhZoYhrZvUE6nA0ka6afqbVDr/IT3JHlvjQRQxD/cqXthwiuHQxsRUOUh3GgLNtZGGaEOgxl7QOQAqgmgnGBVmNU4Y+o8p8R7Kp1lS+/peh1HcOdazRLXtgvV1pxLv5tEl6ByH2Q8J25OnqOuOu/Q9Hk9wQN2Wn1qU4YNjyNI708ED2eRsawBTZH2ScB4rHNc3DIGhglFiVLcyPylXFAFmAg== Received: from MWHPR21CA0066.namprd21.prod.outlook.com (2603:10b6:300:db::28) by IA1PR12MB6284.namprd12.prod.outlook.com (2603:10b6:208:3e4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.22; Tue, 21 Jun 2022 08:12:31 +0000 Received: from CO1NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:300:db:cafe::ba) by MWHPR21CA0066.outlook.office365.com (2603:10b6:300:db::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.5 via Frontend Transport; Tue, 21 Jun 2022 08:12:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT024.mail.protection.outlook.com (10.13.174.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:12:30 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:12:29 +0000 Received: from nvidia.com (10.126.230.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.22; Tue, 21 Jun 2022 01:12:28 -0700 From: Xueming Li To: Romain Delhomel CC: Hemant Agrawal , dpdk stable Subject: patch 'bus/fslmc: fix VFIO setup' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:02:52 +0300 Message-ID: <20220621080301.2315720-107-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220621080301.2315720-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bf7cd161-b565-451e-3250-08da535dc98c X-MS-TrafficTypeDiagnostic: IA1PR12MB6284:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AEdVn5mCPxz1VLlOGKkkp6Mb+i9Tnq+6rjTs0lknYboknN0fsZLU65VTDVvTlGFQ+DYQuF9KA9EIa82sNUJlZplJTybrNGS4W6qY/aK1tz9AG2oysL19wgC+CtlQat/qupufNkjPF5Sw7U6xjIBYDqBHjJnqrQwVLAflqWbBdlkay02Gh9hsUHXBigD8LbRgUV5qT5BOQgwxZx/GVHEEb6ec8pxNUsoFVBvZzYBTss/CxyHKSSPZPkwyBAdll6ozM8cwPWUz6YLfg/qJNkV5It7V+7Fan24k5fJ49Sgt9CXu1Fy74bNFhRC5OIvNUw8jMGqC5EEMP98YtZ3/djp+gcP219VcXcEWicq0yyZCn3gSwQ1bZ8890AtT+Fj+wIUVmn13gBBXlKDbz6ZIM5YeFSE12L2JMpvNBkoY+P7cNBLLJVkTAQ9oXoZEKdzV90HupTD/QsCvSfMxtpgQT74lZxbNRAu0zzLfKEoBoRINz4cXtWiJmMlGMk/5hpm7JNk7Ao6Lm9i91i1mITbJX5XvBaMLj/Bhjy4zc3igKI0WHSumt8Vu6YSDC8FQ5N2igjS3ehSVg/TGmiT4S/1AHAujZQCFfjcId/9gnx2Vtpl0jlFK9y3ROy1xsRiTtGdz2suaUDDysqbjmJDaU3YaWbEFSr6FX1MSKvkluR/mmFZJqiG6cBHn4ZGxVgbshlgIwuTAOZ2aHAHJ0nGA9bLEte95LDtewU8mTKyHurhec/l+geZxWycVaIYdf5uAW72ojHguxtax/ZStcazl5UaGkGEyhwf8DCmQZpg/m5WivQjRq+m4MFN5P6DtEaz2TmohqqXWeXQHQyCVI7JgMjMyzpuHPe4rYqY+Vlp6QRGnQEIquWQ= X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(376002)(136003)(396003)(346002)(39860400002)(46966006)(36840700001)(40470700004)(70206006)(70586007)(966005)(5660300002)(8676002)(4326008)(478600001)(8936002)(7696005)(86362001)(40460700003)(40480700001)(36860700001)(83380400001)(53546011)(356005)(81166007)(82740400003)(55016003)(2906002)(54906003)(47076005)(336012)(316002)(6666004)(1076003)(16526019)(186003)(6916009)(2616005)(41300700001)(26005)(426003)(36756003)(82310400005)(6286002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:12:30.3568 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf7cd161-b565-451e-3250-08da535dc98c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6284 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 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/23/22. 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://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/8f68d6fdc6262db2fcf83030e248b83ebba4c991 Thanks. Xueming Li --- >From 8f68d6fdc6262db2fcf83030e248b83ebba4c991 Mon Sep 17 00:00:00 2001 From: Romain Delhomel Date: Fri, 3 Jun 2022 17:18:30 +0200 Subject: [PATCH] bus/fslmc: fix VFIO setup Cc: Xueming Li [ upstream commit 36c3c4df136f6d79c0ffaddec00696f5eddaef16 ] At device probe, the fslmc bus driver calls rte_vfio_get_group_fd() to get a fd associated to a vfio group. This function first checks if the group is already opened, else it opens /dev/vfio/%u, and increases the number of active groups in default_vfio_cfg (which references the default vfio container). When adding the first group to a vfio_cfg, the caller is supposed to pick an IOMMU type and set up DMA mappings for container, as it's done by pci bus, but it is not done here. Instead, a new container is created and used. This prevents the pci bus driver, which uses the default_vfio_cfg container, to configure the container because default_vfio_cfg->active_group > 1. This patch fixes the issue by always creating a new container (and its associated vfio_cfg) and binding the group to it. Fixes: a69f79300262 ("bus/fslmc: support multi VFIO group") Signed-off-by: Romain Delhomel Acked-by: Hemant Agrawal --- drivers/bus/fslmc/fslmc_vfio.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index b52f36c33e..2ab1368202 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -968,6 +968,7 @@ fslmc_vfio_setup_group(void) { int groupid; int ret; + int vfio_container_fd; struct vfio_group_status status = { .argsz = sizeof(status) }; /* if already done once */ @@ -986,8 +987,15 @@ fslmc_vfio_setup_group(void) return 0; } + ret = rte_vfio_container_create(); + if (ret < 0) { + DPAA2_BUS_ERR("Failed to open VFIO container"); + return ret; + } + vfio_container_fd = ret; + /* Get the actual group fd */ - ret = rte_vfio_get_group_fd(groupid); + ret = rte_vfio_container_group_bind(vfio_container_fd, groupid); if (ret < 0) return ret; vfio_group.fd = ret; -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:53.946601540 +0800 +++ 0106-bus-fslmc-fix-VFIO-setup.patch 2022-06-21 15:37:49.221118569 +0800 @@ -1 +1 @@ -From 36c3c4df136f6d79c0ffaddec00696f5eddaef16 Mon Sep 17 00:00:00 2001 +From 8f68d6fdc6262db2fcf83030e248b83ebba4c991 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 36c3c4df136f6d79c0ffaddec00696f5eddaef16 ] @@ -25 +27,0 @@ -Cc: stable@dpdk.org @@ -34 +36 @@ -index 1b89a56bbc..3d4e71a80a 100644 +index b52f36c33e..2ab1368202 100644 @@ -37 +39 @@ -@@ -995,6 +995,7 @@ fslmc_vfio_setup_group(void) +@@ -968,6 +968,7 @@ fslmc_vfio_setup_group(void) @@ -45 +47 @@ -@@ -1013,8 +1014,15 @@ fslmc_vfio_setup_group(void) +@@ -986,8 +987,15 @@ fslmc_vfio_setup_group(void)