From patchwork Thu Oct 26 22:45:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 13437995 X-Patchwork-Delegate: kuba@kernel.org 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 20D342F506 for ; Thu, 26 Oct 2023 22:55:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Frhl7uyK" Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEA52D49 for ; Thu, 26 Oct 2023 15:55:48 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1ca82f015e4so12792565ad.1 for ; Thu, 26 Oct 2023 15:55:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1698360948; x=1698965748; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=8WE0HDMim9tmFap041R7ZuYFB7Dx2DoKHd8ZofpvhrQ=; b=Frhl7uyK+pD/Y8ZnuYXzbUbU9Pw4ISZtPPO9++vHE85PmzOWvUTSIkyHq70M6bMUbA OxedNGn3BOtnlwUjrfvHeeuKil/ARm3QIDGThS4tUDr9m7MS9qKXAkkI31IWbF8id0OG Mo/mZE/24xqVaKh0wohpC5MFev8E07FaI2GHI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698360948; x=1698965748; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8WE0HDMim9tmFap041R7ZuYFB7Dx2DoKHd8ZofpvhrQ=; b=rxaCr3DYCka3Sl03QadZDhfkNRnpHX4uML+NzSjlQxb3MHZsjSwe9QVkPtF9n+1rZv bYX2zq/Y2LVLBqKD89eU2luzH79a8MQJlKKhpaFWKq3XLpdR80sNpjJ/v9D+PRmtX+F0 nHXFG0aS2MWblkhn+cKeuRkW+YzNBVDRWPvtPMaBePhzymtCQv4doS+4ehZoHlUJntd1 s7HyxS/PBHet/xPNVxtFBobk2AKiXKhIG11RIZRy2nP8BJ1rVSg/FGcrNDKGYT8DTrAZ 0kO3htRFR3dsb6f9LBmLOfLoA2dTzhhhQ/eKho4P0VHOrAkFFsGMEpr9WFEJd+wgRuvx ZA6w== X-Gm-Message-State: AOJu0YyLgYQSKiefnpZCpS3HoiPxCEHfJyGVtjVG9zGMlPgauFvyeiri bn3PscSnFqTPRvxuStP74agF5jLQit+nBLgyjgbBDCiLyTdBrhG+5rrOGinuCl+qvy6FgP3EPOX IJ2kryLrgfqMfXLRH182e/DiLKh80IJJgnZKe01wWg178cVi9ss60sh3UF9RPUkkugKFEzdGx4K t8Wpc831yKasuA X-Google-Smtp-Source: AGHT+IExBn8Vb3AmEGxIJcSq3NkeciGYbvn8VcO7MkfsIf5SNv/2+L3o6ODcxGlzaPZl2PGCUt7lpw== X-Received: by 2002:a17:903:2445:b0:1ca:1a1f:d2cd with SMTP id l5-20020a170903244500b001ca1a1fd2cdmr1197366pls.56.1698360947606; Thu, 26 Oct 2023 15:55:47 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id o1-20020a170902d4c100b001c9b5b63e36sm206295plg.32.2023.10.26.15.55.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 15:55:46 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , Doug Berger , Broadcom internal kernel review list , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Heiner Kallweit , Russell King , Vladimir Oltean , Tariq Toukan , Gal Pressman , Willem de Bruijn , Daniil Tatianin , Simon Horman , Justin Chen , Ratheesh Kannoth , Joe Damato , Vincent Mailhol , Jiri Pirko , linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next v2 5/5] net: bcmgenet: Interrogate PHY for WAKE_FILTER programming Date: Thu, 26 Oct 2023 15:45:09 -0700 Message-Id: <20231026224509.112353-6-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026224509.112353-1-florian.fainelli@broadcom.com> References: <20231026224509.112353-1-florian.fainelli@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Determine whether the PHY can support waking up from the user programmed network filter, and if it can utilize it. Signed-off-by: Florian Fainelli > --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 9282403d1bf6..9d01c13552eb 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -1524,6 +1524,14 @@ static int bcmgenet_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd) struct bcmgenet_priv *priv = netdev_priv(dev); int err = 0; + if (dev->phydev) { + err = phy_ethtool_set_rxnfc(dev->phydev, cmd); + if (err != -EOPNOTSUPP) + return err; + + err = 0; + } + switch (cmd->cmd) { case ETHTOOL_SRXCLSRLINS: err = bcmgenet_insert_flow(dev, cmd); @@ -1579,6 +1587,14 @@ static int bcmgenet_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, int err = 0; int i = 0; + if (dev->phydev) { + err = phy_ethtool_get_rxnfc(dev->phydev, cmd, rule_locs); + if (err != -EOPNOTSUPP) + return err; + + err = 0; + } + switch (cmd->cmd) { case ETHTOOL_GRXRINGS: cmd->data = priv->hw_params->rx_queues ?: 1;