From patchwork Mon Jun 17 15:07:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dragos Tatulea X-Patchwork-Id: 13700914 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2048.outbound.protection.outlook.com [40.107.237.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14C0814E2F3; Mon, 17 Jun 2024 15:09:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718636946; cv=fail; b=fTQiFmkl92/FjnseJYHtp+i0eEaY6wW37N2dOhKdb3b/drCSYuPU26QqPWWmJSUWEM4YK8fhf7YTo6deVITqkjtRTQydgENgF/EzemDCJDItLvndlLoCcfgBRn2qHqu+hz4bpbpgRqxhIabnh8AhB4w03k93fWB+WY3syYu/XLA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718636946; c=relaxed/simple; bh=bRuejokTcGklha1Ogv5K7dMZm/jWTvvqWiQnO3jrNq8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=aMNTf8wt7dLv8xaAnkh7IX+x45Pl4+BN5Rx98xJztyXvkSgY+ma0EARbctJX6rGzSP3DgF/13TPlD9oH/JCP+OLKrFWNoq2yr1VFEPcDDav7bCC0w7+/PonOWcbSlQzhVGgMjEwWO72Em7ysIv0HGZpsiRcwNxI+E6ZvzpFqK9U= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=XcD1UXLN; arc=fail smtp.client-ip=40.107.237.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="XcD1UXLN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nf/jtcaOHAWE77t2nS6Fz6DYA1dtCMdkz1P43AdRKZSY95cO2gBoiTskiTjL1/XwpI5BLdymu6aKVtCgZovKn+uGt6zgvgQmYr4B29RzW+FRGhxbISw+a0c/YblcTyS9v1dqvDTzKdMfSnapQXWAKS/Ii9X7cpCbypBrUJfForneREdk2IyzTueMz1bmT9GbC9+2FXH+rRJwjP/I/uC/LS3OdogzWtWOblLtg0KVrtYvt/uXDnPO38wqWe5piw6aAAQTlwJzPVbHxwjHeY+sZxmQAPgr8A0XDQ0KS/tg0ia48MLb7WujfBqDV00/55FsWuqLZuGdZTn4/lOlix2FCQ== 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=kW3zhmW9RmiOPlX6gtQVeGNE6qk3CE502+x8haxAKFw=; b=Y0Rn7v4CjSCSBQvT70Ha4c5zcreTu/TGwyeYMvqRIoPbivkOSWg43ONGnnzOnGUH6L1jWwRnaRG9Wiv2zvJMJ/naO5udg4BtnoVDsIE0K1kTZygty5mqOGQB7i5Cr5zeY1KAnDotlp+3T2A5n3mPlkCJk5iTtD4ynfMFhQJPoS6u9a+OnHU36grH7RuYYv6CYi+twGO8MWt0BtrhPUJsaoWIqpOSz20aLGK2ZIQlLmfreEjsEqFJJSRTCj5vLs3Ip7pfrag/WV2u3TsQaSxZGT5Z/ZquJ/qv8yX7FFFRoJJs66D3wCykKMQlgqbKzOhs4kPDYhDkuusjWWwRvKefww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=redhat.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=kW3zhmW9RmiOPlX6gtQVeGNE6qk3CE502+x8haxAKFw=; b=XcD1UXLNz7E87sBJ/FIrwX9R0tblIuUZdQm0xh/rJb9AGBqLORTNcUXP0pFGBUuqzBgF/xxF/VOqQIr5TgRQpaiSLR8ZciPc9M4i45rOWYUdBv73SFJwG68yi/sPPcMclJp7Me0LoMWPdljGJ77H4SZ+cM7jUecLK1qnLL56FQp6lglZb/hoXjNz+z/i+S4Vz2Zt6p6RyFfBtYIK7nVx10IilnE6tGtcksQd1co/iHg64Er8ClFjOXsDiZwxVckf0GFDuMuIJSjUiKSYIW80NWFmQHB7XRQRrUrGi+icUAt5NMr1Hx4fG7CBVJCh6RJIpH+zv7ZIqOA+hgMHTHf7EQ== Received: from SJ0PR13CA0059.namprd13.prod.outlook.com (2603:10b6:a03:2c2::34) by CH3PR12MB8281.namprd12.prod.outlook.com (2603:10b6:610:128::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 15:09:00 +0000 Received: from SJ1PEPF00002315.namprd03.prod.outlook.com (2603:10b6:a03:2c2:cafe::6b) by SJ0PR13CA0059.outlook.office365.com (2603:10b6:a03:2c2::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31 via Frontend Transport; Mon, 17 Jun 2024 15:09:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SJ1PEPF00002315.mail.protection.outlook.com (10.167.242.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Mon, 17 Jun 2024 15:09:00 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 17 Jun 2024 08:08:39 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 17 Jun 2024 08:08:39 -0700 Received: from dev-l-177.mtl.labs.mlnx (10.127.8.11) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 17 Jun 2024 08:08:35 -0700 From: Dragos Tatulea Date: Mon, 17 Jun 2024 18:07:47 +0300 Subject: [PATCH vhost 13/23] vdpa/mlx5: Set mkey modified flags on all VQs Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240617-stage-vdpa-vq-precreate-v1-13-8c0483f0ca2a@nvidia.com> References: <20240617-stage-vdpa-vq-precreate-v1-0-8c0483f0ca2a@nvidia.com> In-Reply-To: <20240617-stage-vdpa-vq-precreate-v1-0-8c0483f0ca2a@nvidia.com> To: "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , =?utf-8?q?Eugenio_P=C3=A9rez?= , Saeed Mahameed , Leon Romanovsky , Tariq Toukan , Si-Wei Liu CC: , , , , Dragos Tatulea , Cosmin Ratiu X-Mailer: b4 0.13.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002315:EE_|CH3PR12MB8281:EE_ X-MS-Office365-Filtering-Correlation-Id: f6ba5ef0-98e4-4fd7-8ac7-08dc8edf6afb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|7416011|376011|1800799021|82310400023|36860700010; X-Microsoft-Antispam-Message-Info: =?utf-8?q?YrrxbFzO2Aezw4oA6lA2l1qZPZQBs0D?= =?utf-8?q?H49pGMH0ELo3uYCURssCDKDGE/94b9vGVLR14zaorJc4iHJ4aG2XzHFmbUY/Oc7El?= =?utf-8?q?jad3BpHabKmutT7GjY1f6eghymbGQ7uibC2c6xU6LlPMHduGkV+zWeNQNM+VZARAk?= =?utf-8?q?/VLnv5bdpTYco904JxbuYS5WAjGR3ElOGtjDAXvfNyODJ0K/WdanSzrw499EHj4VJ?= =?utf-8?q?ZHWnLnlI3dpui3CW/7n3ym12UszRwhKv0w+Fb9L4k40gJZ5jmTXV/gigkLCaVRVwA?= =?utf-8?q?nPgwISMoeThRPquLse/DNASo+B2g1veV+c0K9AyO3jisXQ34bepbbg3x5d2wBNHOQ?= =?utf-8?q?OpOOieM1gBUVg1opge4Qk5AIo84TfOML5qR3H0frqNsNYmYWy4C+PH2ibjMw2x6zt?= =?utf-8?q?ylaR8O7hlgTlqi0j6P+hk6KMVJEWa/QLw/dSOSMLWj7AbjLgiRtM4vUGWxhHwnLnd?= =?utf-8?q?VUzqELNuSsvnn2gYpYrye1AqgmzllWZ3RqqbKuuZ0hABNca50s6q6YRiTuDkfDqB3?= =?utf-8?q?UzkHhWcuCDYLDa98cNJnjEruWse+PVWiSR4bUQQT/rXSYCrGwwyqYMvM/JppqUkCa?= =?utf-8?q?6LoLi3+2D8N/ASvo8Yxe/0qfhZTQa5IxtoHQeH0M96x6Hj2wNO92O4IKUjzXu/CnN?= =?utf-8?q?IfOAAqYUT2pnZfPfnrw/Z5ekFWyF/KeliR2+WExuaZwukm5GHO00V3I0lyMnQt+V4?= =?utf-8?q?CGn2cZAiOPjU+SrEzhX6f83n0uesncRB729GNiru3AdLrS9h7mum+dwhjNdR4cEZW?= =?utf-8?q?L0bhfrGBjWpA0ySfVx89yYFRp0x89dFJWU7v4SGKFNMgJkkte9JXB09lq0l19pYIC?= =?utf-8?q?ygJAfT4MNFqeICFMHkBZIs9Namy1OQZMG29/XQOAHe0adXvVQGx2Vg4k/vzEX88y1?= =?utf-8?q?TvcKxdrKccpgnsqoznIeDlSTsusIyvaonJBIGbrcb0msXOlaO78eQBJOF4qwENtKr?= =?utf-8?q?koLNM/NReKDRfPN0Mr9rW8synJvYG37V2Ex76UbneesUUJg22ify4HpWnMhRzKSmx?= =?utf-8?q?9YwWT4kuYquoPxfhIE9nMZ0zloDmUcP43Va+u282kd8CltRofWnd8qGw65ze3necD?= =?utf-8?q?F3c0pO45Ud2YVrwp7+3o9HoYEHAhAqtxM97jXJfHlsiYEOS7qvFGERa2NvtVjloiE?= =?utf-8?q?Ec/FuZluzojZbDq2zUMHEMA8oASA+uogvxjAhNhkn5hF6co2A++pIOh6WJiQdXP/W?= =?utf-8?q?pQReG6DlpHOtBJAyCspPxOjUS/A/Ch+gA16NSZTTkkVEBv6Q6ynYeJ1WmozK4owUl?= =?utf-8?q?ZnvUOFub2dwTT0+tLeNEaQzf80Pw6A1JHXs94eRjqgQpXlQc9LRDukgkKWn751RUD?= =?utf-8?q?Ejw44O0Buk6ySmWodffRj0FG0GrQTA6Ung=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230037)(7416011)(376011)(1800799021)(82310400023)(36860700010);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 15:09:00.3332 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f6ba5ef0-98e4-4fd7-8ac7-08dc8edf6afb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002315.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8281 Otherwise, when virtqueues are moved from INIT to READY the latest mkey will not be set appropriately. Signed-off-by: Dragos Tatulea Reviewed-by: Cosmin Ratiu Acked-by: Eugenio PĂ©rez --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 0201c6fe61e1..0abe01fd20e9 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -2868,7 +2868,7 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_dev *mvdev, mlx5_vdpa_update_mr(mvdev, new_mr, asid); - for (int i = 0; i < ndev->cur_num_vqs; i++) + for (int i = 0; i < mvdev->max_vqs; i++) ndev->vqs[i].modified_fields |= MLX5_VIRTQ_MODIFY_MASK_VIRTIO_Q_MKEY | MLX5_VIRTQ_MODIFY_MASK_DESC_GROUP_MKEY;