Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp836800rwb; Wed, 9 Nov 2022 09:10:53 -0800 (PST) X-Google-Smtp-Source: AMsMyM6NK0XFsXa2SHVOk23KK7P4O4dQpm6vPcHehBOPaKwRtFvJozBoLIb4bEENnz+mdiQZwzWo X-Received: by 2002:a17:907:2c63:b0:7ad:e1d6:280b with SMTP id ib3-20020a1709072c6300b007ade1d6280bmr1390235ejc.512.1668013853640; Wed, 09 Nov 2022 09:10:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668013853; cv=none; d=google.com; s=arc-20160816; b=JRfiecaLpVGnaP1VMD2fZJ4HspiyrwfAOFnTYVBf2LLJrxJKwfZ1Y6ciwXB2GmRdRm BgEag5S65YNEiqjh4Sb7jh1JZf7aJ58AlNYFOtYLP/l5uLE0ghh3PUFOKho9pk3pU1LF qo5hRibuWpfiJVLnkGsGB/7OzwIrwFi5k3uZYHjw8PI1fi3dhs+GwaNoKLz4DJKr2I6q wNdk5R0eJUYEbRcaQOA0QAp+gABO2DnHDgxNPklDqIrcCo8JvtCKUvFr2JlCvmLr2H4a kyVOJskSUrCVBcoST3wRGtCk6VBeUCjKVZ8+4ItwzYmqCAyTD5xYh1qaHGnL5iSKVhIY m26g== 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=8c7pffncEhfwqoQQg2EC0YEAcAl6M2qtlXdIEqg+CSM=; b=HYkqVNFR+x7vllKJrAchTz+3Mn9YBUwyU9tHFyef00cKR25tMkDa5WQHCs9yxlbX6R Hty44EhQCs18zWc3EnRIErN5BrfJWFhMbKjdxt0H1iDTrB1ZEpWmey5TkHlQtPthDtFq NP9FPPFCOeaH2DJYAGbxdG3MZjxYgQRpS55YKbEV9GrkohUlMABNKRBb5xLL+WtCAwHU 99mwvb/wt2gNDMv0zUyXOf1y/4XMXon2n5EtjZGsbfjldKYITcrDtuSLBZyBnH3cYAZ3 ZmdiVBLJ/ReI8fCzmyt+Va77+yvrG0UOflSZOQI4H4pJl4Xddfy53PG859oE2juq0Fa2 zO7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=mrd2aWMd; 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 d20-20020aa7d694000000b0045d25cf222csi14508189edr.362.2022.11.09.09.10.30; Wed, 09 Nov 2022 09:10:53 -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=mrd2aWMd; 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 S231272AbiKIQyM (ORCPT + 93 others); Wed, 9 Nov 2022 11:54:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbiKIQxm (ORCPT ); Wed, 9 Nov 2022 11:53:42 -0500 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8D8B27CC7; Wed, 9 Nov 2022 08:52:49 -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=8c7pffncEhfwqoQQg2EC0YEAcAl6M2qtlXdIEqg+CSM=; b=mrd2aWMdxVqcU8TFF6WqiZqyT/ //ulOpV9zGWyyMeig9++5Qp0UrBjXcG8T1hnFhxumHk/+uzOdTRTDwRiIGH2obFvZh26D5UqQluZU pmc6EWYfD0FlaEUD6BtAZoAr8aiM2Brr/52O0g2Xx19AdwpZQ/LmU3JGzBFNwYifC9UY=; Received: from p200300daa72ee100054f3c61b16ef6e7.dip0.t-ipconnect.de ([2003:da:a72e:e100:54f:3c61:b16e:f6e7] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1oso2C-000l4N-FT; Wed, 09 Nov 2022 17:34:40 +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: Vladimir Oltean , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 12/12] net: ethernet: mtk_eth_soc: drop packets to WDMA if the ring is full Date: Wed, 9 Nov 2022 17:34:26 +0100 Message-Id: <20221109163426.76164-13-nbd@nbd.name> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221109163426.76164-1-nbd@nbd.name> References: <20221109163426.76164-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 a9a270317ff4..9aa4fa322794 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -3566,9 +3566,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 60da6936559a..fb876d2a6ea1 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -127,6 +127,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