From patchwork Mon Feb 24 11:25:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13987905 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 986CDC021B5 for ; Mon, 24 Feb 2025 11:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TVWYhYzGAPg4VI3tt8W7V5nU0x7mU4e4eTzjYe8Ycds=; b=NjtNdwJP8+XXf7HoZkvtD8wsdG RCQQ+upBPaH0/HH2sOJYpMV8KJNNC+lMnB7W8QgFL2q2Ra3+eYTL7hn+ecnq4sdTo0j7iNpFl5nAK 6AHF9Zdf0RhMZJyb4EI+CPLQUE7Lje+MrRan7/9u2pNxtcg/kFl2sRihrJGMTaTSe8A54M+QwAouo bJ+4ZTn5L4EUiuO3ZLyHH3LfFYEPmFtZcLw1Wyeur3e72EMGgHK6+k4CpmbWOaX1m4zsNRfdOyjFQ 4b7C/FUxo925vQ7oquutNPz1VhArilDTzaK7sHzbHT1u623qsuwf3slSQ1G/U5APE7rcWOFb8EU3q nhKSqDjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tmWxM-0000000DVOU-2lCG; Mon, 24 Feb 2025 11:49:04 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tmWbC-0000000DMve-1HNA; Mon, 24 Feb 2025 11:26:11 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D2C865C3E0A; Mon, 24 Feb 2025 11:25:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27579C4CED6; Mon, 24 Feb 2025 11:26:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740396369; bh=xHKoqBgKn2E4v1Z8cYYqSP6PcLTlaElQD8fcIZ2K1OQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IHsJGZ9VSXCBOOYwygxuikig/ZBjo5IQDOoxCf0hP4taLdjilZ+cSRYNwBI+nEt/V YSCMw5IW2SPuTTrBgOKNlhIp9y7x8gSAxaE1l0I692jTBHSh/5BjUhCr8A3E6wREdW jp5oAaGHOa2c1epslEk4qndCFB7ECrVWFpO8BZYZvCmBqhjsGirio6uTuomsyyqWdv +RVakEig0tuLT7g9lDrh3wy2PUc/EWze88dWKx45mFif7HDRKEfGL35h0z3rQlNVwe 8qfw7GUxUIAsvg9ktYWkQUMjZ73cHfTT7Nrb/NPgb6ugbhnFtErlVzYrFxLNZeJfJf DqfWGT+hhzukQ== From: Lorenzo Bianconi Date: Mon, 24 Feb 2025 12:25:28 +0100 Subject: [PATCH net-next v7 08/15] net: airoha: Move REG_GDM_FWD_CFG() initialization in airoha_dev_init() MIME-Version: 1.0 Message-Id: <20250224-airoha-en7581-flowtable-offload-v7-8-b4a22ad8364e@kernel.org> References: <20250224-airoha-en7581-flowtable-offload-v7-0-b4a22ad8364e@kernel.org> In-Reply-To: <20250224-airoha-en7581-flowtable-offload-v7-0-b4a22ad8364e@kernel.org> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Felix Fietkau , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lorenzo Bianconi , "Chester A. Unal" , Daniel Golle , DENG Qingfang , Andrew Lunn , Vladimir Oltean Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, upstream@airoha.com X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250224_032610_426314_7A84B683 X-CRM114-Status: GOOD ( 10.47 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Move REG_GDM_FWD_CFG() register initialization in airoha_dev_init routine. Moreover, always send traffic PPE module in order to be processed by hw accelerator. This is a preliminary patch to enable netfilter flowtable hw offloading on EN7581 SoC. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/airoha/airoha_eth.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c index e36a14c32cbe73ecabf62201203a0c32d4a2a773..0aead5e9a3f53104a5093e252d2fda7c399d6672 100644 --- a/drivers/net/ethernet/airoha/airoha_eth.c +++ b/drivers/net/ethernet/airoha/airoha_eth.c @@ -107,25 +107,20 @@ static void airoha_set_gdm_port_fwd_cfg(struct airoha_eth *eth, u32 addr, static int airoha_set_gdm_port(struct airoha_eth *eth, int port, bool enable) { - u32 val = enable ? FE_PSE_PORT_PPE1 : FE_PSE_PORT_DROP; - u32 vip_port, cfg_addr; + u32 vip_port; switch (port) { case XSI_PCIE0_PORT: vip_port = XSI_PCIE0_VIP_PORT_MASK; - cfg_addr = REG_GDM_FWD_CFG(3); break; case XSI_PCIE1_PORT: vip_port = XSI_PCIE1_VIP_PORT_MASK; - cfg_addr = REG_GDM_FWD_CFG(3); break; case XSI_USB_PORT: vip_port = XSI_USB_VIP_PORT_MASK; - cfg_addr = REG_GDM_FWD_CFG(4); break; case XSI_ETH_PORT: vip_port = XSI_ETH_VIP_PORT_MASK; - cfg_addr = REG_GDM_FWD_CFG(4); break; default: return -EINVAL; @@ -139,8 +134,6 @@ static int airoha_set_gdm_port(struct airoha_eth *eth, int port, bool enable) airoha_fe_clear(eth, REG_FE_IFC_PORT_EN, vip_port); } - airoha_set_gdm_port_fwd_cfg(eth, cfg_addr, val); - return 0; } @@ -177,8 +170,6 @@ static void airoha_fe_maccr_init(struct airoha_eth *eth) airoha_fe_set(eth, REG_GDM_FWD_CFG(p), GDM_TCP_CKSUM | GDM_UDP_CKSUM | GDM_IP4_CKSUM | GDM_DROP_CRC_ERR); - airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(p), - FE_PSE_PORT_CDM1); airoha_fe_rmw(eth, REG_GDM_LEN_CFG(p), GDM_SHORT_LEN_MASK | GDM_LONG_LEN_MASK, FIELD_PREP(GDM_SHORT_LEN_MASK, 60) | @@ -1614,8 +1605,11 @@ static int airoha_dev_set_macaddr(struct net_device *dev, void *p) static int airoha_dev_init(struct net_device *dev) { struct airoha_gdm_port *port = netdev_priv(dev); + struct airoha_eth *eth = port->qdma->eth; airoha_set_macaddr(port, dev->dev_addr); + airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(port->id), + FE_PSE_PORT_PPE1); return 0; }