Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp325062rwb; Wed, 16 Nov 2022 00:51:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf6XLPf6tMPJI2473dXECwr0pdvI7rwFw1dbuXfpv765OJo8lbtDKtM1YBTYwazr1f0rP3eV X-Received: by 2002:a63:ff1a:0:b0:476:7faf:e0bf with SMTP id k26-20020a63ff1a000000b004767fafe0bfmr12244599pgi.80.1668588668431; Wed, 16 Nov 2022 00:51:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668588668; cv=none; d=google.com; s=arc-20160816; b=GY9afI8X45flgUigkZ/6mLKnJca4A7JLfnL001jmvHWx9BmwsLlmvZnVowHao9WHun AwbCJR0OBhOb4Tug1hI/Z5QnE1XaBnHy69MM7ifc+M7BIwShOqYFTwUBS0ax/mKMy/oU SyeYPNdqL29fY23L78z2nxhgK2vHHu+247FQ/cQv/rYuMLn354zE95ZNYHq/A7BASR25 Ei4LgnQD5Q+Yv8JYjzk0C6GAEnaoILFPF9lXbBJfPRB20BabE1D/WomKL5WqPfBaQ0cL R7iHIXMwuk3I/yZ+xPImaQAN8b5XnMWHd8b7DbF+/oZ6NFhH2bmdWHjj+wgA5K3vEaZ/ Y1cQ== 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=PToLlVAdjcZ/qy/zoY1jvNL8DDMxZViTaE5aO1OxFHo=; b=px7BEHnM3R4M8D/2MsQ1yY31l9lF3tRJXAzKIyYjbaqAnJ2gJThk3CdZ9zCfZDIsjz l77qYQYrBxJWUats1KpzM2OGfDiES639gEqh52dfvwdoMu49SHZ09eIM527kAgKB47Q0 Zclmyu75Cd0dH9ropC4ESwiyoOMyOJow9T03nvqig+HC620JDWUWdTOwWMQTKE55JbVf dH7TtWefwbc/XWXb2W1SGzXMsiS1L2H2bovcfnKe+eyme6ezmNhSTQY1fVY8pj/xJO1F GxbJJLKRRk11UndF/6PPDDchpKHzLK6G8T/waF6j+qiAEM97bikynhMNHmqUIODDZczC XWaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=WiiMAUn8; 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 h6-20020a635306000000b0045ceafe40cesi15287187pgb.395.2022.11.16.00.50.56; Wed, 16 Nov 2022 00:51:08 -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=WiiMAUn8; 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 S238421AbiKPIIv (ORCPT + 91 others); Wed, 16 Nov 2022 03:08:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235752AbiKPIH7 (ORCPT ); Wed, 16 Nov 2022 03:07:59 -0500 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5391E0AE; Wed, 16 Nov 2022 00:07:53 -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=PToLlVAdjcZ/qy/zoY1jvNL8DDMxZViTaE5aO1OxFHo=; b=WiiMAUn8ypELNmPEL47UPh46Wh lYxMzkh1oUyIIvNQEEtzNNO1srId3ui2QnbTAovCxXFNyBnapZ9thCvrPeJqk0H7YQ6zS8sa1xLTm yzMZ/1nXkPtJxvJKgx7KrMLHBbsxNl9cgOtdLb4GGH14pYqpoxkc96tJjt1tIypnM19Q=; 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-A5; Wed, 16 Nov 2022 09:07:36 +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 2/6] net: ethernet: mtk_eth_soc: drop packets to WDMA if the ring is full Date: Wed, 16 Nov 2022 09:07:30 +0100 Message-Id: <20221116080734.44013-3-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 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 a9a6b53b4286..fbfc23923bf5 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -3393,9 +3393,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 72d3bfc2323d..eaaa0c67ef2a 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