From patchwork Wed Oct 11 22:12:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 13418008 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 9765D1BDE9 for ; Wed, 11 Oct 2023 22:13:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="a81/JKZ8" Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBD8A91 for ; Wed, 11 Oct 2023 15:13:07 -0700 (PDT) Received: by mail-yb1-xb35.google.com with SMTP id 3f1490d57ef6-d9a516b015cso352034276.2 for ; Wed, 11 Oct 2023 15:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1697062387; x=1697667187; darn=vger.kernel.org; h=mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=tMq8flHU627GPZmNFT0gvwmWyKwc7OIrj8z8Oodlr+s=; b=a81/JKZ8HxDhL6peqstk0yv2FaZhw7H3RQqGHxJ2L0u2E2PuMVZIwhzyURPQGxIXSy ORd4e5sS5aqEaGsSdmvvaJ0yX29iJDC/2dkPVzQmA2RYLHwET8n32nQrNF5Kqz5B9pxF kTcIzqJh+5mWeF7RCoKiaCcU5rbN9sxceUSBU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697062387; x=1697667187; h=mime-version:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=tMq8flHU627GPZmNFT0gvwmWyKwc7OIrj8z8Oodlr+s=; b=gKMYAycXH+J/vdJ/jw6Sofq3EIYgamM7yxkNmi1N1U0DH1tDdN6eSDKSzVjQR1xXE2 fKF49BTZccQzCiGW2WeT/A32+OlE1hbOedprqxcNet92JlNsB7qAjWllFd0U2a9Vbsy/ dc236SjoE6t69FxOnwL24zTb1q02VLXaY5kpiGtC0pj2jOJlMvbi92nYZA6leGZKGEyQ e6+M8vusaP6Orzo7Im+Jzjcg3PYaH/WDlUTLGYRQgaPYOPuKOhxv7fvGwtqWYgbgYeX7 0LvOh2F1QWjxlWzYtVBWICqFOUagyjhCgUG87AaL/GLkZXNk1Dmxgt9HLn4wjILHcaMR Focw== X-Gm-Message-State: AOJu0Yzjv25yWQ41B7a3fIzzGnkmNlgNpCTgwBIBDY0J/Ik38JdptJEd mFPrcis8DAO8/DFkPsdoPTnYHmCqOcPloNlpjKP8kxM0dx8FXq1LUmRaNeI6DjD5fpl+XVftdoT OaD1dHMzE50FHNpoQhSz/ta44DC9ZYnMaeaD6uK6Grd3E32nwV9tBFEkHek4tepr1FkxlDcoDfc lbquriEEZD0Q== X-Google-Smtp-Source: AGHT+IHD1itC9I7sO/JNGddVOBD3nYbr8qrzdBqpFZOAxZbclG5ohixFR2B5dB96kufpm+QOduiNng== X-Received: by 2002:a25:cbce:0:b0:d9a:4ae7:f32 with SMTP id b197-20020a25cbce000000b00d9a4ae70f32mr7253905ybg.3.1697062386589; Wed, 11 Oct 2023 15:13:06 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id a12-20020a05620a102c00b007759a81d88esm5505705qkk.50.2023.10.11.15.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 15:13:05 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , opendmb@gmail.com, justin.chen@broadcom.com, Michal Kubecek Subject: [PATCH net-next 0/2] Add WAKE_MDA Wake-on-LAN option Date: Wed, 11 Oct 2023 15:12:38 -0700 Message-Id: <20231011221242.4180589-1-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MIME_NO_TEXT, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org This is a follow-up to the patch series previously submitted here: https://lore.kernel.org/all/20230516231713.2882879-1-florian.fainelli@broadcom.com/ which is now implementing the approach suggested by Andrew. This patch series adds a new Wake-on-LAN option (WAKE_MDA) with the single letter 'e' (all of the 'm', 'd' and 'a' were already taken) which allows us to specify a custom destination MAC to be waking from. For the ioctl-based interface we use an anonymous union to overlay a 6-byte MAC DA field with the existing sopass field. This is particularly useful for systems that use Ethernet PHYs as wake-up devices and when waking up on coarse filters like multicast, broadcast destination MAC addresses is not enough to keep them in a low power state. We use this on Set-top-box environments in order to allow waking-up from only specific IPv4/v6 multicast groups like mDNS for instance. Printers, smart speaker and IoT devices could fall in that category as well. Example: ethtool -s eth0 wol e mac-da 01:00:5e:00:00:fb ethtool patches are sent as a reply to this thread. Florian Fainelli (2): ethtool: Introduce WAKE_MDA net: phy: broadcom: Add support for WAKE_MDA Documentation/networking/ethtool-netlink.rst | 7 ++++++- drivers/net/phy/bcm-phy-lib.c | 7 ++++++- include/uapi/linux/ethtool.h | 10 ++++++++-- include/uapi/linux/ethtool_netlink.h | 1 + net/ethtool/common.c | 1 + net/ethtool/netlink.h | 2 +- net/ethtool/wol.c | 21 ++++++++++++++++++++ 7 files changed, 44 insertions(+), 5 deletions(-)