From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D3E8C433E0 for ; Wed, 27 Jan 2021 07:08:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24D6A2074A for ; Wed, 27 Jan 2021 07:08:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233050AbhA0HIZ (ORCPT ); Wed, 27 Jan 2021 02:08:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232894AbhA0HEx (ORCPT ); Wed, 27 Jan 2021 02:04:53 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51479C061573 for ; Tue, 26 Jan 2021 23:04:12 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id p15so753747wrq.8 for ; Tue, 26 Jan 2021 23:04:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zTHZXEGeii8Bg/PBKpUvY3fvjskZYo9P7jh7mQMVolE=; b=SMuJVa733/vU8SWUbOy/efzai3Lm5+Hiq64tsQq5sR8J2x5WStuU06BefxQD3/CecO ldXB04w751u0CuBpNS1sG1IZAcL5rlFTZWnMrwhYTrffi/EhUK84DlJOwBFjfvvLS0XJ +1heNKyp4mZ9ZoF/QR3Kz2vCHWGQcqhrWAYaJslGxR+9ROZqypqpaWtMyPlelr+RGE1d jYbZkoupCQXTIyvO0sAzkps9NPJdJlSb9FoAsMAFAqpw7GSMuQeZ1uveXxutrz6AASQQ KWPuWMHKNm5HiBRihzdBYq6DLZWB2sRuopfAeoxW9WUyS0kSyshV+tVL5cbd0zlk7k9I bw9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zTHZXEGeii8Bg/PBKpUvY3fvjskZYo9P7jh7mQMVolE=; b=pnIxnJgAbLpCy0d0yaiYcEZhJznNzDJVbd5UeuCeEpBWuH7Xugj5/zGvOkUPnVydEf fai76jKfcQCBxNN22In6AlQsyBlwUOFRLPLQlbpqQlxdZclxgNL05RKC97qvWr9hinZC JPP6aqud7u/cTcUJcharYW6luWrafZGtgwXghQ+kC9jUglwcyJf/0dCkdfop5vLtqlqJ ZoBdSJYKHgwOv6Ai9I/lro6G5NWtLHebWBKa59P4YSj6ISHjO0C7KWqugbtsroDpIj3e d7oxYAOH/8GGGliMbL/dHbngK48olt9VYFOtFSF6QXzF34n7WLLrHfb2rv4ZRxkoa7Jx vCaQ== X-Gm-Message-State: AOAM531081kisxeSn/bE+k8OE6q9efjFz2F6NZvEKp4+I8enmq8oqwUZ ELKbR8XJ9wZz/ecbd78e7rk= X-Google-Smtp-Source: ABdhPJxexQcjxpW1yblXpxsrwBGeIcgbhPcEIV2PInMqbQnrc2LYls6d1IEShV+jKRKsKZFsbqfdAQ== X-Received: by 2002:adf:fbc5:: with SMTP id d5mr9552323wrs.82.1611731050936; Tue, 26 Jan 2021 23:04:10 -0800 (PST) Received: from ?IPv6:2003:ea:8f1f:ad00:b9df:6985:25af:fab5? (p200300ea8f1fad00b9df698525affab5.dip0.t-ipconnect.de. [2003:ea:8f1f:ad00:b9df:6985:25af:fab5]) by smtp.googlemail.com with ESMTPSA id y11sm1638902wrh.16.2021.01.26.23.04.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Jan 2021 23:04:10 -0800 (PST) Subject: Re: [PATCH net v2 7/7] igc: fix link speed advertising To: Tony Nguyen , davem@davemloft.net, kuba@kernel.org Cc: Corinna Vinschen , netdev@vger.kernel.org, sassmann@redhat.com References: <20210126221035.658124-1-anthony.l.nguyen@intel.com> <20210126221035.658124-8-anthony.l.nguyen@intel.com> From: Heiner Kallweit Message-ID: <988cd2d7-e9f2-3947-7fcc-3da7fef7e34b@gmail.com> Date: Wed, 27 Jan 2021 08:04:02 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210126221035.658124-8-anthony.l.nguyen@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 26.01.2021 23:10, Tony Nguyen wrote: > From: Corinna Vinschen > > Link speed advertising in igc has two problems: > > - When setting the advertisement via ethtool, the link speed is converted > to the legacy 32 bit representation for the intel PHY code. > This inadvertently drops ETHTOOL_LINK_MODE_2500baseT_Full_BIT (being > beyond bit 31). As a result, any call to `ethtool -s ...' drops the > 2500Mbit/s link speed from the PHY settings. Only reloading the driver > alleviates that problem. > > Fix this by converting the ETHTOOL_LINK_MODE_2500baseT_Full_BIT to the > Intel PHY ADVERTISE_2500_FULL bit explicitly. > > - Rather than checking the actual PHY setting, the .get_link_ksettings > function always fills link_modes.advertising with all link speeds > the device is capable of. > > Fix this by checking the PHY autoneg_advertised settings and report > only the actually advertised speeds up to ethtool. > > Fixes: 8c5ad0dae93c ("igc: Add ethtool support") > Signed-off-by: Corinna Vinschen > Signed-off-by: Tony Nguyen > --- > drivers/net/ethernet/intel/igc/igc_ethtool.c | 24 +++++++++++++++----- > 1 file changed, 18 insertions(+), 6 deletions(-) > Would switching to phylib be a mid-term option for you? This could save quite some code and you'd get things like proper 2.5Gbps handling out of the box. Or is there anything that prevents using phylib?