Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp499443lqb; Thu, 29 Feb 2024 07:06:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXo2Bp996pRZBGiTjORzjg0YKDoAkC6geuDfAkfU3ATXgOiSsUrRvGxqEnyWol2PdUxbCGL7bzX6hkbMIQshO1T9uzFv193t9QdY/X1/g== X-Google-Smtp-Source: AGHT+IH0wcwnuf/rBa7r5rIJ8Fs1Vp0kn6kamqBRc7cieEFpRc8bzsbWWHAdYTeMJXYLvuRntGWw X-Received: by 2002:a05:6402:3587:b0:566:414d:d70d with SMTP id y7-20020a056402358700b00566414dd70dmr1957629edc.17.1709219182141; Thu, 29 Feb 2024 07:06:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709219182; cv=pass; d=google.com; s=arc-20160816; b=QAs2KFuCuQ0x/Q6+deb8hOLA5FXpab1UxPvGqZSVJebqa7hgtFblRpjhDOoBwXXo+S x4ipR5tE9t2dyvHOBwqEfm9Dh1EBhqIpD7VOkJwzwP4nolRQmUWqsL570uEFoBfqwvp6 42aQ1kN3jODToLgWY9rL+WyUxi+UzpB7tQLky8TKj4wRooQwt5o/QjNom3a8eDbSdsJL hvLklEyFY6ZtAYBr2c+wGGtU38QZlUpiH+XsXxiaVHx3bULuv+KVTy6DXyW+HMyLxOYP b0GOStrI0cyPGAMB6i0eaYb1FS46o8EzrcVfprFEvsKUW/qAddYX8rqEXXrKDM80ceiL Xk0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vkq1cSPFx4ixNxWnCzVtyGnhzokMMdq2KSDQeGVzjh4=; fh=5GLuCscafnkr9xURFuRRZGM/am2ErtbL/1cRxjXdgT4=; b=BbiVRfcN6fqlMGARxixBBSdcIJlqIRHZML7z0BS14zFR5R2WKt1pCKD+JiL1kIjqKl vgKwT7tj1Yyo/oVPLQ6QlzeV2duCJre6Wh3+MXoNBCZn1OG5WYU3r0lSXaYCrN9poMwV gbCi9zZBHPDYHOKPO54VXnnRlpIQrI8Tv68GTDJijEAlyB4bzvBkpIZIOFri3NoF7Srt g10xJsqkUEx9MzmBGo+xtJbD7V1gneuDyxSoZpvyzg/5VyqIDKrS6Li77M8Qjvob3+i7 BHgyVV/PQfAn0L8swS+Dv5K5jfFwJYr1Jk4M6iy7NZgOUFZipJrpJKbLav8XVl7+wmq9 fizg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="HmkNoC/0"; 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-86891-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86891-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 x9-20020a05640226c900b00565dcc278fasi638378edd.540.2024.02.29.07.06.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 07:06:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86891-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="HmkNoC/0"; 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-86891-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86891-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 A54841F2369D for ; Thu, 29 Feb 2024 15:06:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E797D1384AC; Thu, 29 Feb 2024 15:06:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="HmkNoC/0" 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 8BFC4137750; Thu, 29 Feb 2024 15:06:07 +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=1709219169; cv=none; b=qzeYeQKRvCxoptgB6GvHfIDjDfa+l34QJqAzw2wN0VtP/MdrLJTPyyuff6xF5W2rg5sp4eOf5Talr+fD0YqaC64B8yNVlIWS+0N9tYMSPx3bhei0fvlwYRsRFQ+8zBQpedd1BlmYoPT4u+vW+zaq1ZcnJAIi7wyq1vTQ7rkKBB4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709219169; c=relaxed/simple; bh=6h4hJKdMJ/mUzFPTHkW+CQwyfVnMV3EorukJNOsAz3g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dgtmirgkLBOAFCXjEHQbvPM/+cyC+revkQ29Dh6lYM4r2hjksVhXOudURHrF3qIB663X7tarJSOtMHQ+OMEq/FV+NfoaKNp3TqDpI/B7EpWHJwwc/BQVPehxtRDiCWZsI6HYrZUnTabXmvwEJzqBp8SZqNbHKPN9+wHUtZduNQo= 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=HmkNoC/0; 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-Transfer-Encoding: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=vkq1cSPFx4ixNxWnCzVtyGnhzokMMdq2KSDQeGVzjh4=; b=Hm kNoC/0tf2wu5Kum9eNsJqARb6GTT3hVSccJw2ov4WPtd/sPqx53htebi6yrbp4xHVTco/26xuE8CL Fdpn1jMc8Kg3r9irWKZdBMKXXbg2oDJcxpnKHsdPP5W5W+dMRGLnMjZkEBs35zNmDaK6wLm0UBqaQ ptHuFuxaLD0LyD4=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rfhzL-009397-J9; Thu, 29 Feb 2024 16:06:23 +0100 Date: Thu, 29 Feb 2024 16:06:23 +0100 From: Andrew Lunn To: Raju.Lakkaraju@microchip.com Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, linux-kernel@vger.kernel.org, Bryan.Whitehead@microchip.com, richardcochran@gmail.com, UNGLinuxDriver@microchip.com Subject: Re: [PATCH net 3/3] net: lan743x: Address problems with wake option flags configuration sequences Message-ID: References: <20240226080934.46003-1-Raju.Lakkaraju@microchip.com> <20240226080934.46003-4-Raju.Lakkaraju@microchip.com> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Feb 29, 2024 at 08:59:20AM +0000, Raju.Lakkaraju@microchip.com wrote: > Hi Andrew, > > Thank you for review comments. > > > -----Original Message----- > > From: Andrew Lunn > > Sent: Tuesday, February 27, 2024 7:28 AM > > To: Raju Lakkaraju - I30499 > > Cc: netdev@vger.kernel.org; davem@davemloft.net; kuba@kernel.org; linux- > > kernel@vger.kernel.org; Bryan Whitehead - C21958 > > ; richardcochran@gmail.com; > > UNGLinuxDriver > > Subject: Re: [PATCH net 3/3] net: lan743x: Address problems with wake option > > flags configuration sequences > > > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > > content is safe > > > > On Mon, Feb 26, 2024 at 01:39:34PM +0530, Raju Lakkaraju wrote: > > > Wake options handling has been reworked as follows: > > > a. We only enable secure on magic packet when both secure and magic wol > > > options are requested together. > > > b. If secure-on magic packet had been previously enabled, and a > > subsequent > > > command does not include it, we add it. This was done to workaround a > > > problem with the 'pm-suspend' application which is unaware of secure-on > > > magic packet being enabled and can unintentionally disable it prior to > > > putting the system into suspend. > > > > This seems to be in a bit of a grey area. But ethtool says: > > > > wol p|u|m|b|a|g|s|f|d... > > Sets Wake-on-LAN options. Not all devices support this. > > The argument to this option is a string of characters speci‐ > > fying which options to enable. > > p Wake on PHY activity > > u Wake on unicast messages > > m Wake on multicast messages > > b Wake on broadcast messages > > a Wake on ARP > > g Wake on MagicPacket™ > > s Enable SecureOn™ password for MagicPacket™ > > f Wake on filter(s) > > d Disable (wake on nothing). This option > > clears all previous options. > > > > d clears everything. All other things enable one option. There does not > > appear to be a way to disable a single option, and i would say, adding options > > is incremental. > > > > Yes. "d" clears everything. > But, if we enable "g" then enable "a", "g" option overwritten by "a" This is where i say it is a bit of a grey area. For me, they are incremental. You can enable a and then later enable g, and you should have both enabled. > Please find the attached log information > > So: > > > > > a. We only enable secure on magic packet when both secure and magic wol > > > options are requested together. > > > > I don't think they need to be requested together. I think you can first enable > > Wake on MagicPacket and then in a second call to ethtool Enable SecureOn > > password for MagicPacket. I also don't think it would unreasonable to accept > > Enable SecureOn password for MagicPacket and have that imply Wake on > > MagicPacket. > > > > If we need to enable any 2 options, we have to provide both options together. > i.e. > sudo ethtool -s enp9s0 wol ga which i think is wrong. A driver should allow incremental adding WoL options. > > > And: > > > > > b. If secure-on magic packet had been previously enabled, and a > > subsequent > > > command does not include it, we add it. > > > > If there has not been a d, secure-on magic packet should remain enabled until > > there is a d. > > > > This is not happened with existing "Ethtool". > Please find the log information in an attachment file. That could just be a driver bug. Take a step back. Is there any clear documentation about how ethtool -s wol should really work? Any comments in the code? Any man page documentation. Lets first understand how it is expected to work. Then we can decided if the driver is implementing it correctly. Andrew