From patchwork Thu Apr 4 17:33:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13618094 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2048.outbound.protection.outlook.com [40.107.102.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 8B8FB12D770 for ; Thu, 4 Apr 2024 17:34:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712252087; cv=fail; b=tuFp7Qas9GBplWCPe8byoeFT1cAzYCeuV4/IXLMJ5rw3FPkvQkhrgjVlTsfL8dkiUpFaKnwgAW2zxaLn2xlMg3CHHE+DG3kjU2nY4K4mMOZ6dCd9YC0mevE6lqMlsTYyJftLJkrbfZvh/cVhDjibYczH3SeaGGhPns//U030ZJw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712252087; c=relaxed/simple; bh=LROBprR8dKMFkyHgmaesSg7ro815O0EroKKVkZ9A2Fk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NV/4AjkTfUhCI2t42vFby/X4uuXn7/3D/duoNbA+0WNYFWyF0bZpDuu4CRtM/aBFXhJ3LxQ+dWig/1LI6W9ajo3Vy57UdMPnrNINyiX30ulToGdu98+xHxpmtAScVMtbtcVKfeUoNNnck7bao2O0LJbnKRuPC1LPuVpiX8g9fnI= 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=bkO3kZ+J; arc=fail smtp.client-ip=40.107.102.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="bkO3kZ+J" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d6oy4Zsqu4qdCCXyw7lIfsTYzhP4E8BaFccb2NxPKn3QVuA9pOz1/eUQV3Njm3ymo8xymPflV7Uts+TyVu7f0KBuTQdgERp6+utPnX9WquOdUDPhnXm44IDOdcZdNiyahJH76CH8xxZ42CpjcTska6xaRFU6s1im7+ZNfAkN0WjY+4wAbzDhdFA4R5wCHlpmcAFaVWMxBn7yqIByIVv+2IdDjt6csVrvvWjkJzCstmrXS6+jyHKc3PwwKxMg6Hod7If1juMH0jdVaLSj9wvmb2ZKOPM1wFwTYBXvgo5M6h3uhrpuX+rnch0YOLI+o7Tgzb+w5vtd7dV2xk8/IsF2vA== 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=kLkxbFEbAZPGnbRGASeheiMPIADWbQDzLpPCeQmFmrc=; b=OmR0rLhk53VOiwzwwbTPOkL9U9CxFcR4pPeeaXq1UXmcCkBvGwH3VlmLQBoGEHmir1w8jEnzo8QoruCPUvZzodiswupc2ScaeI+iEG/PVNNelpHMf9xdaIMj9AVwc7dr7zlYdcz4H2M+DU59b5w1YyOSZTAvglicoXl44m9JhrM8ypIjyOUa6SOljdljuRJttYcS1D6UJyKU4PAzTe2WX4xdg4cnq7gdVQbZ6Jvik7IVmtyQ27T19Od3PV39G4JnwQjgpsSOt5RBV6I5FSZAfVa2kjRxfL3B1hQ1yX2nxWDMNrrg4WIZAv0lqnIMfKOW5miOROoNFyXhmW0tTOoFcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net 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=kLkxbFEbAZPGnbRGASeheiMPIADWbQDzLpPCeQmFmrc=; b=bkO3kZ+JYcc0nfM9dQO1rcB9J6LlpmBt/MAh6SCLB9Tn8JSRonlDLb51QQKR1P2TegT0g571gTznrGREqpq9w3tgTpj6kKmo3UZ2SfP2Cj12MILnmVr9OOpqwqgJJZxfntyM4tAMLny7LuFA662hMyhtD8FC/yPxhGvZQd0ZNzqKSRrxNow7Lzy0+Z1ldazscCnjjytPbsg54XvZaTsnKzIxKe9WWs5N1nyd1vDBAnp8nTXpF/N47UZdvrSO0fZSfRYRGQqTv140YROCftcFmmj7+EF+CouzpPhRcjbVbhtVJHBRZGWPFbVMoHie6mq1BwXI5E2DDstgRAfVsWPC9Q== Received: from BLAPR03CA0174.namprd03.prod.outlook.com (2603:10b6:208:32f::11) by CH3PR12MB8482.namprd12.prod.outlook.com (2603:10b6:610:15b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Thu, 4 Apr 2024 17:34:39 +0000 Received: from BL6PEPF0001AB76.namprd02.prod.outlook.com (2603:10b6:208:32f:cafe::c1) by BLAPR03CA0174.outlook.office365.com (2603:10b6:208:32f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46 via Frontend Transport; Thu, 4 Apr 2024 17:34:38 +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 BL6PEPF0001AB76.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.7452.22 via Frontend Transport; Thu, 4 Apr 2024 17:34:38 +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.986.41; Thu, 4 Apr 2024 10:34:22 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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.1258.12; Thu, 4 Apr 2024 10:34:22 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Thu, 4 Apr 2024 10:34:19 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Cosmin Ratiu , Tariq Toukan Subject: [PATCH net-next 1/5] net/mlx5e: Extract checking of FEC support for a link mode Date: Thu, 4 Apr 2024 20:33:53 +0300 Message-ID: <20240404173357.123307-2-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404173357.123307-1-tariqt@nvidia.com> References: <20240404173357.123307-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB76:EE_|CH3PR12MB8482:EE_ X-MS-Office365-Filtering-Correlation-Id: 110ee02a-aca1-4e01-a447-08dc54cd80bd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VbfdCOj4COpa82vfniKV6GTIRgpL7p3m/ZorfDiiz3QeKxRcuBsTWC593TVe++UIPyYPhfWQgVjFTKnnUA4fIuR25/AOlKhrRZrJzmWsKv7LqrhoWXYP4XUFjG/bw3rc/gDqZtVjvzNQha68hRNLBWCBKVag1aNVw+cTbpZDiQH7VIafdG6TMEWNGrZ/JWY2yflZMu9PKXMTkCny7tzIMbv3Js/9cY+sNgOfHPhVn4zMMBqBPgfwAQpLbDRu6vCUOxnCgS2i3dwpq6yyiE76xwtjIvat/5RSB3YGyI6gS6ZgSviI4NPMnw9aJ0CFiUM1C/hb/PSVgsml7kuTaQJ2JLV5IzFGRbBsbpJDALIyRHlNOZZcRwjXBTOvN1HPBu7NnczEurPAgiCeGelJ3ATKKKhEahgfUCChVNbGRn2fbDxry8vQb3Qs3Cbqh3sHyb+z/cGdxlj+AR/zRq6rfzKKRxYuJpZcVLpUlxo6qRuy7t6spOHQH7BMqeO1vJgnXqPE7IOk9khOpNQ+/+Nm83jY389mjTovGdQUwOkiJYbtVjhJuK9TpmpYkWfiwlZmDyXQKYqJ6BsPU9EtnVSXitKjMuGCFfUqEX4VUjXaHeduXT/rQ81LDLUXqGnlcbLnKZiofB5E51OnJerjlYzlczxzforLiLyGd2nFoc9wi8vKdO5KOriBM8CPmKw7e2Hwjm6KRbGDm/f1VJToN7Hd61Y7uf9H+9MYL29xzGvOUgdkjd6fYf8fuCW/kDnE2bo7XI5d X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(1800799015)(376005)(82310400014)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2024 17:34:38.2677 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 110ee02a-aca1-4e01-a447-08dc54cd80bd 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: BL6PEPF0001AB76.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8482 X-Patchwork-Delegate: kuba@kernel.org From: Cosmin Ratiu The check of whether a given FEC mode is supported in a given link mode is about to get more complicated, so extract it in a separate function to avoid code duplication. Signed-off-by: Cosmin Ratiu Signed-off-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/en/port.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/port.c b/drivers/net/ethernet/mellanox/mlx5/core/en/port.c index dbe2b19a9570..b4681a93807d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/port.c @@ -308,6 +308,14 @@ enum mlx5e_fec_supported_link_mode { *_policy = MLX5_GET(pplm_reg, _buf, fec_override_admin_##link); \ } while (0) +/* Returns true if FEC can be set for a given link mode. */ +static bool mlx5e_is_fec_supported_link_mode(struct mlx5_core_dev *dev, + enum mlx5e_fec_supported_link_mode link_mode) +{ + return link_mode < MLX5E_FEC_FIRST_50G_PER_LANE_MODE || + MLX5_CAP_PCAM_FEATURE(dev, fec_50G_per_lane_in_pplm); +} + /* get/set FEC admin field for a given speed */ static int mlx5e_fec_admin_field(u32 *pplm, u16 *fec_policy, bool write, enum mlx5e_fec_supported_link_mode link_mode) @@ -389,7 +397,6 @@ static int mlx5e_get_fec_cap_field(u32 *pplm, u16 *fec_cap, bool mlx5e_fec_in_caps(struct mlx5_core_dev *dev, int fec_policy) { - bool fec_50g_per_lane = MLX5_CAP_PCAM_FEATURE(dev, fec_50G_per_lane_in_pplm); u32 out[MLX5_ST_SZ_DW(pplm_reg)] = {}; u32 in[MLX5_ST_SZ_DW(pplm_reg)] = {}; int sz = MLX5_ST_SZ_BYTES(pplm_reg); @@ -407,7 +414,7 @@ bool mlx5e_fec_in_caps(struct mlx5_core_dev *dev, int fec_policy) for (i = 0; i < MLX5E_MAX_FEC_SUPPORTED_LINK_MODE; i++) { u16 fec_caps; - if (i >= MLX5E_FEC_FIRST_50G_PER_LANE_MODE && !fec_50g_per_lane) + if (!mlx5e_is_fec_supported_link_mode(dev, i)) break; mlx5e_get_fec_cap_field(out, &fec_caps, i); @@ -420,7 +427,6 @@ bool mlx5e_fec_in_caps(struct mlx5_core_dev *dev, int fec_policy) int mlx5e_get_fec_mode(struct mlx5_core_dev *dev, u32 *fec_mode_active, u16 *fec_configured_mode) { - bool fec_50g_per_lane = MLX5_CAP_PCAM_FEATURE(dev, fec_50G_per_lane_in_pplm); u32 out[MLX5_ST_SZ_DW(pplm_reg)] = {}; u32 in[MLX5_ST_SZ_DW(pplm_reg)] = {}; int sz = MLX5_ST_SZ_BYTES(pplm_reg); @@ -445,7 +451,7 @@ int mlx5e_get_fec_mode(struct mlx5_core_dev *dev, u32 *fec_mode_active, *fec_configured_mode = 0; for (i = 0; i < MLX5E_MAX_FEC_SUPPORTED_LINK_MODE; i++) { - if (i >= MLX5E_FEC_FIRST_50G_PER_LANE_MODE && !fec_50g_per_lane) + if (!mlx5e_is_fec_supported_link_mode(dev, i)) break; mlx5e_fec_admin_field(out, fec_configured_mode, 0, i); @@ -489,7 +495,7 @@ int mlx5e_set_fec_mode(struct mlx5_core_dev *dev, u16 fec_policy) u16 conf_fec = fec_policy; u16 fec_caps = 0; - if (i >= MLX5E_FEC_FIRST_50G_PER_LANE_MODE && !fec_50g_per_lane) + if (!mlx5e_is_fec_supported_link_mode(dev, i)) break; /* RS fec in ethtool is mapped to MLX5E_FEC_RS_528_514 From patchwork Thu Apr 4 17:33:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13618095 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2066.outbound.protection.outlook.com [40.107.223.66]) (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 D245871734 for ; Thu, 4 Apr 2024 17:34:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712252092; cv=fail; b=hjQUOqpvr+ZS0wPjz6U+0helcMmcGs7OjSqKmOzQEhrqi9yYq3ls2HF/En19Ld4AjeeYjnzu0jY3lLjU7iTOV93IgEOmji1wYcjNNiBttu8fc+mfoGhK2mFTvIp33ZPsXqWyM+DNhHxQpNFA44bJv1oF7iHtZlo/erjBLmbJeCQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712252092; c=relaxed/simple; bh=bsV99rYDBlX2q1DrcvjmMJQxO5RX/cWTgF+kkhIi6ow=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WLNlJ5UktZzqIuWGa6VbMgVt7o1DQUcpySfGHtVVxjV+stdW3vP7bqxHo9H7wIV0cUNNjcY1bDtCSKRpuvAFMkqP/lh38F5jr3qyjWgf2yA4T3q2BzaRhnCC6xnyRrriyel0kfRxMinR0joVi6AmC+ds5R6DrERO8RtiHT7voys= 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=pG0dzBV3; arc=fail smtp.client-ip=40.107.223.66 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="pG0dzBV3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fu4aqsrDji6kHsO5IEOQrrhkpVp3ybL+pZ6Y/REoVYQQc+UpZ1hGVNzDT2SDlo4ujEvFxdYOQIXL8DWU24+EctfL4TKJUcS/yKnlYSQr1yDzU+smUuO8T4+8iKXGBP0ChNrJVUVfbYw156evnuwpUKxzB57vruZmhIxqbqISOf+fZpVt9+0W7iUF4cdJT6BjV/Bv35N0IqqOHN07imnaS3Y+2wRgkN9rqs77nHoi6X+9k0iRBtMChKcRubH7TlrhbLUGiDykd4OP0FEnekjCyIarSikfuDgR7aa9Oviz4wJQUqGFbHwb9qq8umL1r9a+VDq1vIxl/k3SqRox85Wqzw== 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=mKE98Uvc5xb9frwEMiGd7NhXIxeRWCA5bVYrAgRJv2c=; b=DoOO4JYz7nrxl1CnlLwp1JS2C00z9BSJwxYJcnjWLt9R0DbS2O7v5YmKt/ETMszf2mnDM09m+jQ9dEvTOmN3V8giizV5Aw8reZAo1a7IVb3ZfrUOoHOff/p+J8/Ba3LkcJrSSryCio4ADLHLwURK1I2I7KYQebEah8HL+dOOnSI/e6gxs63ntEM5gF8h0fgR3l5dxDduq0UEIlYVANe6VRJfpsM+hd7j2WTWaHlQWGItsXL4TjVK/cW7VV6YEW6QD0paWgeUo2q1yXlAstKwU57/0Ai7Nb88o6kvtwAy1mFbv4QnIgIXvDYeeHUxhHR4hkKe0qpdPcMxji0hvTF5ig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net 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=mKE98Uvc5xb9frwEMiGd7NhXIxeRWCA5bVYrAgRJv2c=; b=pG0dzBV3e+5fp/4BH4GPtYUKraNRy46lmH733y/U/nSd3okkUAUWvv7bo7nyMOuKWeZKvN/wpAb9ge1eLXeF9BJrqRKUI83dI/arVJhD/kxcd4Ztwr2InP+ARzClJvNzFqM5P+TaYuBp6OZxgMpdwCqM0xbLEk+T94V/R6i2ic1YVjIzO+SbpSge6t0U+O/ANL/2oVNezOKgr/di0ySQWQ6GGxn6LEF1hdvX7ACLnMfb2QREntpmo8M6MthPNwtzs+pIeZFzjj7qcZ2WubfDlDaJc19nH+D3eebcTX14hC9ZC2tsJeVLX1vvNuSQTJzpXK/S5vTVAyPIzT2TZoFgGg== Received: from MW2PR16CA0062.namprd16.prod.outlook.com (2603:10b6:907:1::39) by DM4PR12MB6181.namprd12.prod.outlook.com (2603:10b6:8:a9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Thu, 4 Apr 2024 17:34:41 +0000 Received: from MWH0EPF000A6730.namprd04.prod.outlook.com (2603:10b6:907:1:cafe::f7) by MW2PR16CA0062.outlook.office365.com (2603:10b6:907:1::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46 via Frontend Transport; Thu, 4 Apr 2024 17:34:41 +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 MWH0EPF000A6730.mail.protection.outlook.com (10.167.249.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Thu, 4 Apr 2024 17:34:40 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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.986.41; Thu, 4 Apr 2024 10:34:25 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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.1258.12; Thu, 4 Apr 2024 10:34:25 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Thu, 4 Apr 2024 10:34:22 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Cosmin Ratiu , Tariq Toukan Subject: [PATCH net-next 2/5] net/mlx5e: Support FEC settings for 100G/lane modes Date: Thu, 4 Apr 2024 20:33:54 +0300 Message-ID: <20240404173357.123307-3-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404173357.123307-1-tariqt@nvidia.com> References: <20240404173357.123307-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000A6730:EE_|DM4PR12MB6181:EE_ X-MS-Office365-Filtering-Correlation-Id: 7772bbc1-9b79-408b-70ff-08dc54cd8233 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b4Ind7iNQ02BMmW33BN4tKZX9BsbZ2oSZS+ZX0c7V3rNAAqyHFYLdhKq7S5ZqykmurHRxfOpF0Eglvfj9p+RNtsO/psVby+QUfsDNHFFaefYXqUkwLHAL6m96m+st+4bmRehceDFQ+QqGYwjybJl/QioAbEIIzff2LCpFz4bo+7qnt6mnzjoV0W8T7xBLY8vmWn/Ac3B2YiqiLMvLaxf8vGRQP34+7ndnTk/LlohqvZoGvjbccsVoE/CkVxLdv8actzyBKDe0KSSsYFL0OJ7fvF8mZI1wsgrFHKpssdRAh3bSYnFNpdOSNJsZg/Vc+CgkRw5/bORfj3V5vX1YpsjTNPk4dpri3iYoqu7qmsMLA4BrTiLTlIfG0kDRsiiViUhIaS7Ii/skCnwolzADldyn4cZqUfRW4+SqF+RpbFkK+ahmeMppd5naeSAwTa+q64LBH8dKOIITyG/XAkHMc/n8+kuU3xjlqCFQ+iXCaOcomGKHr/25XFKxPuc0QFEFzRbIF7OIuHh/dBb/TrFdp25XSCRR1/XnXDKb+3QB0dc7VnLGiAcNBNJfsiKYuGwdSdIwJ69Zc4BCTBvBEJ+c+dx1GKO7MopkFWyuqgZy2EBtVcdyZaphiXNL3FXjMuS6/Vw9AMms9mnD1FH1fTSZA1Kw/6B2RWzuS8E5whur8i2rl92I6iY44HK9F4TbZyNZiojz9E6rj6DnTjusW3OJVViknm+HRuSLS4oXxuCgY/t4Xy1S1v8YcoxG+BtmKYRTCt+ 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:(13230031)(1800799015)(376005)(82310400014)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2024 17:34:40.7643 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7772bbc1-9b79-408b-70ff-08dc54cd8233 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: MWH0EPF000A6730.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6181 X-Patchwork-Delegate: kuba@kernel.org From: Cosmin Ratiu This consists of: 1. Expose the 100G/lane capability bit in the PCAM reg. 2. Expose the per link mode FEC capability masks in the PPLM reg. 3. Set the overrides according to ethtool parameters. FEC for new modes is set if and only if the PCAM 100G/lane capability is advertised and the capability mask for a given link mode reports that it can accept the requested FEC mode. Signed-off-by: Cosmin Ratiu Reviewed-by: Gal Pressman Signed-off-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/en/port.c | 36 +++++++++++++++++-- include/linux/mlx5/mlx5_ifc.h | 20 +++++++++-- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/port.c b/drivers/net/ethernet/mellanox/mlx5/core/en/port.c index b4681a93807d..b4efc780e297 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/port.c @@ -292,10 +292,15 @@ enum mlx5e_fec_supported_link_mode { MLX5E_FEC_SUPPORTED_LINK_MODE_100G_2X, MLX5E_FEC_SUPPORTED_LINK_MODE_200G_4X, MLX5E_FEC_SUPPORTED_LINK_MODE_400G_8X, + MLX5E_FEC_SUPPORTED_LINK_MODE_100G_1X, + MLX5E_FEC_SUPPORTED_LINK_MODE_200G_2X, + MLX5E_FEC_SUPPORTED_LINK_MODE_400G_4X, + MLX5E_FEC_SUPPORTED_LINK_MODE_800G_8X, MLX5E_MAX_FEC_SUPPORTED_LINK_MODE, }; #define MLX5E_FEC_FIRST_50G_PER_LANE_MODE MLX5E_FEC_SUPPORTED_LINK_MODE_50G_1X +#define MLX5E_FEC_FIRST_100G_PER_LANE_MODE MLX5E_FEC_SUPPORTED_LINK_MODE_100G_1X #define MLX5E_FEC_OVERRIDE_ADMIN_POLICY(buf, policy, write, link) \ do { \ @@ -313,7 +318,10 @@ static bool mlx5e_is_fec_supported_link_mode(struct mlx5_core_dev *dev, enum mlx5e_fec_supported_link_mode link_mode) { return link_mode < MLX5E_FEC_FIRST_50G_PER_LANE_MODE || - MLX5_CAP_PCAM_FEATURE(dev, fec_50G_per_lane_in_pplm); + (link_mode < MLX5E_FEC_FIRST_100G_PER_LANE_MODE && + MLX5_CAP_PCAM_FEATURE(dev, fec_50G_per_lane_in_pplm)) || + (link_mode >= MLX5E_FEC_FIRST_100G_PER_LANE_MODE && + MLX5_CAP_PCAM_FEATURE(dev, fec_100G_per_lane_in_pplm)); } /* get/set FEC admin field for a given speed */ @@ -348,6 +356,18 @@ static int mlx5e_fec_admin_field(u32 *pplm, u16 *fec_policy, bool write, case MLX5E_FEC_SUPPORTED_LINK_MODE_400G_8X: MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 400g_8x); break; + case MLX5E_FEC_SUPPORTED_LINK_MODE_100G_1X: + MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 100g_1x); + break; + case MLX5E_FEC_SUPPORTED_LINK_MODE_200G_2X: + MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 200g_2x); + break; + case MLX5E_FEC_SUPPORTED_LINK_MODE_400G_4X: + MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 400g_4x); + break; + case MLX5E_FEC_SUPPORTED_LINK_MODE_800G_8X: + MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 800g_8x); + break; default: return -EINVAL; } @@ -389,6 +409,18 @@ static int mlx5e_get_fec_cap_field(u32 *pplm, u16 *fec_cap, case MLX5E_FEC_SUPPORTED_LINK_MODE_400G_8X: *fec_cap = MLX5E_GET_FEC_OVERRIDE_CAP(pplm, 400g_8x); break; + case MLX5E_FEC_SUPPORTED_LINK_MODE_100G_1X: + *fec_cap = MLX5E_GET_FEC_OVERRIDE_CAP(pplm, 100g_1x); + break; + case MLX5E_FEC_SUPPORTED_LINK_MODE_200G_2X: + *fec_cap = MLX5E_GET_FEC_OVERRIDE_CAP(pplm, 200g_2x); + break; + case MLX5E_FEC_SUPPORTED_LINK_MODE_400G_4X: + *fec_cap = MLX5E_GET_FEC_OVERRIDE_CAP(pplm, 400g_4x); + break; + case MLX5E_FEC_SUPPORTED_LINK_MODE_800G_8X: + *fec_cap = MLX5E_GET_FEC_OVERRIDE_CAP(pplm, 800g_8x); + break; default: return -EINVAL; } @@ -501,7 +533,7 @@ int mlx5e_set_fec_mode(struct mlx5_core_dev *dev, u16 fec_policy) /* RS fec in ethtool is mapped to MLX5E_FEC_RS_528_514 * to link modes up to 25G per lane and to * MLX5E_FEC_RS_544_514 in the new link modes based on - * 50 G per lane + * 50G or 100G per lane */ if (conf_fec == (1 << MLX5E_FEC_RS_528_514) && i >= MLX5E_FEC_FIRST_50G_PER_LANE_MODE) diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index cc159d8563d1..35ffc9b9f241 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -9817,7 +9817,21 @@ struct mlx5_ifc_pplm_reg_bits { u8 fec_override_admin_100g_2x[0x10]; u8 fec_override_admin_50g_1x[0x10]; - u8 reserved_at_140[0x140]; + u8 fec_override_cap_800g_8x[0x10]; + u8 fec_override_cap_400g_4x[0x10]; + + u8 fec_override_cap_200g_2x[0x10]; + u8 fec_override_cap_100g_1x[0x10]; + + u8 reserved_at_180[0xa0]; + + u8 fec_override_admin_800g_8x[0x10]; + u8 fec_override_admin_400g_4x[0x10]; + + u8 fec_override_admin_200g_2x[0x10]; + u8 fec_override_admin_100g_1x[0x10]; + + u8 reserved_at_260[0x20]; }; struct mlx5_ifc_ppcnt_reg_bits { @@ -10189,7 +10203,9 @@ struct mlx5_ifc_mtutc_reg_bits { }; struct mlx5_ifc_pcam_enhanced_features_bits { - u8 reserved_at_0[0x68]; + u8 reserved_at_0[0x48]; + u8 fec_100G_per_lane_in_pplm[0x1]; + u8 reserved_at_49[0x1f]; u8 fec_50G_per_lane_in_pplm[0x1]; u8 reserved_at_69[0x4]; u8 rx_icrc_encapsulated_counter[0x1]; From patchwork Thu Apr 4 17:33:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13618096 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2073.outbound.protection.outlook.com [40.107.244.73]) (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 DA17F12D770 for ; Thu, 4 Apr 2024 17:34:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712252093; cv=fail; b=Aeod+ReJkI3/c3mSaGubV9+Hr2TikMaXo0yvetWDlqmEVOHOX6ZN7EuexVnOL01G0nSt+IZ+H8632RFEEyIqW1Ec/dhZHsOArK/ybig+aJhppZ0xtC171jCJhc87zX/Z6AwngUkMRIC3pDe8f1pNqpEEaRuQnJ0BxxEk1paOP3I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712252093; c=relaxed/simple; bh=k2b6tNatk1khfG9R5hiSGpUjQtc3+9YWFEMxK1IdJug=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uKxrXmo4yEmuoono2j2HHn2Rrn6R5SIu4hkrcNRirR6pixj69DTUXbciFmqs488Joi5sL9VncgqD6X3/Nr3l+cHuRe7Na08Cv4SvsplX0QzWx0IA4kViPfCzBN0jDjHdo5uJXXCXcEAGbjtez6s61HoHi1IusZjNG9XNpvdAk9M= 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=e0u+JQhQ; arc=fail smtp.client-ip=40.107.244.73 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="e0u+JQhQ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eHlMxix2ldqXeSppcZdN0gxkHu7modI+eb041gro9fj55zkKYeVcLENhE/km2uFhQ0WO3FbkKmfsTZchJ3m9xkz05b/2OtO2EEu3ZCrB/7pi8OyX0w+bAqLLADJWVsik5aOKE/jaqcKykD2MGKtv5H1WwkYBuD5N0Nwy+Bt81kb8LUR5K/E3akYeCLc8B0rgBy0WgMNdw6htP/7VJGBiRJU1XkMLn5jMIGfisA8JXEqNUlLCTMkDahzmxJrKZHcs2l75MEyeLDexXVuPPoVSFaR+jPQqHmt/i/+jNybwvezunSdiRfq8iMXMq3kV9rQJpm52E89GmLuN7u6TX8kEEw== 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=AgceVM/qabZD6BUpvx+R2IoVFz66r4YZCI4pa293OE8=; b=Z2COwpST2ygGdMrwGljviHQD0jNrWFHkE3Knn4SjT3Bo21OSfp2oAqRdU4RduMtYAaw+UtItdxq/tQDB+0ik9EvQ/3I2ijeQASxuD6CSSDQSc3uWkiWsLMgY8E0zGI9PjxqaRI6Oc0XhacdUOwA+QFlIL7ydSPzjVab6/A+knHiERJ/HmgVS4PwtBIRzO2r8t77UCCGJ6oSx1i9jNXVmDd1qKPvgfLuuvwyvM8WYbOo+HxZV99ZIGUuEzoKgI6ZiSc+4oNcIujnKNE0zTtwUyTdOQNSyfzTwOgCr1Bs/o3WNKILXyiuRBO6MnWe4v/RGQgB3ndfAx/Pl6lbUOve5dg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net 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=AgceVM/qabZD6BUpvx+R2IoVFz66r4YZCI4pa293OE8=; b=e0u+JQhQPnh66fb8d9nOlqOb3/8ssrBCC9Goi6mGPAUT/BKROohCzpH8ydN2/ZRg9248/RjpAHgRhtSmvodc3Q0e0DfUAYjWvejhOGZIEP7EUBdLGZ6uMet5evB+5fCxxLIZD6/+d8T9meq7CfYT8rNoVrMpfG1R1wQKe7MIU9Gst2vr1vFV0vmwKJxoWYPC6lgrJTfCQsupT3KBf4KA6CFy2CIqilrez+iZ3Rh1TiH8AWm2/JokvB7tMxK2WlujhZ/GRYDcytj+S003g+jCyEoDva7RiS8JO8RlHjqkD6cEHmsLcE7nD/k/W4bbX8b9myAYUSWcvqRPibq172brmA== Received: from SJ0PR13CA0002.namprd13.prod.outlook.com (2603:10b6:a03:2c0::7) by DS0PR12MB6390.namprd12.prod.outlook.com (2603:10b6:8:ce::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Thu, 4 Apr 2024 17:34:46 +0000 Received: from MWH0EPF000A6734.namprd04.prod.outlook.com (2603:10b6:a03:2c0:cafe::a7) by SJ0PR13CA0002.outlook.office365.com (2603:10b6:a03:2c0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.10 via Frontend Transport; Thu, 4 Apr 2024 17:34:46 +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 MWH0EPF000A6734.mail.protection.outlook.com (10.167.249.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Thu, 4 Apr 2024 17:34:45 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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.986.41; Thu, 4 Apr 2024 10:34:29 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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.1258.12; Thu, 4 Apr 2024 10:34:28 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Thu, 4 Apr 2024 10:34:25 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Carolina Jubran , Rahul Rameshbabu , Tariq Toukan Subject: [PATCH net-next 3/5] ethtool: add interface to read representor Rx statistics Date: Thu, 4 Apr 2024 20:33:55 +0300 Message-ID: <20240404173357.123307-4-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404173357.123307-1-tariqt@nvidia.com> References: <20240404173357.123307-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000A6734:EE_|DS0PR12MB6390:EE_ X-MS-Office365-Filtering-Correlation-Id: 76edcfdd-853c-40c6-6add-08dc54cd851a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rwwBqydmHKU0/YtKWsnCyuv0eooSD7Fyv5deOc5olVEH+K4GdHjL79J3WHBbC5uq+SUjDL/+TwTzcKxPG0eIJ3R92wXTS4il6FdN/MuhRu+VP/JHLDSsWVccfb9dZSWCH30oXY6g37lTujmMFMZLzkBW5AQII4XbjwBoDrJJdHmXPgmj/Ivn/3/VnvxUf1nQla6eW8eFU2t+5kay963gJ0gbVYnzctUbVqCEw+csDgjy1GbGajinXz8s3H9IMYY6Zw+2Wx40lXHM+OXYKTDwzrLbnVeDG5Xp0kkRwOuiIfZTGD112/fnqNjbuY6S6c6xLem/Arw2gE6jLVIPIGsIrK+jOPgkDU3+b5HLsxwqdsqs/lQgDoqARl4VLR5VSRnNP1ewgItZ/fQMZsxZ03BDvR9B2zj1pdK7g5E2KwolgbtN5Om80qf6NQ5AXbJDMK4nO3YA8AbEj869wZgJ8ky/KKthVZkxiSI0Jk6Hh3paUzFb5kzgiw72HZNTMqfAIcTunOknngu7WbIoBib5+CP5/thwsAifFIXeAbOt93EVTKcR/NmrPCaBuqJGEleiOwD5E4dGo6X/g5l6tYnfP2Qs5wdCP5sMRnYgvN4OvRkn3EJaWu/nE/pYTzPTd8mlLCrQGCAwuuHk2mh0CgJkG3rKac0lNynbLnKzb3sPUksvg9R6Zn0IlNo0QdCcT28qLjzKKzwg6bRS5raK2CljabNTQhAXpdM9WjWo1nXVFhvpka/2ja/O/kT0vl78JoiwmcCR 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:(13230031)(36860700004)(82310400014)(376005)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2024 17:34:45.6491 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 76edcfdd-853c-40c6-6add-08dc54cd851a 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: MWH0EPF000A6734.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6390 X-Patchwork-Delegate: kuba@kernel.org From: Carolina Jubran Implement common representor port statistics in a rep_port_stats struct_group, introducing a new 'out of buffer' stats for when packets are dropped due to a lack of receive buffers in RX queue. The port statistics represent the statistics of the function with which the representor is associated. Print the representor port stats when the --groups rep-port or --all-groups are used. Signed-off-by: Carolina Jubran Reviewed-by: Rahul Rameshbabu Signed-off-by: Tariq Toukan --- include/linux/ethtool.h | 16 ++++++++++++++ include/uapi/linux/ethtool.h | 2 ++ include/uapi/linux/ethtool_netlink.h | 10 +++++++++ net/ethtool/netlink.h | 1 + net/ethtool/stats.c | 31 ++++++++++++++++++++++++++++ net/ethtool/strset.c | 5 +++++ 6 files changed, 65 insertions(+) diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 9901e563f706..6f2a6c78d41d 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -480,6 +480,17 @@ struct ethtool_rmon_stats { ); }; +/** + * struct ethtool_rep_port_stats - representor port statistics + * @rep_port_stats: struct group for representor port + * @out_of_buf: Number of packets were dropped due to buffer exhaustion. + */ +struct ethtool_rep_port_stats { + struct_group(rep_port_stats, + u64 out_of_buf; + ); +}; + #define ETH_MODULE_EEPROM_PAGE_LEN 128 #define ETH_MODULE_MAX_I2C_ADDRESS 0x7f @@ -804,6 +815,8 @@ struct ethtool_rxfh_param { * @get_eth_ctrl_stats: Query some of the IEEE 802.3 MAC Ctrl statistics. * @get_rmon_stats: Query some of the RMON (RFC 2819) statistics. * Set %ranges to a pointer to zero-terminated array of byte ranges. + * @get_rep_port_stats: Query the representor port statistics. + * Returns zero on success. * @get_module_power_mode: Get the power mode policy for the plug-in module * used by the network device and its operational power mode, if * plugged-in. @@ -940,6 +953,9 @@ struct ethtool_ops { void (*get_rmon_stats)(struct net_device *dev, struct ethtool_rmon_stats *rmon_stats, const struct ethtool_rmon_hist_range **ranges); + int (*get_rep_port_stats)(struct net_device *dev, + struct ethtool_rep_port_stats *rep_port_stats, + struct netlink_ext_ack *extack); int (*get_module_power_mode)(struct net_device *dev, struct ethtool_module_power_mode_params *params, struct netlink_ext_ack *extack); diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h index 11fc18988bc2..a3bc96e7e958 100644 --- a/include/uapi/linux/ethtool.h +++ b/include/uapi/linux/ethtool.h @@ -681,6 +681,7 @@ enum ethtool_link_ext_substate_module { * @ETH_SS_STATS_ETH_MAC: names of IEEE 802.3 MAC statistics * @ETH_SS_STATS_ETH_CTRL: names of IEEE 802.3 MAC Control statistics * @ETH_SS_STATS_RMON: names of RMON statistics + * @ETH_SS_STATS_REP_PORT: names of representor port statistics * * @ETH_SS_COUNT: number of defined string sets */ @@ -706,6 +707,7 @@ enum ethtool_stringset { ETH_SS_STATS_ETH_MAC, ETH_SS_STATS_ETH_CTRL, ETH_SS_STATS_RMON, + ETH_SS_STATS_REP_PORT, /* add new constants above here */ ETH_SS_COUNT diff --git a/include/uapi/linux/ethtool_netlink.h b/include/uapi/linux/ethtool_netlink.h index accbb1a231df..0257103a001a 100644 --- a/include/uapi/linux/ethtool_netlink.h +++ b/include/uapi/linux/ethtool_netlink.h @@ -764,6 +764,7 @@ enum { ETHTOOL_STATS_ETH_MAC, ETHTOOL_STATS_ETH_CTRL, ETHTOOL_STATS_RMON, + ETHTOOL_STATS_REP_PORT, /* add new constants above here */ __ETHTOOL_STATS_CNT @@ -879,6 +880,15 @@ enum { ETHTOOL_A_STATS_RMON_MAX = (__ETHTOOL_A_STATS_RMON_CNT - 1) }; +enum { + /* out_of_buf */ + ETHTOOL_A_STATS_REP_PORT_OUT_OF_BUF, + + /* add new constants above here */ + __ETHTOOL_A_STATS_REP_PORT_CNT, + ETHTOOL_A_STATS_REP_PORT_MAX = (__ETHTOOL_A_STATS_REP_PORT_CNT - 1) +}; + /* MODULE */ enum { diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h index 9a333a8d04c1..f1568fa788f2 100644 --- a/net/ethtool/netlink.h +++ b/net/ethtool/netlink.h @@ -454,5 +454,6 @@ extern const char stats_eth_phy_names[__ETHTOOL_A_STATS_ETH_PHY_CNT][ETH_GSTRING extern const char stats_eth_mac_names[__ETHTOOL_A_STATS_ETH_MAC_CNT][ETH_GSTRING_LEN]; extern const char stats_eth_ctrl_names[__ETHTOOL_A_STATS_ETH_CTRL_CNT][ETH_GSTRING_LEN]; extern const char stats_rmon_names[__ETHTOOL_A_STATS_RMON_CNT][ETH_GSTRING_LEN]; +extern const char stats_rep_port_names[__ETHTOOL_A_STATS_REP_PORT_CNT][ETH_GSTRING_LEN]; #endif /* _NET_ETHTOOL_NETLINK_H */ diff --git a/net/ethtool/stats.c b/net/ethtool/stats.c index 912f0c4fff2f..84b05d9a2fc1 100644 --- a/net/ethtool/stats.c +++ b/net/ethtool/stats.c @@ -20,6 +20,7 @@ struct stats_reply_data { struct ethtool_eth_mac_stats mac_stats; struct ethtool_eth_ctrl_stats ctrl_stats; struct ethtool_rmon_stats rmon_stats; + struct ethtool_rep_port_stats rep_port_stats; ); const struct ethtool_rmon_hist_range *rmon_ranges; }; @@ -32,6 +33,7 @@ const char stats_std_names[__ETHTOOL_STATS_CNT][ETH_GSTRING_LEN] = { [ETHTOOL_STATS_ETH_MAC] = "eth-mac", [ETHTOOL_STATS_ETH_CTRL] = "eth-ctrl", [ETHTOOL_STATS_RMON] = "rmon", + [ETHTOOL_STATS_REP_PORT] = "rep-port", }; const char stats_eth_phy_names[__ETHTOOL_A_STATS_ETH_PHY_CNT][ETH_GSTRING_LEN] = { @@ -76,6 +78,10 @@ const char stats_rmon_names[__ETHTOOL_A_STATS_RMON_CNT][ETH_GSTRING_LEN] = { [ETHTOOL_A_STATS_RMON_JABBER] = "etherStatsJabbers", }; +const char stats_rep_port_names[__ETHTOOL_A_STATS_REP_PORT_CNT][ETH_GSTRING_LEN] = { + [ETHTOOL_A_STATS_REP_PORT_OUT_OF_BUF] = "out_of_buf", +}; + const struct nla_policy ethnl_stats_get_policy[ETHTOOL_A_STATS_SRC + 1] = { [ETHTOOL_A_STATS_HEADER] = NLA_POLICY_NESTED(ethnl_header_policy), @@ -158,6 +164,15 @@ static int stats_prepare_data(const struct ethnl_req_info *req_base, dev->ethtool_ops->get_rmon_stats) dev->ethtool_ops->get_rmon_stats(dev, &data->rmon_stats, &data->rmon_ranges); + if (test_bit(ETHTOOL_STATS_REP_PORT, req_info->stat_mask) && + dev->ethtool_ops->get_rep_port_stats) { + ret = dev->ethtool_ops->get_rep_port_stats(dev, &data->rep_port_stats, + info->extack); + if (ret) { + ethnl_ops_complete(dev); + return ret; + } + } ethnl_ops_complete(dev); return 0; @@ -194,6 +209,10 @@ static int stats_reply_size(const struct ethnl_req_info *req_base, nla_total_size(4)) * /* _A_STATS_GRP_HIST_BKT_HI */ ETHTOOL_RMON_HIST_MAX * 2; } + if (test_bit(ETHTOOL_STATS_REP_PORT, req_info->stat_mask)) { + n_stats += sizeof(struct ethtool_rep_port_stats) / sizeof(u64); + n_grps++; + } len += n_grps * (nla_total_size(0) + /* _A_STATS_GRP */ nla_total_size(4) + /* _A_STATS_GRP_ID */ @@ -370,6 +389,15 @@ static int stats_put_rmon_stats(struct sk_buff *skb, return 0; } +static int stats_put_rep_port_stats(struct sk_buff *skb, + const struct stats_reply_data *data) +{ + if (stat_put(skb, ETHTOOL_A_STATS_REP_PORT_OUT_OF_BUF, data->rep_port_stats.out_of_buf)) + return -EMSGSIZE; + + return 0; +} + static int stats_put_stats(struct sk_buff *skb, const struct stats_reply_data *data, u32 id, u32 ss_id, @@ -423,6 +451,9 @@ static int stats_fill_reply(struct sk_buff *skb, if (!ret && test_bit(ETHTOOL_STATS_RMON, req_info->stat_mask)) ret = stats_put_stats(skb, data, ETHTOOL_STATS_RMON, ETH_SS_STATS_RMON, stats_put_rmon_stats); + if (!ret && test_bit(ETHTOOL_STATS_REP_PORT, req_info->stat_mask)) + ret = stats_put_stats(skb, data, ETHTOOL_STATS_REP_PORT, + ETH_SS_STATS_REP_PORT, stats_put_rep_port_stats); return ret; } diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c index c678b484a079..01d7a6fd9471 100644 --- a/net/ethtool/strset.c +++ b/net/ethtool/strset.c @@ -105,6 +105,11 @@ static const struct strset_info info_template[] = { .count = __ETHTOOL_A_STATS_RMON_CNT, .strings = stats_rmon_names, }, + [ETH_SS_STATS_REP_PORT] = { + .per_dev = false, + .count = __ETHTOOL_A_STATS_REP_PORT_CNT, + .strings = stats_rep_port_names, + }, }; struct strset_req_info { From patchwork Thu Apr 4 17:33:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13618097 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2056.outbound.protection.outlook.com [40.107.93.56]) (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 030B11C6A0 for ; Thu, 4 Apr 2024 17:34:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712252095; cv=fail; b=FKf1P5Bg+TVgq/jTWtV1nF1YsXdvDyIdvSJ8SQ1ZYqzUB5SFtPv3oONIND0UkoCk22zeSafFAALsE2fMHMP97Z+yOvOiaMFR0KxSJYg8yVF91g7Rpnk+zHRYHFPn/lE8FPe7J6BboJLf73PSexDXlR5NG3EcGmFMajZI0vwD5BA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712252095; c=relaxed/simple; bh=o2kysldD0/K8/RGzUl/ACVbJO1ROuSgwEwyD9UDg8+g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Jp467i6R/fjlEI8Icvk0xQnTJkGiThHbe0Qs8MIBwAXWp2ylGWxSFnxAogkPK4RIYFDvjl4KnFlY0PC0w6IZ7AECWqxLQ/FqYcrjgQE/plYKsRhFC+Ml3Hi8P/b1ysvfY5MGKLDYvakogjz5rBZRwoglHt0pvkH+URDHEkFU+8I= 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=X1Yk/8YP; arc=fail smtp.client-ip=40.107.93.56 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="X1Yk/8YP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UJG3mE3jU/OJETyFTRyK4FeBH1bL9U+zv8gsfH17AR2/wv7ZiHDF2VEYZt/wu41wZiHeVlU3JH8FvhhbV2h5u3dPUrrfwjTLNUYAEE+1C5fAty2430vXT7IVfEPn3XJeznsOs2Sib2vGqcpraJajHLNkfeeqck1BIA9BG9DCwiIZOdsuUS36hhdgC+f+MUqgaJ63Elq3/tWngakjEzeXsIP/5BzPpKUceDo1rUvpALJlYHFRdMbpHjet2OuUKI2VoyeWZSY45aGV0+P16ZxBG9C+CANPUIa2B3YlTzPtHyqi3Mzj83QB+5Tgu3HGfhkzlSOwWlsA+MECaiBG7+cNRQ== 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=6WmTCVSqjJtpC6zJQ0mGkeBixFzdDt5MFcokh/3UR+Y=; b=Nk4R98l8JuY2P5d0foB8cvieg1+etEbhjbIP5Aa94EIbx/hn1vo0c9pGkD1NKVHao7+bF1cbSrRFlWj3aj1zJl1bBcl8cjSD8VE/p7lduptqvB17OVYYA82aiai/aW3xSDqMGCWgWg6blI8ArDFVjhXxxcJ4OPAYPtanzfPPFtmLQXm04C0a5Z8VbHH5nRjNEyVtzaREUJ6YWA/F9acZeFCtHKDgXzkAApEW1Z6+SLQqPln0k89FxZ1QX4iq0+YD+RdmmRDSNvdnFP6jGHT3b/qiCs5x1NNLcBZiToZy28diX9Agyn69UkGxIyvZrX61iNuEQc7cxPaKWbKS9GhIsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net 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=6WmTCVSqjJtpC6zJQ0mGkeBixFzdDt5MFcokh/3UR+Y=; b=X1Yk/8YPRLbVSnneGxtQg412GdcVFSD4yTOTlfjtbDVK5JOdS1s2eGOhUBrTJm0DKFpzmBSz5w0p/bbySHq5Z64a7ZDEKzEB+mfiw40vkE6APtjbmBNyoNdCnSQpO0RelD512zSKnqUF3G+0YSXX0+hA0DY1pc/PqrFSJ7qSWsHZj+0a2n4DXyaET1lo5SX70l680RWXVSImSHMvsymIhp/kLR6xDLmpbcczu+0ttsmWnIjbsPBqQVSRvgkaTqwW/I0jVLxqW77DNTr/aAyIDUz+LAc6M8gzsPOJnNJ+j3TpklV2nJQ21xHBPbEDfV13klpMM4RK6LrfktMn8YwZEQ== Received: from MN2PR03CA0015.namprd03.prod.outlook.com (2603:10b6:208:23a::20) by SA1PR12MB6893.namprd12.prod.outlook.com (2603:10b6:806:24c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Thu, 4 Apr 2024 17:34:50 +0000 Received: from BL6PEPF0001AB73.namprd02.prod.outlook.com (2603:10b6:208:23a:cafe::f4) by MN2PR03CA0015.outlook.office365.com (2603:10b6:208:23a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46 via Frontend Transport; Thu, 4 Apr 2024 17:34:50 +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 BL6PEPF0001AB73.mail.protection.outlook.com (10.167.242.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Thu, 4 Apr 2024 17:34:49 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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.986.41; Thu, 4 Apr 2024 10:34:32 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Thu, 4 Apr 2024 10:34:32 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Thu, 4 Apr 2024 10:34:29 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Carolina Jubran , Rahul Rameshbabu , Tariq Toukan Subject: [PATCH net-next 4/5] net/mlx5e: Expose the VF/SF RX drop counter on the representor Date: Thu, 4 Apr 2024 20:33:56 +0300 Message-ID: <20240404173357.123307-5-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404173357.123307-1-tariqt@nvidia.com> References: <20240404173357.123307-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB73:EE_|SA1PR12MB6893:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ac00fd4-cbbe-4d7f-53d5-08dc54cd8780 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PblrL0QLQuR8kWl9lagwf+tSY0BjYJxgNEQgFrAUmRtOhU9NnVXsm/DCTM5bg9D/HWguPWcItU3NiDgJ36d5l84VoGRdmSKsAetZi0qoJ5IRQ5cfVpYc7EYR+bfTmpLffWUs0GgtQnpkqmZmWGKWU5MdSU69Jhi6wsWtA4NTfr2LNkZJ+6ilodndor1ry1xsCPxcFINWbjHVnyB23VN/fn6g0q+VZBkwAqUt+9WtahKixFNh/0ozfDkYOAIWstPnA3Rc0/0L3nBYA/KmlhTvN0D1iiZklBNQdL7DIJp1LlCKqY4yOV0KW20ehgE9bNDM2wNBl9EO2RLBzvZ3flHEX5QdEW6KypW59YQtDR4y1/Rrk5ucN7yWOeZVOLw1jJQ2p634Jx4ZdraVgOIngRoOhZTrds29+qqnP4W5JRN5HkA7DIaL09cty1856XCJFBnCsezYNWCu3H00Leb115py3p8ALIJRZp6VoTkUM63NmySw85dHCykygr4NQbAthit7/QK3yJeMs9ppEVLJ9ftUhVyWXHSpUiF2vEJf/taOqwUzjgGFHpaLLnniAyaVd7DcwhBqeb7FKXjKerSzyka84tzmyVSh5HyJSID+6Lj6BItmzfmrkcHY87y9mdkMHZSayJZD8+hYvWMbaYqnFXAotGwp1/DF82IgUENAszy/3J/RGsVSs3g9qIEdaACdhoJLg1L8yT/uUGjzJMPm0oIJoJrqc2Lu3Th/Npwm9ylxnXmfqd2qnSFwXMKy/xy/tu// X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(36860700004)(82310400014)(376005)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2024 17:34:49.6099 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6ac00fd4-cbbe-4d7f-53d5-08dc54cd8780 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: BL6PEPF0001AB73.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6893 X-Patchwork-Delegate: kuba@kernel.org From: Carolina Jubran Q counters are device-level counters that track specific events, among which are out_of_buffer events. These events occur when packets are dropped due to a lack of receive buffer in the RX queue. Expose the total number of rx_out_of_buffer events on the VF/SF to their respective representor, using the "ethtool -S devname --all-groups|--groups rep-port" under the name of "rep-port-out_of_buf". The "rep-port-out_of_buf" equals the sum of all Q counters rx_out_of_buffer values allocated on the VF/SF. Signed-off-by: Carolina Jubran Reviewed-by: Rahul Rameshbabu Signed-off-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/en_rep.c | 48 +++++++++++++++++++ .../ethernet/mellanox/mlx5/core/en_stats.h | 3 ++ 2 files changed, 51 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index a74ee698671c..691f6d7fe0c6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -273,6 +273,44 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport_rep) kvfree(out); } +static int mlx5e_rep_query_q_counter(struct mlx5_core_dev *mdev, int vport, void *out) +{ + u32 in[MLX5_ST_SZ_DW(query_q_counter_in)] = {}; + + MLX5_SET(query_q_counter_in, in, opcode, MLX5_CMD_OP_QUERY_Q_COUNTER); + MLX5_SET(query_q_counter_in, in, other_vport, 1); + MLX5_SET(query_q_counter_in, in, vport_number, vport); + MLX5_SET(query_q_counter_in, in, aggregate, 1); + + return mlx5_cmd_exec_inout(mdev, query_q_counter, in, out); +} + +int mlx5e_stats_rep_port_get(struct mlx5e_priv *priv, + struct ethtool_rep_port_stats *rep_port_stats, + struct netlink_ext_ack *extack) +{ + u32 out[MLX5_ST_SZ_DW(query_q_counter_out)] = {}; + struct mlx5e_rep_priv *rpriv = priv->ppriv; + struct mlx5_eswitch_rep *rep = rpriv->rep; + int err; + + if (!MLX5_CAP_GEN(priv->mdev, q_counter_other_vport) || + !MLX5_CAP_GEN(priv->mdev, q_counter_aggregation)) { + NL_SET_ERR_MSG_MOD(extack, + "Representor port stats is not supported on this device"); + return -EOPNOTSUPP; + } + + err = mlx5e_rep_query_q_counter(priv->mdev, rep->vport, out); + if (err) { + NL_SET_ERR_MSG_MOD(extack, "Failed reading stats on vport"); + return err; + } + rep_port_stats->out_of_buf = MLX5_GET(query_q_counter_out, out, out_of_buffer); + + return 0; +} + static void mlx5e_rep_get_strings(struct net_device *dev, u32 stringset, u8 *data) { @@ -377,6 +415,15 @@ static u32 mlx5e_rep_get_rxfh_indir_size(struct net_device *netdev) return mlx5e_ethtool_get_rxfh_indir_size(priv); } +static int mlx5e_rep_get_port_stats(struct net_device *netdev, + struct ethtool_rep_port_stats *rep_port_stats, + struct netlink_ext_ack *extack) +{ + struct mlx5e_priv *priv = netdev_priv(netdev); + + return mlx5e_stats_rep_port_get(priv, rep_port_stats, extack); +} + static const struct ethtool_ops mlx5e_rep_ethtool_ops = { .supported_coalesce_params = ETHTOOL_COALESCE_USECS | ETHTOOL_COALESCE_MAX_FRAMES | @@ -394,6 +441,7 @@ static const struct ethtool_ops mlx5e_rep_ethtool_ops = { .set_coalesce = mlx5e_rep_set_coalesce, .get_rxfh_key_size = mlx5e_rep_get_rxfh_key_size, .get_rxfh_indir_size = mlx5e_rep_get_rxfh_indir_size, + .get_rep_port_stats = mlx5e_rep_get_port_stats, }; static void mlx5e_sqs2vport_stop(struct mlx5_eswitch *esw, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h index b71e3fdf92c5..ffddbe4d6543 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h @@ -128,6 +128,9 @@ void mlx5e_stats_eth_ctrl_get(struct mlx5e_priv *priv, void mlx5e_stats_rmon_get(struct mlx5e_priv *priv, struct ethtool_rmon_stats *rmon, const struct ethtool_rmon_hist_range **ranges); +int mlx5e_stats_rep_port_get(struct mlx5e_priv *priv, + struct ethtool_rep_port_stats *rep_port_stats, + struct netlink_ext_ack *extack); void mlx5e_get_link_ext_stats(struct net_device *dev, struct ethtool_link_ext_stats *stats); From patchwork Thu Apr 4 17:33:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13618098 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2067.outbound.protection.outlook.com [40.107.96.67]) (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 3F42112D765 for ; Thu, 4 Apr 2024 17:34:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712252097; cv=fail; b=aPmPFpXh0oJvzDgzpC9ZX3HIcOeWMmQVvO4LUryiRFIR2QpzP78c40EFPXtywVs0VuE5siz3QGMG7tRTeZ/Yc3X9pNkDBDuBWS2kb925n/6JYGWXm3kUizlaB2JvPencMO825RwkEidVRjJsbnNd9rqZcy8JsE0niooCY8ULP5k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712252097; c=relaxed/simple; bh=samQoVWGgQBhDOMpVyk7UJdqW27OF25V0YQYaA7/xhM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XKYICY0tr1WZwJ3H9qSndq3djpc9rG1BMBmnbLUmktf0+Jysg+MTt4YbJyJ4pMskuWNEedPCMiEL/UAjUvaaE8yDCqatUrkxmgmzoiRtRdCwY5MBnbBafQoUjF5j9Q6LwhDO7n21R5uomMjXN/jWk1KD/4aRTiQEyBtv5b46FVM= 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=DKuQDDoQ; arc=fail smtp.client-ip=40.107.96.67 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="DKuQDDoQ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cd5EZFgv6Nax5lp69NdiPhKtls068biyY/6lJTXMk+TrfKgrXK1Ew80daBVsm1GZTy83Yj73Jq2dWrOcr8J+y/+hZzAuqNZoUk9vP5/8IHkcvzPaFH3EdjzA9SNC3nRU72k5R+lUPAi2y/1n8y1tqfuYkC3E0lGIfYNKvvIEQB1qsF1UifbP3zDdDEvwnNRfgzVPNXBaF5WzPckRSs4qTItDQbShjG7Lr/WoyGAQU3cJl14a3mbTodnjSQGEmX76AAyFoGQakG7Nzu6fjDDXa+bSC9wxbFPoHcJGwG56WCf3SA+XWv1H0FijEto+731ozMjncQbQgGo58YMrxnoTRw== 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=ROVsO9SlIBSedRs87nXUr456pDeeDtUG3v2Falnm7eI=; b=YNCIuRS/uJGFNyxTb611nhIcB9brZowwqXzc1GJ5TQqPbKy6WYCCkchdvf3z6VSFvy0c9LLHLhZdbM0g3Rp8r+kibk5e4TIMgKrzb98CNDVoKEayqnvoCe0Pn13I46VMNdSdn1oOuKg3WmYXnpruxheXTVRngn6J/KkKmPTZRfjmPLBKs/oVmLxPaL/uBvCjmj/vNaL+s2JbQxFPe0gKxKlEEWMEsM1Uy3AVwnXqI7YzUJt1vAGICCAdrDt/y3+7NFWYHYWaPR+aiPCwr1BWiZf7JuvEnLLwruBdjx67wObqCoYwNOiVZl0RrOt4vakJra1MR/eiBrDG7ov3MiqQgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net 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=ROVsO9SlIBSedRs87nXUr456pDeeDtUG3v2Falnm7eI=; b=DKuQDDoQeWMvhgT16h2uUdMdKykyfRCopT5IUmqFLnOiMhTs42g1PSEnDjCiJeaGc6tbAl2KMft2hc/mPDp1fwotldxSNx29CcXTN3IOBeEkl2LJBXHSXNhNuRiWUnYWY6Q1n7AmM4aJS5gm1YJtJvz9ERnrkb32jvvDKNXuL4L3XjkwtzLWxIdgknW67d45l6Zn7qJgpSsM9mVEfVGJTKIk2vgWAOamI33wH1T4CgVZNfgWe1EzAEws3OEr72gqKj9+1Ro3dTN6TO1dD/RrfnAjkAlcaNkRK3Vs2HHQXU8eeXmb1lqc1YjbvSQU4cjtlWCBuumZu4DAbjkWlxcCCg== Received: from MW4PR04CA0056.namprd04.prod.outlook.com (2603:10b6:303:6a::31) by PH7PR12MB5709.namprd12.prod.outlook.com (2603:10b6:510:1e0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Thu, 4 Apr 2024 17:34:51 +0000 Received: from MWH0EPF000A6732.namprd04.prod.outlook.com (2603:10b6:303:6a:cafe::8c) by MW4PR04CA0056.outlook.office365.com (2603:10b6:303:6a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.26 via Frontend Transport; Thu, 4 Apr 2024 17:34:51 +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 MWH0EPF000A6732.mail.protection.outlook.com (10.167.249.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Thu, 4 Apr 2024 17:34:50 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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.986.41; Thu, 4 Apr 2024 10:34:35 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Thu, 4 Apr 2024 10:34:34 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Thu, 4 Apr 2024 10:34:32 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Tariq Toukan Subject: [PATCH net-next 5/5] net/mlx5e: Un-expose functions in en.h Date: Thu, 4 Apr 2024 20:33:57 +0300 Message-ID: <20240404173357.123307-6-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404173357.123307-1-tariqt@nvidia.com> References: <20240404173357.123307-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000A6732:EE_|PH7PR12MB5709:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c796049-3ac1-4830-103c-08dc54cd87fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MpOhv0iDZiBXHwMpEQgL2BRT3QdSeGme+rQaE2sv7R3pdrOKqMlfsMXD3fu5Mz+jdX7LIogFBuiPh5lv4VUmJ5ikhoHYPwnF1djZ5O3CzHErMKa76CpcIkOYDKj/bxp2dwyzLaDdhmhJFsNDaydbmtlOIHnMOkVmPZ0fMlJEW4+BtNvj/Y2EXni4PjZmYoOI6cjZGh9Wk8ywmp+l7+3pisBOSfQKkZ8UOvuFIwCndSPMQ2bWsqZ+tKRb7iFg/PjLgroxGNdLmPdflDo3Ve/MSTA4Chcx7MUlyEF8ywp8h4nlpI2X4XVWpzfL4g2DTdA6uu3rmdtUq6e9IDmyG/iqz5Yp3/zawqcplRjSH3AQfIB7nCuTc9m9sVH1SDJa13RabbWtzihATqoaWxSYne+kJXC82QPhJG3AZC9Nqopuf2xNHp2oIpKhaApqXLEck0rotl5VBWhaurYhWlJWU2qxP9C2TGM/jAaaSKKBHtFPdL6Jcm9HHdPQvbRqXBLxAI3/cpFSvdGvGdeXlTGzoi9CE9nCm4guBGcJMpCiNBVT78M51//y06FM0GPiCiar12Z2AzHCUUInHMI7r3hMRErNcw3FL2jz+HjxYy6ODcgLQ2RN8CM5cONB5BYs3vwNSc9vwh9gA7PXamvWqEo+t6/ECChH+CVa7sUDTzJ3MzFYPt8vDmmdCE1PypS1/7rU9nrC0CH5lD27u0K/W8VOx/b/dGoZHwcWW/77Uet+8l+AJWNPeEr1P38grhYcMy6nE4Xz 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:(13230031)(36860700004)(82310400014)(376005)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2024 17:34:50.4833 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c796049-3ac1-4830-103c-08dc54cd87fc 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: MWH0EPF000A6732.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5709 X-Patchwork-Delegate: kuba@kernel.org Un-expose functions that are not used outside of their c file. Make them static. Signed-off-by: Tariq Toukan Reviewed-by: Kalesh AP --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 12 ---------- .../ethernet/mellanox/mlx5/core/en_ethtool.c | 22 +++++++++---------- .../net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index f5a3ac40f6e3..2acd1ebb0888 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -1143,7 +1143,6 @@ void mlx5e_close_drop_rq(struct mlx5e_rq *drop_rq); int mlx5e_create_tis(struct mlx5_core_dev *mdev, void *in, u32 *tisn); void mlx5e_destroy_tis(struct mlx5_core_dev *mdev, u32 tisn); -int mlx5e_update_nic_rx(struct mlx5e_priv *priv); void mlx5e_update_carrier(struct mlx5e_priv *priv); int mlx5e_close(struct net_device *netdev); int mlx5e_open(struct net_device *netdev); @@ -1180,23 +1179,12 @@ int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv, struct ethtool_coalesce *coal, struct kernel_ethtool_coalesce *kernel_coal, struct netlink_ext_ack *extack); -int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, - struct ethtool_link_ksettings *link_ksettings); -int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, - const struct ethtool_link_ksettings *link_ksettings); -int mlx5e_get_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh); -int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh, - struct netlink_ext_ack *extack); u32 mlx5e_ethtool_get_rxfh_key_size(struct mlx5e_priv *priv); u32 mlx5e_ethtool_get_rxfh_indir_size(struct mlx5e_priv *priv); int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv, struct ethtool_ts_info *info); int mlx5e_ethtool_flash_device(struct mlx5e_priv *priv, struct ethtool_flash *flash); -void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv, - struct ethtool_pauseparam *pauseparam); -int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv, - struct ethtool_pauseparam *pauseparam); /* mlx5e generic netdev management API */ static inline bool diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index 69f6a6aa7c55..93a13a478c11 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -996,8 +996,8 @@ static void get_lp_advertising(struct mlx5_core_dev *mdev, u32 eth_proto_lp, ptys2ethtool_adver_link(lp_advertising, eth_proto_lp, ext); } -int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, - struct ethtool_link_ksettings *link_ksettings) +static int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, + struct ethtool_link_ksettings *link_ksettings) { struct mlx5_core_dev *mdev = priv->mdev; u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {}; @@ -1167,8 +1167,8 @@ static bool ext_requested(u8 autoneg, const unsigned long *adver, bool ext_suppo return autoneg == AUTONEG_ENABLE ? ext_link_mode : ext_supported; } -int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, - const struct ethtool_link_ksettings *link_ksettings) +static int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, + const struct ethtool_link_ksettings *link_ksettings) { struct mlx5_core_dev *mdev = priv->mdev; struct mlx5_port_eth_proto eproto; @@ -1268,7 +1268,7 @@ static u32 mlx5e_get_rxfh_indir_size(struct net_device *netdev) return mlx5e_ethtool_get_rxfh_indir_size(priv); } -int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh) +static int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh) { struct mlx5e_priv *priv = netdev_priv(netdev); u32 rss_context = rxfh->rss_context; @@ -1281,8 +1281,8 @@ int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh) return err; } -int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh, - struct netlink_ext_ack *extack) +static int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh, + struct netlink_ext_ack *extack) { struct mlx5e_priv *priv = netdev_priv(dev); u32 *rss_context = &rxfh->rss_context; @@ -1411,8 +1411,8 @@ static void mlx5e_get_pause_stats(struct net_device *netdev, mlx5e_stats_pause_get(priv, pause_stats); } -void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv, - struct ethtool_pauseparam *pauseparam) +static void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv, + struct ethtool_pauseparam *pauseparam) { struct mlx5_core_dev *mdev = priv->mdev; int err; @@ -1433,8 +1433,8 @@ static void mlx5e_get_pauseparam(struct net_device *netdev, mlx5e_ethtool_get_pauseparam(priv, pauseparam); } -int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv, - struct ethtool_pauseparam *pauseparam) +static int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv, + struct ethtool_pauseparam *pauseparam) { struct mlx5_core_dev *mdev = priv->mdev; int err; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 81e1c1e401f9..a0d3af96dcb1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -5562,7 +5562,7 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv) mlx5e_ipsec_cleanup(priv); } -int mlx5e_update_nic_rx(struct mlx5e_priv *priv) +static int mlx5e_update_nic_rx(struct mlx5e_priv *priv) { return mlx5e_refresh_tirs(priv, false, false); }