Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp68173rwd; Wed, 17 May 2023 14:50:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6bh+iPFufEWW5BL0X17na11rSXulrS/cs3ezAlsYoNiwovC8dx4cz07MGbQK1kIgaJQR9A X-Received: by 2002:a17:902:7b85:b0:1ad:f68b:f99e with SMTP id w5-20020a1709027b8500b001adf68bf99emr254481pll.16.1684360253780; Wed, 17 May 2023 14:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684360253; cv=none; d=google.com; s=arc-20160816; b=jE0GZzwIcyRQIhFA0ckXOyC74A6nkMh2QREskdSXltuw/Nig1ip3wavweOzhCvv6S6 z+/sIedPj1NPyMNhwpM5E4mxFik37+1wa1USe1aQnMitQfrkaAy00fz1UxrFd9gy/WAc QgRHo9KsuBI8umugHRmZKS8eCYAR/SXgaxM9j3BDuUBR/F3ZmJLPBgYrYqVW2lFvDVLR wPjil7iTZU22EUJKgE/E+ss2C9NlwmSgt/4Fm78CIaLLTeaXhNHzajJLhqQVHFqyBcPe TFlBCYwwsvXpgtK8kiQUn8i+sgDDa/D3EBE7mPfUM0olBJWpDtyf4WQ+eaSYUj2+QHDu RFEQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YQ/waTn/4esVCDDekDi58999aSnIc14UPn0SAKuaX7w=; b=ePiyhsnx3EI3Uqfsnl0jHMGvlW265fD9i5Nb/R1U1alIuVfAhUD3/AflRIjPsIASFy /WcA1BzYVExhkdapISF004qLX7KBP0OtRsvhreE4kIYLW9nX1hjNc44giAMPNxBdKZkY WOiBeivD+C6NtKq39/rVtHnnOsGR9gA597bdkegi+97/AMOOPp/v9YxYQOwyjAVy2P42 rwqLawwtbIX+LrECUgc93E+uICJxQXP1Qn4PxY8Dg95gtI2P3NrwtLcOenLgRVY/cV7Z ydgMgRGtp7z564soAwlyg3M83BWH/TzMl0hrmp7Rr3gO6gZfrmFY2ArZWlZYjUipCoEP v22Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=q1efnrPy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b18-20020a170902d51200b001a988a09b6esi24433501plg.252.2023.05.17.14.50.42; Wed, 17 May 2023 14:50:53 -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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=q1efnrPy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229577AbjEQVaE (ORCPT + 99 others); Wed, 17 May 2023 17:30:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbjEQVaC (ORCPT ); Wed, 17 May 2023 17:30:02 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7E8F1996; Wed, 17 May 2023 14:30:00 -0700 (PDT) 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=YQ/waTn/4esVCDDekDi58999aSnIc14UPn0SAKuaX7w=; b=q1 efnrPypgQgZifUGOYhCQwD+zdhVxpxea/r1xchsI4x2tNoz0GnprxVXQsB/B/KXqxESB2pcCPB6+S 8HDxN6YqSjnQwko5sJ1mSzqucM8uzO3UkkzRD9eP2utfSDO+tLydGpg0azlis/V0waHV1dHUi7Jwy LPF0WsA3wQa1LYM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pzOiV-00DAtx-Ak; Wed, 17 May 2023 23:29:51 +0200 Date: Wed, 17 May 2023 23:29:51 +0200 From: Andrew Lunn To: Florian Fainelli Cc: netdev@vger.kernel.org, Doug Berger , Florian Fainelli , Broadcom internal kernel review list , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , Russell King , open list Subject: Re: [PATCH net-next 2/3] net: phy: broadcom: Add support for WAKE_FILTER Message-ID: <7e3b5d21-946b-49e9-b0a9-805af8cca9ae@lunn.ch> References: <20230516231713.2882879-1-florian.fainelli@broadcom.com> <20230516231713.2882879-3-florian.fainelli@broadcom.com> <011706c2-f0fb-42d2-81a9-7e5e4fbd784d@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <011706c2-f0fb-42d2-81a9-7e5e4fbd784d@broadcom.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 > > > ethtool -N eth0 flow-type ether dst 01:00:5e:00:00:fb loc 0 action -2 > > > ethtool -n eth0 > > > Total 1 rules > > > > > > Filter: 0 > > > Flow Type: Raw Ethernet > > > Src MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF > > > Dest MAC addr: 01:00:5E:00:00:FB mask: 00:00:00:00:00:00 > > > Ethertype: 0x0 mask: 0xFFFF > > > Action: Wake-on-LAN > > > ethtool -s eth0 wol f > > > > What i don't particularly like about this is its not vary > > discoverable, since it is not part of: > > > > 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 specifying 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. > > > > If the PHY hardware is not generic, it only has one action, WoL, it > > might be better to have this use the standard wol commands. Can it be > > made to work under the 'f' option? > > You actually need both, if you only configure the filter with > RX_CLS_FLOW_WAKE but forget to set the 'f' bit in wolopts, then the wake-up > will not occur because the PHY will not have been configured with the > correct matching mode. Ah. Please could you extend the man page for ethtool. Maybe make flow type action -2 reference wol, and wol f reference flow-type? > I was initially considering that the 'sopass' field could become an union > since it is exactly the size of a MAC address (6 bytes) and you could do > something like: > > ethtool -s eth0 wol f mac 01:00:5E:00:00:FB Yes, i was thinking something like that. > but then we have some intersection with the 'u', 'm' and 'b' options too, > which are just short hand for specific MAC DAs. The man page for ethtool say: sopass xx:yy:zz:aa:bb:cc Sets the SecureOn™ password. The argument to this option must be 6 bytes in Ethernet MAC hex format (xx:yy:zz:aa:bb:cc). So i don't think it is too much of an API bendage to pass a MAC address in a union. I had a quick look at some Marvell switches. They allow an arbitrary Unicast MAC address to be used to wake a port. So such an extension could be used for it as well. And it looks like the Marcell Alaska PHY could implement it as well. So it would not be limited to just the Broadcom PHYs. Andrew