From patchwork Wed Jun 26 10:26:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dragos Tatulea X-Patchwork-Id: 13712584 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2083.outbound.protection.outlook.com [40.107.101.83]) (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 3EBF71891B3; Wed, 26 Jun 2024 10:28:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719397702; cv=fail; b=pdECgMV/fXTMGPNxy1YKCuA9UEigho84uOFxDNyOKgI0W7FY/gJunpaNAY13FRjKf7V/czJ+7WwQqY0820xesuMYJJf94yCqJ8rP2IDm+//Jz5vNdLadxJsF+V1qGsrziz/Fes9G6ft4xgZfiwlNAHs7fmI9yscu4Htu/AdJPag= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719397702; c=relaxed/simple; bh=whQRwMurwR7+5xmqkko0RXDfBCTnvyZor1nUs9Pfldk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=Y2Z3Vy5gpKm3Tm99aw5LycJ/DHpJMR//md01NzsKCwYwZ0ZAXYCdG99cMW+khLMF8Mw/1UTRsqVW+ByseoQkNxOsEWkMw64gJJaSFKDi7TwtzXbZqAdmgvLydVKloe/I1ouf0lfpyL37w05zoz+ivRWGhVRefR5GZwonTTkwsT8= 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=DJ54YFpk; arc=fail smtp.client-ip=40.107.101.83 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="DJ54YFpk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gw7ikQwrOQkeRTb4vyrdtd8nV5a/kENHR60D2sGQ6RCWbvWWSVsBK5KWsaLpMjAXL4vQZD3TwEyE9PSTSO7GyNXKJ/VSJ68or9gxHExETuEjhRN/uW9r1GZZjKlCLU0T3ggz/DvIJfUmfCn6kowximgXkrqnJIOa7f3TJinil8q1IMcwQ7rLD0MTqpbTDR+veQIwcjhAX3oFTuj/VumEjdqpdJ1LmrkYCOoO2l8BKGmEd2U9BPxX4nPYubG1ZWasvqO5xCgFfmayzzdy3sYpx3kPH7bczk+n89GyIO2Njhbs8MDnOM/8MNwpfhn7rB7hia/FtcFXMufHGx+KeqRkwg== 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=WC3s7q91jMMJangr3DqIrBQXO49/MF0PtoKsocV6JwM=; b=ETgOOfE8u2MZUQ0mFOltf7xctG3/lhNlR/fwfXirxHDCL4mKAUA33y2gI9AtRJEIcNSjUs0TVd/mxLb35RRFvcryD0/8vc2kCL9H3v3GVWNos3GoyDnFgGnKiCvVUtoMd5FG8WfP9DFKPFpy8GbqiMdkkssa2Lo2nbCuaolvKYcnuEiI2JORs+koO/8j3rNgRhSY7N1eT5wh3bYpMFCIBqLg8NJCg3a4UDThsXZ2LBXHZAHjeNTxvszTKJcIQUwA83gt6soIIQIxO6y878YwzujToHdYjyfdqLP9do8oqVH2TlKhWAd6eAGWfIinG2R2EibfgY4Hc03C9vrx83Ld3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.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 (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=WC3s7q91jMMJangr3DqIrBQXO49/MF0PtoKsocV6JwM=; b=DJ54YFpkykr0+nAhx5dedInVU11Il0flu9ZJEez90hCwEd8zU2htxHK/GB9mmE+QKiO73BQKmWTp8CC9/lzN3HGFXxTGUnME+sxlTDk/+cHD5oReGvvEjuwgCiPNLR2ykKyqcJascdpqWvjGkg7XgO7Z2Z1Poeha8NWkYZiccGIPqPkMm2B051taJmsd1M5hBObwdcc4vkE+u1v3yMc8acgkNWmxsa5uQXrShEEnUO9KvSt2Mfsvk0AnU1caSe+VTTp4nAO89vyG6co1Axn7H7aMFuTfE7SRyJOU+h8AkrGM3fObg5c4wH9ZP5quT+SnWo3TNQnVknqlKHvlnloAfA== Received: from BYAPR11CA0081.namprd11.prod.outlook.com (2603:10b6:a03:f4::22) by PH8PR12MB6937.namprd12.prod.outlook.com (2603:10b6:510:1bc::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.30; Wed, 26 Jun 2024 10:28:18 +0000 Received: from MWH0EPF000971E6.namprd02.prod.outlook.com (2603:10b6:a03:f4:cafe::88) by BYAPR11CA0081.outlook.office365.com (2603:10b6:a03:f4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.22 via Frontend Transport; Wed, 26 Jun 2024 10:28:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by MWH0EPF000971E6.mail.protection.outlook.com (10.167.243.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Wed, 26 Jun 2024 10:28:17 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 26 Jun 2024 03:28:04 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) 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.1544.4; Wed, 26 Jun 2024 03:28:04 -0700 Received: from dev-l-177.mtl.labs.mlnx (10.127.8.11) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 26 Jun 2024 03:28:00 -0700 From: Dragos Tatulea Date: Wed, 26 Jun 2024 13:26:55 +0300 Subject: [PATCH vhost v2 19/24] vdpa/mlx5: Forward error in suspend/resume device Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240626-stage-vdpa-vq-precreate-v2-19-560c491078df@nvidia.com> References: <20240626-stage-vdpa-vq-precreate-v2-0-560c491078df@nvidia.com> In-Reply-To: <20240626-stage-vdpa-vq-precreate-v2-0-560c491078df@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: , , , , Cosmin Ratiu , Zhu Yanjun , Dragos Tatulea X-Mailer: b4 0.13.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E6:EE_|PH8PR12MB6937:EE_ X-MS-Office365-Filtering-Correlation-Id: 76a213df-99c1-479c-9736-08dc95cab1c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230038|36860700011|376012|7416012|1800799022|82310400024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?aNFc3NHEjFkCGoLLU0X3UsoKS75N98n?= =?utf-8?q?h9tqd4PACwH+hLlfzQArltYw2JXKpRwRQGPk5OeBzYHzwL+by22vTZnvfi9HY+VX3?= =?utf-8?q?POhKt+ogVDbUtCdiyhthlf98xFYgOO6N/OY5cfhFmBhwQI5XPc4yXqEYJqXmUT2/z?= =?utf-8?q?6uGorYbzeFDiSYNIs4529i/Xu//s11q0GDEXTOcHyeFknWfUtENfDbufrgJu8Dv8C?= =?utf-8?q?8uQB51AbnDxrgoVWkZC05AghGDXthu1dUlqmSda23HJOQeLaxc5KCz6FnvR+LblhY?= =?utf-8?q?tluR4f+oxWpIhkAafqUKTtiht4GqKoRhBe3KXyz7i9Y8R3xjhgZjjtl4f3zPju6N1?= =?utf-8?q?fpTxzZhQxyj7hbxNBGqyqOtVVTtf01ZpZcAfCva0pSiB7ikPD42fk8qmXwptASbOa?= =?utf-8?q?jcxIQaS9k4ruzTB+O7c0DgmDymUZ5NmMmFZugKiRo99qPRkUd64mIAPIjnz4ALrci?= =?utf-8?q?4JzyZyccQcccUKXEDI/DLtfVAurodmWf0YaRCN2SP2nmBnwtu1nopZ5O85effEUK/?= =?utf-8?q?Cg6A4YezxIhlbQuy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;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230038)(36860700011)(376012)(7416012)(1800799022)(82310400024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2024 10:28:17.7566 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 76a213df-99c1-479c-9736-08dc95cab1c7 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.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000971E6.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6937 Start using the suspend/resume_vq() error return codes previously added. Reviewed-by: Cosmin Ratiu Reviewed-by: Zhu Yanjun Signed-off-by: Dragos Tatulea Reviewed-by: Eugenio PĂ©rez --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index e65d488f7a08..ce1f6a1f36cd 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -3436,22 +3436,25 @@ static int mlx5_vdpa_suspend(struct vdpa_device *vdev) { struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev); struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev); + int err; mlx5_vdpa_info(mvdev, "suspending device\n"); down_write(&ndev->reslock); unregister_link_notifier(ndev); - suspend_vqs(ndev); + err = suspend_vqs(ndev); mlx5_vdpa_cvq_suspend(mvdev); mvdev->suspended = true; up_write(&ndev->reslock); - return 0; + + return err; } static int mlx5_vdpa_resume(struct vdpa_device *vdev) { struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev); struct mlx5_vdpa_net *ndev; + int err; ndev = to_mlx5_vdpa_ndev(mvdev); @@ -3459,10 +3462,11 @@ static int mlx5_vdpa_resume(struct vdpa_device *vdev) down_write(&ndev->reslock); mvdev->suspended = false; - resume_vqs(ndev); + err = resume_vqs(ndev); register_link_notifier(ndev); up_write(&ndev->reslock); - return 0; + + return err; } static int mlx5_set_group_asid(struct vdpa_device *vdev, u32 group,