Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2467423pxb; Mon, 19 Apr 2021 06:29:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhcq/UTxNHzn90P2gUw6tNvVdeUDfdQMaPm2wkIORSzqK275L+hhZYoqxzCfghZKP8JeOp X-Received: by 2002:a05:6402:1a52:: with SMTP id bf18mr8469124edb.289.1618838948577; Mon, 19 Apr 2021 06:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618838948; cv=none; d=google.com; s=arc-20160816; b=vrFNrH7GTrBoZKPw6XYX/JLC41d6zbUJCvVqsb5OII6ikstB7s/S84FA2BbnkOHs8A h/YZh6KkYA+kMARQMFzcm180Rdh1gxwWvrWHHjXg9w+DZ5T7AYIPKAFfvniYSOldYecb MXfZK0ZImOSfxalJsT3fLBOj6nBP4UyD+VkC5l9lf3NhAZuhYvxUMeslff5tR4eJHxgR XJ2+80V2tfw5FiowsxECQ2I4AIBkRcWdhyrNiy1eKECkU0JmqO7wAOA9bZ0aafDZ1L/z sCZznj6rpdFF7hj348X78iedq9bHFvZsC/ugRX1fBtzfTrTl2T7rCXG2MccJADcMr1kv i6Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/SfVlsog1TJ+7QM2II/GQoO6GC1gaRZs8XqgKAO/zEU=; b=sBUNMLoaJtE/1C1yAdiHSCAeeFWrmisBAyKOQMDZaloU4hLwF1R63WALz650z32mrh UM7XbrGfwwXdPYR3C4bUUDOuEhVDlcaF746awxKd7RsSoFSGQ4F6DwK6lKGGtykWfXzD RGqLqQf7W1OuGLairPPtn2ghixJaCo4t20a6FSr8f4f20t2pZwthS2mrV9nzpDxSyIQf 23LFcLkoABJ35IP+B3qRMcpw88yNE+vr8GdInD7Jf0o0lH8rssFQ14geK+Rsim+scJ1X IPcCiZg5t6kzOtYl5EnbH4sTVw2VPMM8RZg/EBlGJkPBW1/LDj/oWZlXXsd3gws3/G38 IkNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YD0LuYXI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o7si3548786edq.131.2021.04.19.06.28.45; Mon, 19 Apr 2021 06:29:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YD0LuYXI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241964AbhDSN1J (ORCPT + 99 others); Mon, 19 Apr 2021 09:27:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:56252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241317AbhDSNU0 (ORCPT ); Mon, 19 Apr 2021 09:20:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7E46E613C2; Mon, 19 Apr 2021 13:16:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838174; bh=sqV40KsaWSBrmBX/siej+IC7DA/O1R8B/GxGLbUiZDI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YD0LuYXIfBJRV+mdcPs3fCbv2kBoC3XNjOpU5nY1e2OjRMYaKLPPbTZxfGOA5zXCQ ntZNptluHzFXRjVpwq9aKYsvxjl53hoTdAwz92lpxa95dq9AEDJ4QDC6kyTavVaFUu xz1Xxl81tT0b+UCAKES6rHCA9xWeRleVLhTRELEs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aya Levin , Eran Ben Elisha , Saeed Mahameed Subject: [PATCH 5.10 068/103] net/mlx5e: Fix setting of RS FEC mode Date: Mon, 19 Apr 2021 15:06:19 +0200 Message-Id: <20210419130530.155741393@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aya Levin commit 7a320c9db3e73fb6c4f9a331087df9df18767221 upstream. Change register setting from bit number to bit mask. Fixes: b5ede32d3329 ("net/mlx5e: Add support for FEC modes based on 50G per lane links") Signed-off-by: Aya Levin Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en/port.c | 23 +++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en/port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/port.c @@ -387,21 +387,6 @@ enum mlx5e_fec_supported_link_mode { *_policy = MLX5_GET(pplm_reg, _buf, fec_override_admin_##link); \ } while (0) -#define MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(buf, policy, write, link) \ - do { \ - unsigned long policy_long; \ - u16 *__policy = &(policy); \ - bool _write = (write); \ - \ - policy_long = *__policy; \ - if (_write && *__policy) \ - *__policy = find_first_bit(&policy_long, \ - sizeof(policy_long) * BITS_PER_BYTE);\ - MLX5E_FEC_OVERRIDE_ADMIN_POLICY(buf, *__policy, _write, link); \ - if (!_write && *__policy) \ - *__policy = 1 << *__policy; \ - } while (0) - /* 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) @@ -423,16 +408,16 @@ static int mlx5e_fec_admin_field(u32 *pp MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 100g); break; case MLX5E_FEC_SUPPORTED_LINK_MODE_50G_1X: - MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(pplm, *fec_policy, write, 50g_1x); + MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 50g_1x); break; case MLX5E_FEC_SUPPORTED_LINK_MODE_100G_2X: - MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(pplm, *fec_policy, write, 100g_2x); + MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 100g_2x); break; case MLX5E_FEC_SUPPORTED_LINK_MODE_200G_4X: - MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(pplm, *fec_policy, write, 200g_4x); + MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 200g_4x); break; case MLX5E_FEC_SUPPORTED_LINK_MODE_400G_8X: - MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(pplm, *fec_policy, write, 400g_8x); + MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 400g_8x); break; default: return -EINVAL;