Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp332105lqb; Tue, 28 May 2024 17:58:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV8bVEwv2Txri2T66UuU6mJwZnUBNSS6TlwLcStHFF+8UGhY6Dfh2iw1Ral9767bVPqvreGwpRO68MNQhJs9/RNut526ajt42siWSpffQ== X-Google-Smtp-Source: AGHT+IG/3T/m4BN0LcpTvrWqkO0nG8sO6gcuhsMocEQ6zrCN5piOWqy32oh4mEEgYraSEfw9HstE X-Received: by 2002:ac2:4bc6:0:b0:51e:fa8c:47cc with SMTP id 2adb3069b0e04-529651992b2mr11595797e87.30.1716944302515; Tue, 28 May 2024 17:58:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716944302; cv=pass; d=google.com; s=arc-20160816; b=s52g8UTKpN+13hSb/rdNAdeHA6yHItl2sOkf5igypFqUsFXCeFh91SXbER7HgsD5YI RU+NP5086h6v2spN6U69gIYM+bEKH+nUJcjuInqhx0dY2FCqZIIwVX0rrhkspvX+ccIR 05zdvKY2XiYor2Eb5X02OB77DO0J5e9a/6ve2Usw/nYtaVT6AyjCPrGsDa1ehrVR7hZj X3elnStCOeejN0OWlACqtqVmGe7pc/oz2a63us+izUXVOxLAaGtm5rs9nbVRXV1r1dw4 WqBkYizmXLzMEQYpEbrLmdcy9K1lz53l6EeS0V8BcaXThf/BIzUZ9S8b6bPxJf3Um4ky loBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Uc9wbdSCjB4aRQaMQK3vAbL5GRmBcqg8D+vgFNE/IIo=; fh=KUMOlGlnvvteIDVld2eHk2jqFoV7uVQJV0MYJOSVTSk=; b=kPUhmzc1RgSTxlUexuqgX5hMJO92I82u0eU2FoWp6h4buKoQcIU9P0k0flRfmpEUGy gwQHjll0ZgZzumYTQm8Xz4Xnghpas6KjztxBfNCGt0AvEdEqYfae4snRPLJyk18gK/dX 4l7zRYwrQRXHamzfFIDcRDAiwFfmdb+9yFHbB6ZGsd9GEn5AkAbrp4U7mHlrlh6SNgZU Z1aauCf1SntoTj4Q597oZR0rqumVkjxgT0+xmuiw8aLxqjESAvjEk2FcKgKDkV08DBP1 mcVqqkIz9QbGbw+2DlWfYt15sJ4qlUNKtko5zzmzA7iMGkz4XI9FzbxlnYcUoxlDDpF9 Y25g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=P30Ti1Zl; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-193278-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193278-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cc36cdfsi548150466b.410.2024.05.28.17.58.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 17:58:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193278-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=P30Ti1Zl; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-193278-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193278-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B1F241F26B2D for ; Wed, 29 May 2024 00:58:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CE0615AACD; Wed, 29 May 2024 00:57:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="P30Ti1Zl" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A63C15A4B0; Wed, 29 May 2024 00:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716944271; cv=none; b=AwJafN4TxBpPsqOvzyBY6/oBYM8m5LYiVzDvFlM91aKyOXpQu7L62sbsD/oV0US9aNwbD3geJ9gmckXrvxucuTGSQX2VkPJ7lnrGcRh6/oDE2lpgmI/5LfwzTVzGp12h2WHGuiqsjzi1e6Vvo3ZlkV9lvLlqFMealnxYtjRCyIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716944271; c=relaxed/simple; bh=AraHFqx4I0Qj3E8eWDPfD85mAXFWlrNgrS4CLt0j9Wk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VJeI0ACiyZ90dHgwKqJsXpennUt97P7JT01JQUpb1nJdM7JHVtlM0WlG0+po2QbeSJhYfD5O59kp5kigbiyM5Mefh8pb51yfy8vzjNiQS+nxCMNXN7uNoGPgp/I5Mx+eKW5FdNuI80Cj9jDEuBXduL3rsqv5jTmNbu9Oogb6F90= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=P30Ti1Zl; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=Uc9wbdSCjB4aRQaMQK3vAbL5GRmBcqg8D+vgFNE/IIo=; b=P30Ti1ZluiSyOk4p3JxX6rPt2u /tmdHiWPoKok8CAOrXsZx+k98mQSzCZi/iOjBLnm097GVh0YiFH6xhQ4VMfHjGIIa6wTrzboxGOXO mdt5FZkuH3elryg7WPX3nPKwold6yyP4n8GJW7aPSQPv+0UqyFZNXeZckVPiIaOfhgGI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1sC7d9-00GChD-6g; Wed, 29 May 2024 02:57:27 +0200 Date: Wed, 29 May 2024 02:57:27 +0200 From: Andrew Lunn To: xiaolei wang Cc: alexandre.torgue@foss.st.com, joabreu@synopsys.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [net PATCH] net: stmmac: update priv->speed to SPEED_UNKNOWN when link down Message-ID: <98e6266f-805c-4da2-b2dc-b25297c53742@lunn.ch> References: <20240528092010.439089-1-xiaolei.wang@windriver.com> <775f3274-69b4-4beb-84f3-a796343fc095@lunn.ch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, May 29, 2024 at 08:22:01AM +0800, xiaolei wang wrote: > > On 5/28/24 21:20, Andrew Lunn wrote: > > CAUTION: This email comes from a non Wind River email account! > > Do not click links or open attachments unless you recognize the sender and know the content is safe. > > > > On Tue, May 28, 2024 at 05:20:10PM +0800, Xiaolei Wang wrote: > > > The CBS parameter can still be configured when the port is > > > currently disconnected and link down. This is unreasonable. > > This sounds like a generic problem. Can the core check the carrier > > status and error out there? Maybe return a useful extack message. > > > > If you do need to return an error code, ENETDOWN seems more > > Currently cbs does not check link status. If ops->ndo_setup_tc() returns > failure, there will only be an output of "Specified device failed to setup > cbs hardware offload". So it sounds like we should catch this in the core then, not the driver. And cbs_enable_offload() takes an extack, so you can report a user friendly reason for failing, the at the carrier is off. Andrew --- pw-bot: cr