Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4211509rdb; Mon, 11 Dec 2023 12:04:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEz6PbVyW8kU1Qns347vmm7Jhn/V12r9sv3BxiIytCMfgj+TTe+uvzaQ5pNcaA9MPuqF8Jx X-Received: by 2002:a17:903:48a:b0:1d2:e11e:a289 with SMTP id jj10-20020a170903048a00b001d2e11ea289mr2380138plb.31.1702325052051; Mon, 11 Dec 2023 12:04:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702325052; cv=none; d=google.com; s=arc-20160816; b=avTyXiBIMCKAF4CLwCQ66XRSad8f7iRADHvsljig5Iycy6COeFfNitWkG26YdNAt5F REJ7vFQGLgGfesIlQi0GGrqODL2cZHH5UQ+rgyrq3vwfA3Y226FxW/0bTnzspuc53kLf HZL/Pzp8IKFxdugOzOOIsRxBo0zDL6KDjriq8pIacoOj1fTzR3mUowPgshIy7R4L9T8a inR5Xc0uDbfw8jqieRaA6+CFTDSuI8jbPF1E75qrsLQOC24xc1ppyPJNjmpsacfCrAAh 6lmIBlZdNJOQZcR/595hRzAqP8qDPez7WzmsjtmlrR2qxh5Xf+PWyWdh9ffs2xh4nqMO eD8w== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TJwORx52Qnkp9MLDYdwDcOh/PbHd7EDCPvYh06fhd1k=; fh=yrFqorJb+YX2CtsDyk2kz7jcBQNZMtRg641H4AhZ5BQ=; b=GWQVe1CN8yt9no+fZp5liHSTPeU2QAJ0v1ipwxUEmGjlIn1xOj5y1VEArdVQ5OBRZ0 fPcqsk+RjBgQb6yw0svdy9ErL7C3SSaLYYXUcN10ovqhY5kHMvZdpbsqmJoqLG9KcwI4 VB3ccxqteO7q6IhJHsXP5t7pnmWFiU4rNukSWvKPRCguE9ASgLPRZ4vSDVrUcJF9MeEo KIxpXq2CoFD9oTqpYyjnN+XW24uKpjqfWpJtFYwPNwfXyRf6LY3ODrNOJsDpTyzF7yPR /pmFMC4t+dj5CVHGd6nRDpOn1uPSwy3JU2AK+pk7VbQ+eR0u2hIRfw8vBZB0CSzAelgw 9naA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ByKWuzSi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id b12-20020a170902650c00b001cfe02fa89esi6545913plk.117.2023.12.11.12.04.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 12:04:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ByKWuzSi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 4EB1980924B1; Mon, 11 Dec 2023 12:04:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344816AbjLKUDw (ORCPT + 99 others); Mon, 11 Dec 2023 15:03:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjLKUDv (ORCPT ); Mon, 11 Dec 2023 15:03:51 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45F6AC4; Mon, 11 Dec 2023 12:03:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To: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=TJwORx52Qnkp9MLDYdwDcOh/PbHd7EDCPvYh06fhd1k=; b=ByKWuzSigakilwX1PE20hWgvhQ CO2mP7ThIgarcek97GA2MQQ7wf0L6mERzQzB0aWPL45UeoH9PxRXOf6Q9vIWq5EjlRteTedAwqVaM gr0ihn4WWtoLU3MoIEy/FH8A3q19rfS8RpE1oSaLERE/3G+gvvDbYhTay/8RR3u6O+A0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rCmV6-002eoH-Vb; Mon, 11 Dec 2023 21:03:36 +0100 Date: Mon, 11 Dec 2023 21:03:36 +0100 From: Andrew Lunn To: Jianheng Zhang Cc: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , "open list:STMMAC ETHERNET DRIVER" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" , open list , James Li , Martin McKenny Subject: Re: [PATCH net-next] net: stmmac: xgmac3+: add FPE handshaking support Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 11 Dec 2023 12:04:09 -0800 (PST) On Mon, Dec 11, 2023 at 06:13:21AM +0000, Jianheng Zhang wrote: > Adds the HW specific support for Frame Preemption handshaking on XGMAC3+ > cores. > > Signed-off-by: Jianheng Zhang > --- > drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 6 ++ > .../net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 65 ++++++++++++++++++---- > 2 files changed, 60 insertions(+), 11 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h > index 207ff17..306d15b 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h > +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h > @@ -194,6 +194,12 @@ > #define XGMAC_MDIO_DATA 0x00000204 > #define XGMAC_MDIO_C22P 0x00000220 > #define XGMAC_FPE_CTRL_STS 0x00000280 > +#define XGMAC_TRSP BIT(19) > +#define XGMAC_TVER BIT(18) > +#define XGMAC_RRSP BIT(17) > +#define XGMAC_RVER BIT(16) > +#define XGMAC_SRSP BIT(2) > +#define XGMAC_SVER BIT(1) > #define XGMAC_EFPE BIT(0) > #define XGMAC_ADDRx_HIGH(x) (0x00000300 + (x) * 0x8) > #define XGMAC_ADDR_MAX 32 > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > index eb48211..091d932 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > @@ -1439,22 +1439,63 @@ static void dwxgmac3_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg * > { > u32 value; > > - if (!enable) { > - value = readl(ioaddr + XGMAC_FPE_CTRL_STS); > + if (enable) { > + cfg->fpe_csr = XGMAC_EFPE; > + value = readl(ioaddr + XGMAC_RXQ_CTRL1); > + value &= ~XGMAC_RQ; > + value |= (num_rxq - 1) << XGMAC_RQ_SHIFT; > + writel(value, ioaddr + XGMAC_RXQ_CTRL1); > + } else { > + cfg->fpe_csr = 0; > + } > + writel(cfg->fpe_csr, ioaddr + XGMAC_FPE_CTRL_STS); > +} > > - value &= ~XGMAC_EFPE; > +static int dwxgmac3_fpe_irq_status(void __iomem *ioaddr, struct net_device *dev) > +{ > + u32 value; > + int status; > > - writel(value, ioaddr + XGMAC_FPE_CTRL_STS); > - return; > + status = FPE_EVENT_UNKNOWN; > + > + /* Reads from the XGMAC_FPE_CTRL_STS register should only be performed > + * here, since the status flags of MAC_FPE_CTRL_STS are "clear on read" > + */ > + value = readl(ioaddr + XGMAC_FPE_CTRL_STS); > + > + if (value & XGMAC_TRSP) { > + status |= FPE_EVENT_TRSP; > + netdev_info(dev, "FPE: Respond mPacket is transmitted\n"); netdev_info()? Is this going to spam the logs? Should it be netdev_dbg() Andrew