Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp7152713ybf; Fri, 6 Mar 2020 11:22:54 -0800 (PST) X-Google-Smtp-Source: ADFU+vtKGEtOJEZng5IwjKcYL1JAywF3Bs3lqeo22KwIXnj6qoYy/+Cq2D4Udf0IAzjFP0JaH2Zh X-Received: by 2002:a9d:4702:: with SMTP id a2mr3721546otf.319.1583522574751; Fri, 06 Mar 2020 11:22:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583522574; cv=none; d=google.com; s=arc-20160816; b=KitRMRZAP3Ch5oGZpWxOCXKRuc/zBjmBc/etAmaDJH5w7llUJEqMBgGdjSwEXg3xWp TTnrNSzroPPcvWs5s2tZ1BqyxQeet55khoY3zk1/abYEMzCmzfosI+asUoEjJxAL4mSe /ajKGdvWaEf8XbzGcBg1ebQwXf70FdmMYeck3HGw1D94YghsChSQg07yt5wAxURk08qU ZvBHX2/OyHgFaHaUysMcEQZhdqnXQQPdOagI9/6e8e24QYqqD7xpJtMbM7W6aAHUshqP Q6u9TSB4fftZZIJiC2jogfWtzPdh/yHr+ceaofTTdRdQ5grwRIhZjE5C/Ior589pXugZ i7Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=hschn/q/TjKuSCvHILSN4JQXp6o8iK4T2BtsDUdVpSY=; b=Ih7vhzg00OEemyYHNvg+TDReB0B0ajbLzxQY/8e7H8yXylO4ZpI4ZxpVkZ7aksGMi9 J/DgA87R5ABvSBm4nenTHM9HIrQdAq4z+ZYIDSLISv6KIn3Kbo+o9ffgHtgu1NXzdgN7 PfO6pEPZnOkuddhK7Ylyk9u2YzfqFZrfHe1TIYyd4q06XS8xhDqWnsKN1zs2z6yLd5um vLQDGW4GRupf4OKGPr/Utzxk0/pJv9zwJzBw93oHajrAmPCsvS5zH0y6be0CCftu2Yke PklGgPsWyJVuDlNmoq1FSuz1lye9XaWEUSjzodfTcDUOyQIjS1EKPiAD1AW69zo8f8b9 HT4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v92si1896689otb.160.2020.03.06.11.22.42; Fri, 06 Mar 2020 11:22:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726368AbgCFTWV (ORCPT + 99 others); Fri, 6 Mar 2020 14:22:21 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:36065 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725873AbgCFTWV (ORCPT ); Fri, 6 Mar 2020 14:22:21 -0500 X-Originating-IP: 109.190.253.14 Received: from localhost (unknown [109.190.253.14]) (Authenticated sender: repk@triplefau.lt) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id D557360006; Fri, 6 Mar 2020 19:22:16 +0000 (UTC) From: Remi Pommarel To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu Cc: "David S. Miller" , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, Remi Pommarel Subject: [PATCH] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used Date: Fri, 6 Mar 2020 20:30:36 +0100 Message-Id: <20200306193036.18414-1-repk@triplefau.lt> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ACS (auto PAD/FCS stripping) removes FCS off 802.3 packets (LLC) so that there is no need to manually strip it for such packets. The enhanced DMA descriptors allow to flag LLC packets so that the receiving callback can use that to strip FCS manually or not. On the other hand, normal descriptors do not support that. Thus in order to not truncate LLC packet ACS should be disabled when using normal DMA descriptors. Signed-off-by: Remi Pommarel --- drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c index d0356fbd1e43..b468acf03b00 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c @@ -25,6 +25,7 @@ static void dwmac1000_core_init(struct mac_device_info *hw, struct net_device *dev) { void __iomem *ioaddr = hw->pcsr; + struct stmmac_priv *priv = netdev_priv(dev); u32 value = readl(ioaddr + GMAC_CONTROL); int mtu = dev->mtu; @@ -35,7 +36,7 @@ static void dwmac1000_core_init(struct mac_device_info *hw, * Broadcom tags can look like invalid LLC/SNAP packets and cause the * hardware to truncate packets on reception. */ - if (netdev_uses_dsa(dev)) + if (netdev_uses_dsa(dev) || !priv->plat->enh_desc) value &= ~GMAC_CONTROL_ACS; if (mtu > 1500) -- 2.25.0