From patchwork Fri Aug 24 09:04:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 961748 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="k8MPpSHj"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41xb2j4gVfz9s3C for ; Fri, 24 Aug 2018 19:05:01 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727261AbeHXMil (ORCPT ); Fri, 24 Aug 2018 08:38:41 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:37603 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbeHXMig (ORCPT ); Fri, 24 Aug 2018 08:38:36 -0400 Received: by mail-wr1-f65.google.com with SMTP id u12-v6so5576489wrr.4 for ; Fri, 24 Aug 2018 02:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=z4ffCXzbbDJPOq/rb6uuve93foFOxyU52TMljzPih58=; b=k8MPpSHj1ACjeQRBbx3gDxNVTKVbqx3BXo0cplaQiykDztOJ6CokFkInlg9y3SgXW+ O//r2kVi6extVZx2NS9yM50gABGlv+dg3mTsF+Lh3SGVxRNoTqQ1km13gGonLlPCZcH+ vhR1jvEQgaODkzTN8gN/6xOT0/zl1hAjvVIiYnIG2hShkPh4rWw8YadDTWSqlSStYpYF kO1ZZ25aoVxhB4ggfH/HSCCTwRwSAsvfUoXTVirm1na3mpd6Vaj88oXVLjuajpnM3NT0 WiBbiu02KMP3cEler9cW/Ju8XxeW2BPE0WGB2w1wR+GNSs1w8lZVLnH188tJ44xGfI34 BlHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=z4ffCXzbbDJPOq/rb6uuve93foFOxyU52TMljzPih58=; b=b/1lUPOy3y0A/82eAealc57F0Y0YxhIwR8E79YVIctdN6mzBq/BLfYq29twVCnzP9i a5eyXoJ9+HKK54cU3607sImk4/1O4vhSdkNFcpMs2B5fQo0NFhKs+7DZ36o27Vp413sv NoziI3e4bkMx2JquYl/t7oBq3fRMfJdpCeBdylWB2llqaX5uHLr0Ka0Psgom4Q2hgGtC nRdX9YEhz0/LM8UHeXlgUnRmD0KLoEZLVqZJKiqyEvLVij6K5J4fUYX7DEpWz3cKWbXx whObUDdNFKyiAgBDIUh4OsqsqNDAFptCSsuq/1aMo33epxlZKGx7YkHjRQn9i+OBnmwr 9VwQ== X-Gm-Message-State: APzg51CGBlTpvUr854CkOqkkyb9Wm57+bunCiCRxDzrIM4tPjhmZTSRI hPbawZK15WJTym4sdxIKk2BOUQ== X-Google-Smtp-Source: ANB0VdaiiuDtTra1UMpQxVn4G67i2ZhXpx6RrxcQJ2haX/v/ALDcDyirEwq26zOY/n1qI8VCWT6Ong== X-Received: by 2002:adf:8325:: with SMTP id 34-v6mr633131wrd.67.1535101492843; Fri, 24 Aug 2018 02:04:52 -0700 (PDT) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id h75-v6sm2690896wma.46.2018.08.24.02.04.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Aug 2018 02:04:52 -0700 (PDT) From: Jerome Brunet To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , netdev@vger.kernel.org Cc: Jerome Brunet , linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, Joao Pinto , Vitor Soares , Corentin Labbe Subject: [PATCH] Revert "net: stmmac: Do not keep rearming the coalesce timer in stmmac_xmit" Date: Fri, 24 Aug 2018 11:04:40 +0200 Message-Id: <20180824090440.13411-1-jbrunet@baylibre.com> X-Mailer: git-send-email 2.17.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This reverts commit 4ae0169fd1b3c792b66be58995b7e6b629919ecf. This change in the handling of the coalesce timer is causing regression on (at least) amlogic platforms. Network will break down very quickly (a few seconds) after starting a download. This can easily be reproduced using iperf3 for example. The problem has been reported on the S805, S905, S912 and A113 SoCs (Realtek and Micrel PHYs) and it is likely impacting all Amlogics platforms using Gbit ethernet No problem was seen with the platform using 10/100 only PHYs (GXL internal) Reverting change brings things back to normal and allows to use network again until we better understand the problem with the coalesce timer. Cc: Jose Abreu Cc: Joao Pinto Cc: Vitor Soares Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Corentin Labbe Signed-off-by: Jerome Brunet --- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 - drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h index 76649adf8fb0..c0a855b7ab3b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h @@ -112,7 +112,6 @@ struct stmmac_priv { u32 tx_count_frames; u32 tx_coal_frames; u32 tx_coal_timer; - bool tx_timer_armed; int tx_coalesce; int hwts_tx_en; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index ff1ffb46198a..9f458bb16f2a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3147,16 +3147,13 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) * element in case of no SG. */ priv->tx_count_frames += nfrags + 1; - if (likely(priv->tx_coal_frames > priv->tx_count_frames) && - !priv->tx_timer_armed) { + if (likely(priv->tx_coal_frames > priv->tx_count_frames)) { mod_timer(&priv->txtimer, STMMAC_COAL_TIMER(priv->tx_coal_timer)); - priv->tx_timer_armed = true; } else { priv->tx_count_frames = 0; stmmac_set_tx_ic(priv, desc); priv->xstats.tx_set_ic_bit++; - priv->tx_timer_armed = false; } skb_tx_timestamp(skb);