From patchwork Mon Jul 8 12:00:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dragos Tatulea X-Patchwork-Id: 13726485 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2069.outbound.protection.outlook.com [40.107.244.69]) (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 1BDD681204; Mon, 8 Jul 2024 12:02:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720440122; cv=fail; b=V4RBkKmbQNxGho+hacVclba4lh4HbAT5kSHwUo1hjbvIaai0vbmB2MBCtCb0APZ3S7inmUoE8GT/wRn/t/fwi172AgKT8eS1NatgzRoD0YbDsXh/fymr4gnDscsUuR9vVtCIkZbBe4KJ6a/K9nAK1VuZjalKZqbjYxon+64+Opg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720440122; c=relaxed/simple; bh=12Dr6zuEz2nc2bE2dCzdzt24pNdY8ZFBxTyO1Ij5xvQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=Vht5y/7RzrnixXvQHoRAwfJ7MjP4+Ku2+5qIBFPF4K+yuP9gIrm9cfAmf2rn6QtB6+xDOoE998nJE7ivu+DXMt0mpmcDJM/3R4UJKOiC/PHMlJtZhxmlElvfO6h7DsqOBJ43U+drJ1kQnUkGtaBCxdqcXpeqVYuLdfLBrHHPwBs= 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=rojzHguT; arc=fail smtp.client-ip=40.107.244.69 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="rojzHguT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ws7OBmJRKvKfngzUd1YYWZnDCp5lmEHhvgf+TbpDaxDX1sl50TuM1JTcQKiMcyFRNMSjufd7ORgTQBJ3OG7ZmmsiQz2OiqrfuEDFXPJyh9I/96PJTSwyT0SguPSdDDmsAJ/Pvojfmc+x4GXbOs6QSP0wOFH8w40ECNuuR2RSmaLTzTQsAtVr6oJmk0LJZIJ1hjSCZ6qvdbPo1rt7Iait0AhWgo8hUVCewjPIMTN3P9RqVosjykKswNOMor9+x9WEiZUEiL42DWWLgnX1fh+OhvevVN4CBdxU1aHAyOy9lssn5EBo+Ww66B5N2+H6nBb98Y6Gx2ud9SBOYBcNyPjeSQ== 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=FCmX+zWkXUAYQ6ml53q+Q3AVZGrx6w5R19RLYsqCCsU=; b=PL+6f1NKTsEYG259Q1jOzgC+veJzBhFrZlSfDtTqhsmlgEsyF3eg0B5wraQlonQiPLfbIjgGSB2Yv69pOopcIU4E/e0/FrXYP8D831vDypxBrDz8c8+GHrzcLUY8rZVCebTC2UwXBTjSZDbRLK3f1V37n/q/XRoNWCBdDg0uHUpkfRD9gQ13illaO+ZdTjYkaYQmzPD482UFpjFK4BEe/BsNZy5wb8HMBrOJfwWUxxR/Djh4wOEAebtsLJ0TwUP6xG/zyDNKPE9BQtpMR1uoMut/CNcOVJ9TYXTKURk84S8A1Yq0earDg90hoPRyT6UUvZ34OyYk3+Tr+VooljX1Gw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=oracle.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=FCmX+zWkXUAYQ6ml53q+Q3AVZGrx6w5R19RLYsqCCsU=; b=rojzHguTX3e/K/u/VgnxqHUozpjFf979FXswyJWLf8AwY2/DRx7NpE2GNtNiYtQA6oD3lZ0Q8X24bj8pZCecJL99W+alKm9cW+zyEflUObH9gNGYYS/BgZixT77aUzJNMJwo7d1kWY+WkONSLy43ZzJVngX4wcnQ+IJkftJ2oGrdDE4VQeCSMtVG8tqzK6mPJo9xq5AoHu4KBb6/1BdMELkbWgI9/mJz3ZG48IXIykdaS6n9lzRjOWmWBAJ1j7akrzCCX0XScg263VHoUkpM26fBu1oGuA72vx1q0+1Mx39YqtM2e1hG9YCZPqnz2WLZfiQdn2B/0On5iEanZW1nfw== Received: from BL1PR13CA0181.namprd13.prod.outlook.com (2603:10b6:208:2be::6) by SJ2PR12MB8182.namprd12.prod.outlook.com (2603:10b6:a03:4fd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Mon, 8 Jul 2024 12:01:57 +0000 Received: from BL6PEPF0001AB72.namprd02.prod.outlook.com (2603:10b6:208:2be:cafe::4d) by BL1PR13CA0181.outlook.office365.com (2603:10b6:208:2be::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.19 via Frontend Transport; Mon, 8 Jul 2024 12:01:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF0001AB72.mail.protection.outlook.com (10.167.242.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Mon, 8 Jul 2024 12:01:57 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 05:01:35 -0700 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 8 Jul 2024 05:01:35 -0700 Received: from dev-l-177.mtl.labs.mlnx (10.127.8.11) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 8 Jul 2024 05:01:31 -0700 From: Dragos Tatulea Date: Mon, 8 Jul 2024 15:00:33 +0300 Subject: [PATCH vhost v3 09/24] vdpa/mlx5: Rename init_mvqs Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240708-stage-vdpa-vq-precreate-v3-9-afe3c766e393@nvidia.com> References: <20240708-stage-vdpa-vq-precreate-v3-0-afe3c766e393@nvidia.com> In-Reply-To: <20240708-stage-vdpa-vq-precreate-v3-0-afe3c766e393@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 X-Mailer: b4 0.13.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB72:EE_|SJ2PR12MB8182:EE_ X-MS-Office365-Filtering-Correlation-Id: 8380f6ff-d29a-4da9-fbdb-08dc9f45c47d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|7416014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?FHxbKMPqA6WGcwEEiTY/LyQZPsGScdc?= =?utf-8?q?b4WKugPXR7qK4wftVvuwria7vwHxTT/HVr21ATHp18XaIlriRiOLE0yzsUj2ktLye?= =?utf-8?q?IraR3v7N9zsb5hMQe8eNt7R8rANF3Gn/gPBL9KmfoaBlIdV6M6FTUiK9dXXqV1zo3?= =?utf-8?q?MlXTJxPDCeYno+FdRuxfjO/+qMsXTsYxtKAkIocblfCmTt2uVPPG7XTZhUBVtjHth?= =?utf-8?q?cSaxZ96vDpVcKjqHEyTEHKqCg69Y2lSFsvM3c5zSIX/E234G5YxDOvt6z3vw/fQX3?= =?utf-8?q?O81huEjfHb955o9wPVFTkPK7vI94cqYtEJot+0WbIT3as/Qhw2Z01uONZ8HmZ6iIW?= =?utf-8?q?AEoFc8QFhGTEsVd+qLY/ec0CgJ8ttm4bp96veAW3VlJTRsCHjgtFg+WsVZngBc3lF?= =?utf-8?q?D9tiKizn4PYWlQLv7Mcvzqr8ZJ04wDg6K9A+J3YMV7iW/oRGJup9i5cmP8R9OPkSp?= =?utf-8?q?rNiqFmgY7YjpoDIZlG+BRc7w2pG9X7MjOXwPYC5j9gfV3L43AAulVp2qgAYBG6zU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-8?q?kJSC+v6HfSi?= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(376014)(7416014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 12:01:57.5730 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8380f6ff-d29a-4da9-fbdb-08dc9f45c47d 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.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB72.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8182 Function is used to set default values, so name it accordingly. Reviewed-by: Eugenio PĂ©rez Signed-off-by: Dragos Tatulea --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index de013b5a2815..739c2886fc33 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -155,7 +155,7 @@ static bool is_index_valid(struct mlx5_vdpa_dev *mvdev, u16 idx) } static void free_fixed_resources(struct mlx5_vdpa_net *ndev); -static void init_mvqs(struct mlx5_vdpa_net *ndev); +static void mvqs_set_defaults(struct mlx5_vdpa_net *ndev); static int setup_vq_resources(struct mlx5_vdpa_net *ndev); static void teardown_vq_resources(struct mlx5_vdpa_net *ndev); @@ -2810,7 +2810,7 @@ static void restore_channels_info(struct mlx5_vdpa_net *ndev) int i; mlx5_clear_vqs(ndev); - init_mvqs(ndev); + mvqs_set_defaults(ndev); for (i = 0; i < ndev->mvdev.max_vqs; i++) { mvq = &ndev->vqs[i]; ri = &mvq->ri; @@ -3023,7 +3023,7 @@ static int mlx5_vdpa_compat_reset(struct vdpa_device *vdev, u32 flags) down_write(&ndev->reslock); unregister_link_notifier(ndev); teardown_vq_resources(ndev); - init_mvqs(ndev); + mvqs_set_defaults(ndev); if (flags & VDPA_RESET_F_CLEAN_MAP) mlx5_vdpa_destroy_mr_resources(&ndev->mvdev); @@ -3485,7 +3485,7 @@ static void free_fixed_resources(struct mlx5_vdpa_net *ndev) res->valid = false; } -static void init_mvqs(struct mlx5_vdpa_net *ndev) +static void mvqs_set_defaults(struct mlx5_vdpa_net *ndev) { struct mlx5_vdpa_virtqueue *mvq; int i; @@ -3635,7 +3635,7 @@ static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name, } ndev->cur_num_vqs = MLX5V_DEFAULT_VQ_COUNT; - init_mvqs(ndev); + mvqs_set_defaults(ndev); allocate_irqs(ndev); init_rwsem(&ndev->reslock); config = &ndev->config;