From patchwork Mon Apr 18 12:15:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 611717 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (caladan.dune.hu [78.24.191.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qpRvN2yQ5z9t3l for ; Mon, 18 Apr 2016 22:16:14 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=open-mesh-com.20150623.gappssmtp.com header.i=@open-mesh-com.20150623.gappssmtp.com header.b=cAcL/2B+; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 8471EB911F0; Mon, 18 Apr 2016 14:15:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,RDNS_NONE, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Mon, 18 Apr 2016 14:15:53 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 83321B911EB for ; Mon, 18 Apr 2016 14:15:52 +0200 (CEST) X-policyd-weight: using cached result; rate: -7 Received: from mail-wm0-f50.google.com (unknown [74.125.82.50]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 18 Apr 2016 14:15:52 +0200 (CEST) Received: by mail-wm0-f50.google.com with SMTP id v188so116521634wme.1 for ; Mon, 18 Apr 2016 05:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=iCUIfnh/QzkXgAhkADrnMIfPo8p+gHM6j+tyI7Ixd9M=; b=cAcL/2B+w0dtCAU9mjeEl0U9bLNxQVfOE6JM3MH1z2O9FpWiL0rLWuqBG4HCS+GxbT wOEzDzpq403e5XP0lLhweG38TO/AJJJbiVRBbZ5zCFn00eseRxvl2gvla5qNtyqX6J6i HEKTbEo1pFBENcz4/0BKCGEk9HbC6+NB2Nd7DQI3cTSkmVfQ9s0GW5tikB1HjQTanUo9 8ue3/q7LVj5FeZ83pksyxJ30Gsi48JOOTo704t9RaMaqb7AbVzEl1dgRlkH1JnhciFuO PsT943uXOXX6lVrymbgrKEi1GEMPyb5JQa/9JAB+gb6ZRWU5Gt/TBCVFiZpuViRGEQX1 W2Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iCUIfnh/QzkXgAhkADrnMIfPo8p+gHM6j+tyI7Ixd9M=; b=ck1yZU8VuE8mXkxHWk5nbfEkIhZ5kX7FptcILPa0AuTOq21w7OcPiffr/pTejcw0SN EWgRYNy4YAaCF3pmGlTm/omGMboaSNZi464M7F0np3AAhbc/ipjjQjtSXIPvNA/rdCZT 4WW9oLdl2ZAWknAixWjFwvNF4iFZzNkLsMABR5Ya1l63eIvVr0g13OZRmUvQDtDZMfDy y9GZLY32y2C4JBJ6vys4wAyjEEcFjCnRU46Ty+UQ7ToCVfog4i8+UHUG4PNSjtgCNJ8a DAns/Ll1hX0hcVVwhjrqilDslgQTJst4VLBfrUfbExs6/BwylvYQWykKGcK9latw67QW EV9Q== X-Gm-Message-State: AOPr4FXkQDGtklA65FBiqI8XdE7sOZev6FInlESyVMk/xkKf3fDCXeZs/EmN+QkgcCGUJiBy X-Received: by 10.28.53.193 with SMTP id c184mr367273wma.93.1460981751825; Mon, 18 Apr 2016 05:15:51 -0700 (PDT) Received: from sven-desktop.home.narfation.org (p4FFE454E.dip0.t-ipconnect.de. [79.254.69.78]) by smtp.gmail.com with ESMTPSA id c144sm53232811wmd.0.2016.04.18.05.15.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Apr 2016 05:15:51 -0700 (PDT) From: Sven Eckelmann X-Google-Original-From: Sven Eckelmann To: openwrt-devel@lists.openwrt.org Date: Mon, 18 Apr 2016 14:15:42 +0200 Message-Id: <1460981742-17048-1-git-send-email-sven@open-mesh.com> X-Mailer: git-send-email 2.8.0.rc3 Subject: [OpenWrt-Devel] [RFC] ag71xx: Enable flow control for builtin switch port X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Eckelmann MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" From: Sven Eckelmann The port connected to the internal switch tends to drop a lot of packets when a lot of data is transferred over it. This is especially visible when IP fragmentation happens for large UDP and ICMP packets. An easy test for this is # works ping 192.168.1.23 # doesn't work ping -s 65507 192.168.1.23 But enabling flow control on ports without the builtin switch seems to break the connection completely in some situations. This was for example detected when a QCA955x with AR98533 on GMAC1 was started with an active link on this port. So only enable it for SoC ethernet devices with switch attached. This closes #19498 Signed-off-by: Sven Eckelmann --- This is only an RFC because Felix reverted a similar change in r27034. Unfortunately, the revert commit doesn't contain enough information to find out if this problem would also happen when only activating flow control on the switch port port or when only enabling TX and not RX flow control (or the other way around). .../ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index 0832059..208b1d6 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -455,7 +455,11 @@ static void ag71xx_hw_setup(struct ag71xx *ag) struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag); /* setup MAC configuration registers */ - ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, MAC_CFG1_INIT); + if (pdata->is_ar724x && pdata->switch_data) + ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, + MAC_CFG1_INIT | MAC_CFG1_TFC | MAC_CFG1_RFC); + else + ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, MAC_CFG1_INIT); ag71xx_sb(ag, AG71XX_REG_MAC_CFG2, MAC_CFG2_PAD_CRC_EN | MAC_CFG2_LEN_CHECK);