From patchwork Sat Jan 31 09:28:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 435111 X-Patchwork-Delegate: nbd@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B885D1402CF for ; Sat, 31 Jan 2015 20:31:50 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id CD39728BD93; Sat, 31 Jan 2015 10:27:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, T_DKIM_INVALID autolearn=no version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 50F6028B43D for ; Sat, 31 Jan 2015 10:27:17 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -8.5 Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sat, 31 Jan 2015 10:27:14 +0100 (CET) Received: by mail-wi0-f173.google.com with SMTP id r20so7628156wiv.0 for ; Sat, 31 Jan 2015 01:29:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=9bN4pGi+MNvk5LpuHsWSYOxJ83Kr69C78u63L0nddY8=; b=FC2aGLdfjsdJP42E3IsgJ6VHJBKeSpxEix66s6+eMoP+uwSv8c3ruerATaW9DEXJJM EymtWiYFOfH0e2qMKQsb2QU+ZOz+zEb1LKK8pIzoIZbuVklOpSwxcDGR6TmvEtLTUE2k VqK6p2Sis2cwYNV85MI3gPM9qjUJxOS1eUhJgftSy/eTxOnTEfd2573kVOFRISj4KWcW Oakioi6cms80NpoApUmCVsDDaOsuyDY16SKd2TXqDhi/J6jg73ZSb59M/757iTVLtHc2 5RDsdFhTQkZAyF2wl7FwdPaUsgm9ptexi08Xztr0Z/6GRKl1rkhPeI8uUMPgOpxsPJot EeFQ== X-Received: by 10.194.243.1 with SMTP id wu1mr20545834wjc.69.1422696582430; Sat, 31 Jan 2015 01:29:42 -0800 (PST) Received: from ?IPv6:2003:63:231f:ff00:a574:a623:8907:1aab? (p20030063231FFF00A574A62389071AAB.dip0.t-ipconnect.de. [2003:63:231f:ff00:a574:a623:8907:1aab]) by mx.google.com with ESMTPSA id bo3sm18474629wjb.44.2015.01.31.01.29.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Jan 2015 01:29:42 -0800 (PST) Message-ID: <54CCA035.8070302@gmail.com> Date: Sat, 31 Jan 2015 10:28:21 +0100 From: Heiner Kallweit User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Felix Fietkau Cc: OpenWrt Development List Subject: [OpenWrt-Devel] [PATCH 3/4] ar8216: adjust ATU flushing in case of link changes X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" If a link goes down, don't flush the complete ARL table. Only flush the entries for the respective port. Don't touch ARL table if a link goes up. Signed-off-by: Heiner Kallweit --- target/linux/generic/files/drivers/net/phy/ar8216.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index f4c7b8d..9065915 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -1882,13 +1882,13 @@ ar8xxx_check_link_states(struct ar8xxx_priv *priv) priv->link_up[i] = link_new; changed = true; + /* flush ARL entries for this port if it went down*/ + if (!link_new) + priv->chip->atu_flush_port(priv, i); dev_info(&priv->phy->dev, "Port %d is %s\n", i, link_new ? "up" : "down"); } - if (changed) - priv->chip->atu_flush(priv); - mutex_unlock(&priv->reg_mutex); return changed; @@ -1900,9 +1900,7 @@ ar8xxx_phy_read_status(struct phy_device *phydev) struct ar8xxx_priv *priv = phydev->priv; struct switch_port_link link; - /* check for link changes and flush ATU - * if a change was detected - */ + /* check for switch port link changes */ if (phydev->state == PHY_CHANGELINK) ar8xxx_check_link_states(priv);