Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2268610rwb; Mon, 7 Nov 2022 11:10:18 -0800 (PST) X-Google-Smtp-Source: AMsMyM4P+/P4NizEViaCX0EBf4sGIFQ273145wuNYnMAMnzP/y6b/33ytBn2p+mvxBe6JspUsAHm X-Received: by 2002:a17:902:ee8b:b0:186:a226:7207 with SMTP id a11-20020a170902ee8b00b00186a2267207mr50804413pld.49.1667848218208; Mon, 07 Nov 2022 11:10:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667848218; cv=none; d=google.com; s=arc-20160816; b=twFssA98aQCnQx7wl+heb2r716rQzhYXaHt7USFy7VlwI3f9BZBO3a3n/jMuVnRO5P +WnsK0kd4iXgowb4QFje1weXE2kqTDDiASiHlvm4U2MBGVssORI7ZgaCkjOZfpNF17ta iYAGrvH8AdohVL8mt1e+HMUByTxZjK0atSLiGXXmE5FwxRD0J3caBvkQtwJKaib9FQdm vhaz+s0pQTe+PbOazbPTg8LokT8X4GpFRxRWN3tvMc763ZMEbLWuj8ZV6iv3j0HKoCm0 2avXPLfXujdP7RvA2B8vPPLjEdFUsZS9DCbdomz5KoRDan4qYFfJhq96U0/+SxLCwaWU eHqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R2N+jSfSlY43TnrF1h50zfC2H3h4TDeeUUxvXDObycg=; b=Nal5g+Gp9Fyj2nD+woiU9f9VFQ8uMHb9pYriBo0GlG9FKQHe9iuYGuOHDbstL7Svwi U6hXhAWMIenRAgWRfZYWTR5J2RNnqRZ+ndV1K0zNJSRCMKZ8jCuI6xyF2UkIlEAvZc6n tU0gALgCgP2dev/CXM+TPPZmhaCFEu+u1qPbrEVw6w2IA34D/dbha9W1WcXCvVr0N0DE K/z3t+ZNwN3fAhkvcY/iMpSp/Sgjbeg/qd6UEqRBAIycENaQu62qsRPOze+DLS7PR9UR bV4qrLHDmYQk9MZxD7UFWAyA27OxPe2Bubs3TjRfafNnd6CDTGlLLrk2Yzrvo56JKAXu OXIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=C7Bjul4L; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l27-20020a63ba5b000000b004704bc7855bsi11006554pgu.153.2022.11.07.11.10.06; Mon, 07 Nov 2022 11:10:18 -0800 (PST) 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=fail header.i=@nbd.name header.s=20160729 header.b=C7Bjul4L; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232187AbiKGS4L (ORCPT + 92 others); Mon, 7 Nov 2022 13:56:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232942AbiKGSzn (ORCPT ); Mon, 7 Nov 2022 13:55:43 -0500 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69B1B24953; Mon, 7 Nov 2022 10:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=R2N+jSfSlY43TnrF1h50zfC2H3h4TDeeUUxvXDObycg=; b=C7Bjul4L+uZ5OTJN4pEVSnqlbL qxyo4As8AlXPlDIoxFGL6JtZIC9DUnL/tZB6t9okWkqhDmncnwapQ626TBPm0Dz0MUDeEqhd6hBbb EU5heDXhPmbjEPt2KSK7tCs5w0nEpSdt9f0WnPmiV/Vd4yssvCnNedGvHg5vdVYP+9OI=; Received: from p200300daa72ee1007849d74f78949f6c.dip0.t-ipconnect.de ([2003:da:a72e:e100:7849:d74f:7894:9f6c] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1os7HA-000LCc-5E; Mon, 07 Nov 2022 19:55:16 +0100 From: Felix Fietkau To: netdev@vger.kernel.org, John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/14] net: ethernet: mtk_eth_soc: avoid port_mg assignment on MT7622 and newer Date: Mon, 7 Nov 2022 19:54:41 +0100 Message-Id: <20221107185452.90711-3-nbd@nbd.name> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221107185452.90711-1-nbd@nbd.name> References: <20221107185452.90711-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_NONE,SPF_NONE 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 newer chips, this field is unused and contains some bits related to queue assignment. Initialize it to 0 in those cases. Fix offload_version on MT7621 and MT7623, which still need the previous value. Signed-off-by: Felix Fietkau --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++-- drivers/net/ethernet/mediatek/mtk_ppe.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 02a57729db28..9f607c80f49c 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -4243,7 +4243,7 @@ static const struct mtk_soc_data mt7621_data = { .hw_features = MTK_HW_FEATURES, .required_clks = MT7621_CLKS_BITMAP, .required_pctl = false, - .offload_version = 2, + .offload_version = 1, .hash_offset = 2, .foe_entry_size = sizeof(struct mtk_foe_entry) - 16, .txrx = { @@ -4282,7 +4282,7 @@ static const struct mtk_soc_data mt7623_data = { .hw_features = MTK_HW_FEATURES, .required_clks = MT7623_CLKS_BITMAP, .required_pctl = true, - .offload_version = 2, + .offload_version = 1, .hash_offset = 2, .foe_entry_size = sizeof(struct mtk_foe_entry) - 16, .txrx = { diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c index 2d8ca99f2467..3ee2bf53f9e5 100644 --- a/drivers/net/ethernet/mediatek/mtk_ppe.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe.c @@ -175,6 +175,8 @@ int mtk_foe_entry_prepare(struct mtk_eth *eth, struct mtk_foe_entry *entry, val = FIELD_PREP(MTK_FOE_IB2_DEST_PORT_V2, pse_port) | FIELD_PREP(MTK_FOE_IB2_PORT_AG_V2, 0xf); } else { + int port_mg = eth->soc->offload_version > 1 ? 0 : 0x3f; + val = FIELD_PREP(MTK_FOE_IB1_STATE, MTK_FOE_STATE_BIND) | FIELD_PREP(MTK_FOE_IB1_PACKET_TYPE, type) | FIELD_PREP(MTK_FOE_IB1_UDP, l4proto == IPPROTO_UDP) | @@ -182,7 +184,7 @@ int mtk_foe_entry_prepare(struct mtk_eth *eth, struct mtk_foe_entry *entry, entry->ib1 = val; val = FIELD_PREP(MTK_FOE_IB2_DEST_PORT, pse_port) | - FIELD_PREP(MTK_FOE_IB2_PORT_MG, 0x3f) | + FIELD_PREP(MTK_FOE_IB2_PORT_MG, port_mg) | FIELD_PREP(MTK_FOE_IB2_PORT_AG, 0x1f); } -- 2.38.1