Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2382520rwb; Mon, 7 Nov 2022 12:37:11 -0800 (PST) X-Google-Smtp-Source: AMsMyM48uRH5KaOTQuEJaCk6BMVj2PX5uQH9948x1AXQncNngunOB74TUXdpYq6aWMkQHDhuWG17 X-Received: by 2002:a17:906:8a6c:b0:7a8:2f09:d88d with SMTP id hy12-20020a1709068a6c00b007a82f09d88dmr49174130ejc.49.1667853430859; Mon, 07 Nov 2022 12:37:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667853430; cv=none; d=google.com; s=arc-20160816; b=rguoB7Rg2a2/TmQBkJLj6cXLBmCPMRIwhvsLcp8PuKnPTKCPHYxrybu5gWJzwE0lsP exWHGFlfa3SgfirvzUvbN0afdRPh6x9oFtK5rvpTX8B6N9SGh14o/0H+B9nSb7/3BtpX mMFQmV44oS5aL6BQzPnVhDDfVCsJn24y8zXohfew5coYN5ngXVFZfRp1xcvfus+RXLyD vBBZbHup7OxoCy5bjItT1t4EuzwbxbogWV87kwp3fvmwNCnyy8+UXVrH4NY0MR6jP96E jz1cDykj8UBOJbhhiUwZo6UwI57+b6sSmLvARfu8l4oBe0Wzix4pZHFpyQMoBzB/ekgs H/ZA== 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=5ieiAxhifSMyQ4MxSnOsIKCi9Eh84IdHGfPjBjh2Hno=; b=jlSNZ0n+183Yofi3afE7SBzAD46zvMKXkWVLUxuT0qkpgbU1wjsdmiGinBwCY1G8pK iLJ25HHdKKPVWKu5QIZbUydO40fhFMievND3rNseplPA4iTrIFULlVBtmXMSj/pYSJDZ AfKOEIHa/dOiY9em0YeKyc1fq5FzYp7jdWrL9K3xs7MjXRyryvwTL8OPlbo2oGBEbH/m uNQIZAh9F335uBvnPxg1zxelvLZkpzNJPA/jk19VxDtMzaQpXA4II0AtJ4hEQQ73SplV MZLOAJPpqpMXjlv26utRwAz8CohHkLaA73TO+N16Pk7/AJgnbMqXW64u6t5ISUoB8HbX EOGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=fh+rYeK1; 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 by12-20020a0564021b0c00b00462d53d6de6si8372890edb.10.2022.11.07.12.36.47; Mon, 07 Nov 2022 12:37:10 -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=fh+rYeK1; 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 S231705AbiKGT0I (ORCPT + 93 others); Mon, 7 Nov 2022 14:26:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232601AbiKGTZz (ORCPT ); Mon, 7 Nov 2022 14:25:55 -0500 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB46E2AC73; Mon, 7 Nov 2022 11:25:54 -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=5ieiAxhifSMyQ4MxSnOsIKCi9Eh84IdHGfPjBjh2Hno=; b=fh+rYeK17i703PklQYs1GnZj8Y f5vZfagQdzCt9wXjqfxtHNlZIdAM53JDmm+IwWUapnaFa4G6gsdpTOpbgj6ZtC11spai+rqg8ir6l jNiDa95qAoAoe/9Ydlgi2YCvzf8hPn5twSqDAP+MxbLGHFG63nzZ9/RTqm8v68cWJXHU=; 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 1os7HI-000LCc-Ht; Mon, 07 Nov 2022 19:55:24 +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 14/14] net: ethernet: mtk_eth_soc: drop packets to WDMA if the ring is full Date: Mon, 7 Nov 2022 19:54:52 +0100 Message-Id: <20221107185452.90711-14-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 Improves handling of DMA ring overflow. Clarify other WDMA drop related comment. Signed-off-by: Felix Fietkau --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 5 ++++- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 50756c8aa871..4bd06ab1a2b5 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -3529,9 +3529,12 @@ static int mtk_hw_init(struct mtk_eth *eth) mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { - /* PSE should not drop port8 and port9 packets */ + /* PSE should not drop port8 and port9 packets from WDMA Tx */ mtk_w32(eth, 0x00000300, PSE_DROP_CFG); + /* PSE should drop packets to port 8/9 on WDMA Rx ring full */ + mtk_w32(eth, 0x00000300, PSE_PPE0_DROP); + /* PSE Free Queue Flow Control */ mtk_w32(eth, 0x01fa01f4, PSE_FQFC_CFG2); diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h index bf8c7d11df9f..226022346369 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -124,6 +124,7 @@ #define PSE_FQFC_CFG1 0x100 #define PSE_FQFC_CFG2 0x104 #define PSE_DROP_CFG 0x108 +#define PSE_PPE0_DROP 0x110 /* PSE Input Queue Reservation Register*/ #define PSE_IQ_REV(x) (0x140 + (((x) - 1) << 2)) -- 2.38.1