Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp578905yba; Mon, 1 Apr 2019 12:13:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJy4lZpMPmYgRe9XuK0jiPaXbtLmFt2oKJcy8Yy8zRhOf1ZEiIksjjnEB1a7AZB69g150s X-Received: by 2002:aa7:8ac8:: with SMTP id b8mr1923580pfd.234.1554146030351; Mon, 01 Apr 2019 12:13:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554146030; cv=none; d=google.com; s=arc-20160816; b=OBXiJkaMp175j3HzioBgDOOawspreEsiTx20SLbtuEvwkUdAi4aNP2qnNGZcc/xcRk 9dz7by/OvaDlBFszD1Fm9rHIXcG3A3M/7xDQSHqVekRVcbwENirX4/WnqvVFg2iK9uBM yFez01HqX2w5R/aQikIWHqhDdHs2H1aplqhq7YGhhK6HjWtI0k9ltXyI9KX5qc7td5mG GxE6W9wlWpfPJKA8nhFRFBEtsGa82dFHokkSvX0/Yc/elXD2kexud/PGgxVirGitkR/X JK7yl2iJqYKHYrDchRU64Bso8IiaQrFWiWf9eYBHi3NPO74GoJuAgTN9ITWyxfEkVMeP yhOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=OBiJ4l6VIyRZ4mgvQ8o2iiTMVszaJD9xJFdBSNUfr4Q=; b=lvoVImWW4yHkYTZ4OhnckN8o+OBglowIge39+MpISP4qggTk62U5O9VP0DwRgncnlu j7tKmiRwxSlZ4wpg1vsDY0JvioSxHHe15y3lyRFkJhUARwsyyvdQEjMMxUG/dCbCru4i f7thIE4D5mHglY6XZVxCBjTGD5Geslyg4geDDF2sWIVbr2zUVqDzwNIArkYeFGAoYzGJ 7bN0fvDXThMXvcGSRQ9u6vvfV4Jss8EAXscJ6nColkBZg9RdCIDokmQKwq4N76va+78P M4zWidXgHnnSZrvy3cqd2yMIpQukbFw/RrNNXn09S4MxWIG2i4Fu0Wf/1L2NHk/QBvrD lcaw== 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 l3si8973161pgj.136.2019.04.01.12.13.35; Mon, 01 Apr 2019 12:13:50 -0700 (PDT) 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 S1729043AbfDATMa convert rfc822-to-8bit (ORCPT + 99 others); Mon, 1 Apr 2019 15:12:30 -0400 Received: from vegas.theobroma-systems.com ([144.76.126.164]:48621 "EHLO mail.theobroma-systems.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728716AbfDATM3 (ORCPT ); Mon, 1 Apr 2019 15:12:29 -0400 Received: from 178-18-171-174.customer.bnet.at ([178.18.171.174]:54157 helo=[192.168.2.179]) by mail.theobroma-systems.com with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hB2M2-0003dt-7r; Mon, 01 Apr 2019 21:12:22 +0200 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: [PATCH 1/2] stmmac: introduce flag to dynamically disable TX offload for rockchip devices From: Philipp Tomsich In-Reply-To: <2312344.mOsv7YkeBG@diego> Date: Mon, 1 Apr 2019 21:12:21 +0200 Cc: Robin Murphy , "Leonidas P. Papadakos" , Maxime Coquelin , Alexandre Torgue , netdev@vger.kernel.org, Jose Abreu , LKML , Linux ARM , Klaus Goger Content-Transfer-Encoding: 8BIT Message-Id: <9EC67532-2D43-4AAD-BFA7-8B6797067427@theobroma-systems.com> References: <20190401181840.31255-1-papadakospan@gmail.com> <9d65a22a-2288-dc53-0059-ec4a31424dd8@arm.com> <2312344.mOsv7YkeBG@diego> To: =?utf-8?Q?Heiko_St=C3=BCbner?= , =?utf-8?Q?Christoph_M=C3=BCllner?= X-Mailer: Apple Mail (2.3445.9.1) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + Christoph. > On 01.04.2019, at 21:06, Heiko Stübner wrote: > > Am Montag, 1. April 2019, 20:54:45 CEST schrieb Robin Murphy: >> On 01/04/2019 19:18, Leonidas P. Papadakos wrote: >>> From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= >>> >>> Some rockchip boards exhibit an issue where tx checksumming does not work with >>> packets larger than 1498. >> >> Is it really a board-level problem? I'm no networking expert, but the >> nature of the workaround suggests this is more likely to be some >> inherent limitation of the IP block in the SoC, rather than something to >> do with how the external pins get wired up. Does anyone have an RK3328 >> or RK3399 board that provably *does* checksum large packets correctly? > > I don't have that many rk3399-boards with actual ethernet and even only > the rock64 from rk3328-land, but at least my rk3399-firefly also seems > affected by this. > > But so far the rk3399-puma board from Theobroma did not show that ethernet > issue for me, so I've added two Theobroma people who may or may not tell > if they've also seen that issue. > >> >>> This is bad for network stability. >>> >>> The previous approach was using force_thresh_dma_mode in the board dts, which >>> does more than we need. >> >> If indeed it is a SoC-level thing (or at least we want to treat it as >> such), then couldn't we just hang it off the existing SoC-specific >> compatibles in dwmac-rk.c and avoid the need for a new DT property at >> all? After all, that's precisely why SoC-specific compatibles are a >> thing in the first place. >> >> Robin. >> >>> Signed-off-by: Leonidas P. Papadakos >>> --- >>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++ >>> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 ++ >>> include/linux/stmmac.h | 1 + >>> 3 files changed, 7 insertions(+) >>> >>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>> index 6a2e1031a..4552147e9 100644 >>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c >>> @@ -3660,6 +3660,10 @@ static netdev_features_t stmmac_fix_features(struct net_device *dev, >>> if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN)) >>> features &= ~NETIF_F_CSUM_MASK; >>> >>> + /* Including very small MTUs of 1498 for Rockchip devices */ >>> + if (priv->plat->bugged_tx_coe && (dev->mtu > ETH_DATA_LEN - 2)) >>> + features &= ~NETIF_F_CSUM_MASK; >>> + >>> /* Disable tso if asked by ethtool */ >>> if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { >>> if (features & NETIF_F_TSO) >>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c >>> index 3031f2bf1..807cf5826 100644 >>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c >>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c >>> @@ -519,6 +519,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac) >>> pr_warn("force_sf_dma_mode is ignored if force_thresh_dma_mode is set."); >>> } >>> >>> + plat->bugged_tx_coe = of_property_read_bool(np, "rockchip,bugged_tx_coe"); >>> + >>> of_property_read_u32(np, "snps,ps-speed", &plat->mac_port_sel_speed); >>> >>> plat->axi = stmmac_axi_setup(pdev); >>> diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h >>> index 4335bd771..60c411f43 100644 >>> --- a/include/linux/stmmac.h >>> +++ b/include/linux/stmmac.h >>> @@ -162,6 +162,7 @@ struct plat_stmmacenet_data { >>> int pmt; >>> int force_sf_dma_mode; >>> int force_thresh_dma_mode; >>> + int bugged_tx_coe; >>> int riwt_off; >>> int max_speed; >>> int maxmtu; >>> >> > > > >