Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3948419pxf; Tue, 6 Apr 2021 04:32:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzt3uaX6tqR8sfoB5J2q3/YpA5bipFT/CEvzvwGnWwV58PxzU9COCYu98FmfEvQgtMe7IP3 X-Received: by 2002:a05:6402:2708:: with SMTP id y8mr12346053edd.265.1617708775941; Tue, 06 Apr 2021 04:32:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617708775; cv=none; d=google.com; s=arc-20160816; b=dlRYTSDBf3E+YWi2GCoccxsFmL2VLb+vGauzVuPSM1Eim7FQ1jp876/K3j4FNaxfIW RcUZDScSeQEUH/6WHlJllIbjKiK7WzpS3W1yL4e4sp6edpvPhZr7f8sgm97cZDIZFtL4 MDCnffqoLScF7Qutwq1lsgmqiiAR2DweiZonHLeM0uJ7Mo20FrFd4LTYWkdPHBnBvO+0 WCMeTtIJZdWwPITInWKWhING9UfWujvfFPdG5yO2FrjtCrwvgOnEvyfqhA/rTpspulUW K2tfWWh840ou8QgqI/iWTG2ujVSYl/YOQ/75PXond2yLYbPRFz1u1VirlcBUBmG+wOfe sKTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=wxkB8NpM061bjYlntsiI3a7XXiE/w2mFTIfQuvtDRLM=; b=AuIHUSyyz0U9+OvS9FQDjNA5BMw9S4JKMHeTgfgTkeDafWK84tj11x5ROromUt0mBq 65IOTWMswLgIQ+Ymeqm4FSmGyj7lA997RIkFjQd7fiaHL9aSJsmTQP8Iu4WEunbdv74j oeRSZUg5G5BIsL0Ukj5L/HFetlgutoZTV5qyC+0U+nG+HxDyg/MEgiqVlMcVsUS1SztW czEYcNpJOwV/iL6kYRTgZ8/0DmEdIZTDP7WcMucIogdwzQwnAMCfhcLviqhMB9PXxq7R TQKEKS/TeCyTy3OfMdZkpnLna23srngUma0eH2AkfpjGxh8qUs45OnfsxNFHSvO9VNoX QA+g== ARC-Authentication-Results: i=1; mx.google.com; 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 l11si16383591edb.511.2021.04.06.04.32.30; Tue, 06 Apr 2021 04:32:55 -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; 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 S242916AbhDFAJ5 (ORCPT + 99 others); Mon, 5 Apr 2021 20:09:57 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:34912 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241639AbhDFAJ4 (ORCPT ); Mon, 5 Apr 2021 20:09:56 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lTZHf-00F0hM-Mm; Tue, 06 Apr 2021 02:09:31 +0200 Date: Tue, 6 Apr 2021 02:09:31 +0200 From: Andrew Lunn To: Grant Grundler Cc: Oliver Neukum , Jakub Kicinski , Roland Dreier , nic_swsd , netdev , "David S . Miller" , LKML Subject: Re: [PATCH net-next v4 0/4] usbnet: speed reporting for devices without MDIO Message-ID: References: <20210405231344.1403025-1-grundler@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210405231344.1403025-1-grundler@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 05, 2021 at 04:13:40PM -0700, Grant Grundler wrote: > This series introduces support for USB network devices that report > speed as a part of their protocol, not emulating an MII to be accessed > over MDIO. > > v2: rebased on recent upstream changes > v3: incorporated hints on naming and comments > v4: fix misplaced hunks; reword some commit messages; > add same change for cdc_ether > v4-repost: added "net-next" to subject and Andrew Lunn's Reviewed-by > > I'm reposting Oliver Neukum's patch series with > fix ups for "misplaced hunks" (landed in the wrong patches). > Please fixup the "author" if "git am" fails to attribute the > patches 1-3 (of 4) to Oliver. > > I've tested v4 series with "5.12-rc3+" kernel on Intel NUC6i5SYB > and + Sabrent NT-S25G. Google Pixelbook Go (chromeos-4.4 kernel) > + Alpha Network AUE2500C were connected directly to the NT-S25G > to get 2.5Gbps link rate: > # ethtool enx002427880815 > Settings for enx002427880815: > Supported ports: [ ] > Supported link modes: Not reported > Supported pause frame use: No > Supports auto-negotiation: No > Supported FEC modes: Not reported > Advertised link modes: Not reported > Advertised pause frame use: No > Advertised auto-negotiation: No > Advertised FEC modes: Not reported > Speed: 2500Mb/s > Duplex: Half > Auto-negotiation: off > Port: Twisted Pair > PHYAD: 0 > Transceiver: internal > MDI-X: Unknown > Current message level: 0x00000007 (7) > drv probe link > Link detected: yes > > > "Duplex" is a lie since we get no information about it. You can ask the PHY. At least those using mii or phylib. If you are using mii, then mii_ethtool_get_link_ksettings() should set it correctly. If you are using phylib, phy_ethtool_get_link_ksettings() will correctly set it. If you are not using either of these, you are on your own. Speed: 2500Mb/s and Duplex: Half is very unlikely. You really only ever see 10 Half and occasionally 100 Half. Anything above that will be full duplex. It is probably best to admit the truth and use DUPLEX_UNKNOWN. > I expect "Auto-Negotiation" is always true for cdc_ncm and > cdc_ether devices and perhaps someone knows offhand how > to have ethtool report "true" instead. ethtool_link_ksettings contains three bitmaps: supported: The capabilities of this device. advertising: What this device is telling the link peer it can do. lp_advertising: What the link peer is telling us it can do. So to get Supports auto-negotiation to be true you need to set bit ETHTOOL_LINK_MODE_Autoneg_BIT in supported. For Advertised auto-negotiation: you need to set the same bit in advertising. Auto-negotiation: off is i think from base.autoneg. Andrew