Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2622547pxb; Sun, 17 Oct 2021 20:47:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwP9sYJ7BM8PbkYSEn+pZFG35cZwZvQn9l2EPG9NFVErVj0An5FOErTEEVKyOkCT83Kt5m8 X-Received: by 2002:a17:902:b283:b0:13f:a084:ab11 with SMTP id u3-20020a170902b28300b0013fa084ab11mr12017943plr.19.1634528836649; Sun, 17 Oct 2021 20:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634528836; cv=none; d=google.com; s=arc-20160816; b=c/4dApY2mn/QuRfolOZTh8QTF+/i2qM3071w873QwE4UqvF82dZ//aBcFj6Oynf/BH 3LKWS5jzGivYKpez0/AC0HZ83hpVFMmfQGjGaxg1ELAC81uFV/NZ9MRVJ6simsJsr2pr 1oC7aXVVCfklQBcNl+lzfFgUEt4TAO09WwYs6rbElbFR12/LT5P82l5R8F2bRxfTQKnM CTrBIR0NlmctB8N9FZtFChIl/VpiXc020wfOaj2RTnDCMeLNG/tBaSbRG8S6Ut4oJxzv 7Qo8ymTnBO+vKT2UY0Vu762WbegxZZUeLOlr6XDtomaW+7WseMTOjaUa0ahm8flvT001 CXZw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=4viN/Os8N6l4stBrqPBr6YTWSITrWn2XRCojerv1iUg=; b=JaaZH8g81gNQN7OH2FZFoQmnkHJ2XT1m1W/HR8FYKe6SpLbalYGhALY1uLGi7ocXTG akyjiSzgJ7CNgyRvBExACRN5o/wXk/rr4REPdTW1QYY/Ng/RfZiJNRXYFktYmady1ZPa hmWRtgX/JK3R9g+9qUdmt2/75jetdsDySo9oWclOKgG5Q3SxbKOUHFk0iPRb1g6so/QY dRL2LU7hOIRHNrqPN1wvDDVtAo6RF6Pyj36BqhLXB5dpZhqLnUBMMoe2SrIzopLc/8Vy 9uP64gNrEhdcnuts4yIa4v5q1Sb6QNk8ZeMwr6VMf/uVgqMv4A+iw7bV8uzaxNBLs+ZU +E8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kryo-se.20210112.gappssmtp.com header.s=20210112 header.b=Q9zKX0Qn; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z12si4281096pfh.257.2021.10.17.20.47.04; Sun, 17 Oct 2021 20:47:16 -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=@kryo-se.20210112.gappssmtp.com header.s=20210112 header.b=Q9zKX0Qn; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344369AbhJQRTl (ORCPT + 98 others); Sun, 17 Oct 2021 13:19:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344363AbhJQRTk (ORCPT ); Sun, 17 Oct 2021 13:19:40 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9C8CC06161C for ; Sun, 17 Oct 2021 10:17:30 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id r7so36806535wrc.10 for ; Sun, 17 Oct 2021 10:17:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kryo-se.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4viN/Os8N6l4stBrqPBr6YTWSITrWn2XRCojerv1iUg=; b=Q9zKX0QnFqfYHtrWDbZpywzKtbR0m++3i/YWT1yPWQGaYeXD+GUiatYEXHbKZ5//7P eezHIn4g1vaIKdyIjk2xw0kQboawVO5ZLqfskF48S2fjaVb0L5qZ+zjM+zECzuAamEUs i4O3BfFxZKJfYmqxQp2eArqBpZPbEuaqSKxM1uPGNpffkYiJLck0n8kerX8L+ZnZyzoO bZi68ZPsMPrB++e6+9QtRQQzt1EXpGYB9yHFyhdOrPsvO9VWxhIphIfxDmawBfSi3WLF E4Y2BW9NDgPwwFZqND/SlrsZKCT8aiJJ9OBnTL0rZyY4rA8F03LcbyyUxF/AeGmWQ8Wp 6QLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4viN/Os8N6l4stBrqPBr6YTWSITrWn2XRCojerv1iUg=; b=Kxw52RemBGV/z7Lk68H0XG+CQU9aSq4zdodQl30loPt+DfQkdrKvsOjHAdJ5YmRuMg 1w6FCAIernFZtv2ceWq9ptYjaYHcV0L6pr6aFqWY/pFptnLnfQrr2Tj3vHxpg3wHM8pt BmpTBHP6PnLesGiqOxaT8pTzyyOn1XGh7j4SgixqEZNqYBJySKLBtONNawbeFtlvhB54 2lLTeA2okTEnMbXTU3g9BeqgAVTZ8qvYYxvMswkmbpJEE5qJ9b/hR3CFWWyzgT78/5aS yKIFkYEvjrVrlgOpoe0pk/OHQ8ynnhhwXbrgm6NmXm8MC3Fm0gy90b+XyJTfpJA+35Jq YIXQ== X-Gm-Message-State: AOAM531uR3R8RlyMxaKzub5h20EmaDZB9jYfWzzg2lkNMTIJBlGaSiPO Ou5Abm3af94QTX1IxlWTICzC3g== X-Received: by 2002:a5d:4a08:: with SMTP id m8mr12226944wrq.18.1634491047630; Sun, 17 Oct 2021 10:17:27 -0700 (PDT) Received: from kerfuffle.. ([2a02:168:9619:0:5497:3715:36d:f557]) by smtp.gmail.com with ESMTPSA id k17sm10139820wrc.93.2021.10.17.10.17.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Oct 2021 10:17:27 -0700 (PDT) From: Erik Ekman To: Edward Cree , Martin Habets , "David S. Miller" , Jakub Kicinski Cc: Erik Ekman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] sfc: Fix reading non-legacy supported link modes Date: Sun, 17 Oct 2021 19:16:57 +0200 Message-Id: <20211017171657.85724-1-erik@kryo.se> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Everything except the first 32 bits was lost when the pause flags were added. This makes the 50000baseCR2 mode flag (bit 34) not appear. I have tested this with a 10G card (SFN5122F-R7) by modifying it to return a non-legacy link mode (10000baseCR). Signed-off-by: Erik Ekman --- drivers/net/ethernet/sfc/ethtool_common.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/sfc/ethtool_common.c b/drivers/net/ethernet/sfc/ethtool_common.c index bf1443539a1a..bd552c7dffcb 100644 --- a/drivers/net/ethernet/sfc/ethtool_common.c +++ b/drivers/net/ethernet/sfc/ethtool_common.c @@ -563,20 +563,14 @@ int efx_ethtool_get_link_ksettings(struct net_device *net_dev, { struct efx_nic *efx = netdev_priv(net_dev); struct efx_link_state *link_state = &efx->link_state; - u32 supported; mutex_lock(&efx->mac_lock); efx_mcdi_phy_get_link_ksettings(efx, cmd); mutex_unlock(&efx->mac_lock); /* Both MACs support pause frames (bidirectional and respond-only) */ - ethtool_convert_link_mode_to_legacy_u32(&supported, - cmd->link_modes.supported); - - supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause; - - ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, - supported); + ethtool_link_ksettings_add_link_mode(cmd, supported, Pause); + ethtool_link_ksettings_add_link_mode(cmd, supported, Asym_Pause); if (LOOPBACK_INTERNAL(efx)) { cmd->base.speed = link_state->speed; -- 2.31.1