Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1119736iog; Mon, 13 Jun 2022 22:27:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uOS0NeRjM1NEmBXqTTjQJQpGLDQYewPEi3Dm2AOVFc1slvlrn0riDT21Ki7vkxWkzr1sIM X-Received: by 2002:a17:903:408c:b0:163:e526:4397 with SMTP id z12-20020a170903408c00b00163e5264397mr2520485plc.80.1655184462081; Mon, 13 Jun 2022 22:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655184462; cv=none; d=google.com; s=arc-20160816; b=RnQ7978r4SJVswyP9enyVXzGPlcOB3EGxbVCqHF+9VIIKcqn+bPnQIum3k0xohb1L+ rHCqsVc7rGd6wsizYa0bq5f9hsamAfyzjWFR9V7AyyNn2DOuT6JL/7fj9qFWrIMByu1a 0qQ/WMfKULiTp0xtTEvtAvWLEiQ52YCDEjuoJzBiydoTD2tMaUk/f4w0l39cDqRG883J hEYqGbuTU9J/Df5rLOQAsGY+DXnslnlDs6JuQRn7gexs5D6BRezujUPsgABRJXKlb4LP c4eSxw/Imc3z61+NKcilbEe9eQqzle/P7bAyv1swn+yHAa9QX+sTVfHkfg0DyV32cLpX oLlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=3yPUrGMIPJP3IHBOk613RXj36lVfwXPUlpCy3JKkcgk=; b=WlyReXj4lYxj6odw/j3rn3N2Nn7AES3XtRiusBVG2uxuDjuLCfP0WnVfdP1Ullmsmm WK/tVvCF3ph4yYnoUUtU9Sh3/Q5YG6i/i1syGze832RJHq6xv88T8G1pg6VUDNMzhcQs a7thXYWsgv6RzTlSboY4OJTiF8EpdvmNt2IIt4QqRmMxQjZbXog/xBCsMf4XGp1BHT2/ 9YSn3up8p310UrXeNt2yd5uqMmrbxuedr5UZUhFQ0gD2nZ96JNaVdSC4oSi20vfB2eBB Z6m8rHY0LOQYR78sBfDekGTJgoj5zleulVGO+7dKDh3dGXQy5JrhM/AcOCyINjifBrKa o1Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i17-20020a63d451000000b003fd7e21748asi3680314pgj.361.2022.06.13.22.27.29; Mon, 13 Jun 2022 22:27:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234888AbiFNFMh (ORCPT + 99 others); Tue, 14 Jun 2022 01:12:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232090AbiFNFMc (ORCPT ); Tue, 14 Jun 2022 01:12:32 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9C8D6565 for ; Mon, 13 Jun 2022 22:12:30 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o0yqh-0003ck-Kn; Tue, 14 Jun 2022 07:12:19 +0200 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1o0yqf-0001gw-Gs; Tue, 14 Jun 2022 07:12:17 +0200 Date: Tue, 14 Jun 2022 07:12:17 +0200 From: Oleksij Rempel To: Andrew Lunn Cc: Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Michal Kubecek , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net-next v1 1/1] net: phy: add remote fault support Message-ID: <20220614051217.GC4536@pengutronix.de> References: <20220608093403.3999446-1-o.rempel@pengutronix.de> <20220613125552.GA4536@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 13, 2022 at 04:56:37PM +0200, Andrew Lunn wrote: > > If I see it correctly, there is no way to notify about remote fault when > > the link is up. The remote fault bit is transferred withing Link Code > > Word as part of FLP burst. At least in this part of specification. > > Thanks for looking at the specification. So ksetting does seem like > the right API. > > Sorry, i won't have time to look at the specification until tomorrow. > The next question is, is it a separate value, or as more link mode > bits? Or a mixture of both? It is the bit D13 within Base Link Codeword as described in "28.2.1.2 Link codeword encoding". Every PHY will send or receive it, but may be not every PHY will allow to set this bit. The actual error value can be optionally transmitted separately withing the "Next Page". > Is there a capability bit somewhere to indicate this PHY can advertise a > remote fault? No, it is not part of the "Technology Ability Filed". It is more like a state bit. Potentially some PHY may set it witout some PHY may do it without software: 28.2.2 Receive function requirements ... If any other technology-dependent PMA indicates link_status=READY when the autoneg_wait_timer expires, Auto-Negotiation will not allow any data service to be enabled and may signal this as a remote fault to the Link Partner using the Base Page and will flag this in the Local Device by setting the Parallel Detection Fault bit (6.4) in the Auto-Negotiation expansion register. > That would suggest we want a ETHTOOL_LINK_MODE_REMOTE_FAULT_BIT, which we > can set in supported and maybe see in lpa? No. We can see if it is supported only if it is already in fault state. > Set it in advertising when indicating a fault. The actual fault value could > then be in a separate value which gets written to the extended page? correct. > Does 802.3 allow a remote fault to be indicated but without the reason? yes. > > So receiving remote fault information via linkstate and send remote fault via > > ksetting? > > We could also just broadcast the results of a ksetting get to > userspace? by using ethnl_multicast()? I it something what should be implemented? > I don't have easy access to a machine at the moment. What does > > ip monitor all > > show when a link is configured up, but autoneg fails? And when autoneg > is successful but indicates a remote fault? Are there any existing > messages sent to userspace? Hm, currently i get only link state changes: [LINK]4: eth1: mtu 1500 qdisc fq_codel state UP group default link/ether 18:74:e2:a0:00:a3 brd ff:ff:ff:ff:ff:ff [NEIGH]Deleted ff02::16 dev eth1 lladdr 33:33:00:00:00:16 NOARP [NEIGH]Deleted ff02::1:3 dev eth1 lladdr 33:33:00:01:00:03 NOARP [LINK]4: eth1: mtu 1500 qdisc fq_codel state DOWN group default link/ether 18:74:e2:a0:00:a3 brd ff:ff:ff:ff:ff:ff [LINK]4: eth1: mtu 1500 qdisc fq_codel state UP group default link/ether 18:74:e2:a0:00:a3 brd ff:ff:ff:ff:ff:ff [LINK]5: eth2: mtu 1500 qdisc fq_codel state UP group default link/ether 18:74:e2:a0:00:a8 brd ff:ff:ff:ff:ff:ff > > The next logical question is, if a remote fault is RX'ed (potentially with a > > reason) who will react on this. There might be different policies on how to > > react on same reason. > > Policy goes in userspace, is the general rule. ack > The only exception might be, if we decide to make use of one of these > to silence the link to allow cabling testing. We probably want the > kernel to try to do that. ack :) Regards Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |