Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2120972rwd; Wed, 17 May 2023 06:08:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+ih7hWVgX1CH5nlI5bjX8VV647+aQ5/pU6DRX6nLEumg6snk7Xr5TgLnJ9mjLVn3DAxCq X-Received: by 2002:a17:90a:7801:b0:24e:16aa:48 with SMTP id w1-20020a17090a780100b0024e16aa0048mr40113351pjk.15.1684328908687; Wed, 17 May 2023 06:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684328908; cv=none; d=google.com; s=arc-20160816; b=lKu6AbuCnTxevK6zfKp6icZIQSAVlmQtgZYf3GKWsOsIJkusb/8DIkNhZA3ldNM7Ga JUxtoWH7QcSe1r0ndUFQ+OCRAJ2dBeRHbVDKdstzw69W2gs7uBUpklEEAwvYsY1OXTxk Uj+pF7ZV23SIOWP/xjRn2rGBmXdTygIAbysd7gEJfyVeL1409aRcbMhj7FOAzs0ttk+5 Tgb29oPkoMRsAbYxq9jbRIkOOuxhqtJdh44QFwEv3fVlCC87vEDwcgsh9YU9GjpP1p4h Y8qz8rCvBQ1W/HJwYoEUcJ2RzpBrsX86kkJsTC+1lVsPiHJHQLWA9EWQa7mOj8ZaUf/c ghLQ== 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=71V5ReKQHSIVV/dbqK9wwRwpMSrqgG8X/SEPqdAnmzI=; b=Khu0nI9V69sQrpJzo38iqR8Px+lpkCt7UW1oqqNs+XPBnCWsbYSTLmZuoPQ1aTsTPp dl3piu0q8cjlCW2ogmoJunGBirYyGB+Aoem7Tg3y88Z0QOO/O93PAE8qA/M9QyzTRu1Y Qi2RtvTl6YZv737LSaU99zocIHcCOlCWhKH+a2SxHE9kvVMKFJbE6SDPiB3xaWJRkl94 nj6k3hUr9WPMrWbK0H5IfHX9KX0dOjI7e/7LE/Y2DGseXiv8971J+Qbb6CRXAMVDv/Rw DuxDQMPSCo/jI878o2Skr48nx9APnySRd1dQVcQF6mWF0bnKLPAwbxRI3HQR7odMK30T e5BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Alg1Zzud; 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 y15-20020a17090a474f00b002528f697d12si1699400pjg.160.2023.05.17.06.08.16; Wed, 17 May 2023 06:08:28 -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=Alg1Zzud; 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 S231759AbjEQMuD (ORCPT + 99 others); Wed, 17 May 2023 08:50:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231418AbjEQMuB (ORCPT ); Wed, 17 May 2023 08:50:01 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 568B0421D; Wed, 17 May 2023 05:49:59 -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=71V5ReKQHSIVV/dbqK9wwRwpMSrqgG8X/SEPqdAnmzI=; b=Al g1ZzudGHCtG42DL8odktF7HpqU3IfPG7EJazjl9lC5Q4NlplP/ME3lZRgVSz1+lX/Sm7lIm57k0CE 6BAW9PN2V2AVtL4TOgDP4VGruJZ9ql9vfdHeWBrvlmG8BKZhQnRlQwogZ/UcxIalFaor3I437vLjl 9mmuCUuqUFCULhg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pzGbF-00D8VZ-Kc; Wed, 17 May 2023 14:49:49 +0200 Date: Wed, 17 May 2023 14:49:49 +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: References: <20230516231713.2882879-1-florian.fainelli@broadcom.com> <20230516231713.2882879-3-florian.fainelli@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230516231713.2882879-3-florian.fainelli@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 On Tue, May 16, 2023 at 04:17:12PM -0700, Florian Fainelli wrote: > Since the PHY is capable of matching any arbitrary Ethernet MAC > destination as a programmable wake-up pattern, add support for doing > that using the WAKE_FILTER and ethtool::rxnfc API. Are there other actions the PHY can perform? For a MAC based filter, i expect there are other actions, like drop, queue selection, etc. So using the generic RXNFC API makes some sense. > 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? The API to the PHY driver could then be made much more narrow, and you would not need the comment this is supposed to only be used for WoL. Andrew