Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp348025rwb; Wed, 16 Nov 2022 01:16:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf7RUd8wcWUMi/ALJSC7TP/rnFrIHt5/uKFiXFbM9JFJ1qhS2yfGZYxK8rFTpKE1sYyHDSDw X-Received: by 2002:aa7:c54a:0:b0:459:9e3:c0b0 with SMTP id s10-20020aa7c54a000000b0045909e3c0b0mr17666707edr.279.1668590180587; Wed, 16 Nov 2022 01:16:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668590180; cv=none; d=google.com; s=arc-20160816; b=cycGc7kHAdxzAxo3x/oTHj7JP6Yv2doJiMTlMhSsc5A1xfeN4Mh1RLB8FKYy7U5jNX I39P81ylDqR7fr9aFkCTlsNlIT5pJvKQj1ivriO/KMnT2CaC4roBtn9nfXgqFSLSaXgR E5Mv/RK2dX+HDTzuZEcWI1WvGfIehw+kBmp4/BVzVLJw9DUPw1Kpiw53/Fi2FnEaWTZN aT6Uy0SAceRFlTU64h6Zi0zZu5Gjm9/EM8K/NBAC4x2Yqux9NlWJxJUppIxYQlzsNlku yBOxyjqjFe7/ikUjR2x24KRfDIEb2MItntwjRInsC2QeeptBdKLCcs6IEnr+tzGnhA3i HD3A== 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=QcTlWUKVC2/cQIdxmlzW6LcCIg0FG9Do0dcgy2oaaog=; b=Gj5tTVd3j9MEXl67JSSHa8oU9aH15FjiDlWdxQxbR7mfvOs+e9CT6t/aw6WxL+UaNA Y4I/qShrJJC+QV55TkGug0vSg9ZcuxdZ12BYu2BvOMmEl3RMz9upQ/dawHrdjeExB0f1 Ck9YA7QxXHwp+kRdFSXfX+deN+FGa/2o8vRnlfj5Z2ag4xwNBQwVyGfThPKdFFDIZ+cd 3WIyatRStnxicqHJ2uDB+nObhZR2RcJANL8HBrUTrckAYA+uOIVYqdwFlsicqTJLzEPB oBXA+qzU80p9LHSX0U4A3M0x+TUJ8ODBE8kfK4aCHAUv73ClAsrQsdlcgNJHyWR5QSxt auCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=FJlGLNJv; 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 z4-20020a1709063a0400b00780837381d8si10247129eje.591.2022.11.16.01.15.59; Wed, 16 Nov 2022 01:16:20 -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=FJlGLNJv; 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 S237900AbiKPIJO (ORCPT + 90 others); Wed, 16 Nov 2022 03:09:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238543AbiKPIIM (ORCPT ); Wed, 16 Nov 2022 03:08:12 -0500 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74577B845; Wed, 16 Nov 2022 00:07:56 -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=QcTlWUKVC2/cQIdxmlzW6LcCIg0FG9Do0dcgy2oaaog=; b=FJlGLNJvPDJXA0gr5HSzexYVcc g09gP2L2hebhW9VIKAAAAA3/6Ce6MVt1XHAZxUg+2XUONIFHodVoSKN/fK5vTvERzeMi1lYXi6Cfo gsLyQ1oyLSZHxVpVMv2BPt5JcoQtjzgeOFN+K61OIB4Ottq3Tu6Qv2sZCsgndLER6RJU=; Received: from p200300daa72ee10015f07c5633889601.dip0.t-ipconnect.de ([2003:da:a72e:e100:15f0:7c56:3388:9601] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1ovDSK-002Xoe-Vh; Wed, 16 Nov 2022 09:07:37 +0100 From: Felix Fietkau To: netdev@vger.kernel.org, John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , "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 net-next 3/6] net: ethernet: mtk_eth_soc: avoid port_mg assignment on MT7622 and newer Date: Wed, 16 Nov 2022 09:07:31 +0100 Message-Id: <20221116080734.44013-4-nbd@nbd.name> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116080734.44013-1-nbd@nbd.name> References: <20221116080734.44013-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 fbfc23923bf5..9e5545242216 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -4312,7 +4312,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 = { @@ -4351,7 +4351,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