From patchwork Thu Feb 25 15:05:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 588135 X-Patchwork-Delegate: zajec5@gmail.com 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A7B9114090B for ; Fri, 26 Feb 2016 02:06:09 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=vU2xiByU; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 2CEDB281450; Thu, 25 Feb 2016 16:06:01 +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.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 0CBBE2803F9 for ; Thu, 25 Feb 2016 16:05:54 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .gmail. - helo: .mail-wm0-f41.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 25 Feb 2016 16:05:53 +0100 (CET) Received: by mail-wm0-f41.google.com with SMTP id a4so31594092wme.1 for ; Thu, 25 Feb 2016 07:05:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=JPA4KLeo10PTD9+EtMAe04s5BVECl33oGxH8DSeChdI=; b=vU2xiByUQs29x6Tb8W8MpE/FBugoYxxFyHz+arFKLpKPG4cmIVbQ4/6L4QBtoxnEft 5B2Dc9yX0tVtPbAt5b2J6sP5g0OH4B3IQPjrB9mFiGMTZfHs/5xMpbJsP74bDuu6lb6j RiZFt9pqT8VFwa4FWmCItWx9wkEb74ZdzfxqvfWdYsYCvK7O7AglkA+/Bw1pX/TXsTYO 8lToCIXbI/PKVwKODIBs7b1ibDSy+6UZAEIwYJ+D4q63xmp1ckRElRZ7B7c/is8tQ2/3 bkKKH0rAoRUAnxZtRHUaBrDutcxcopy7qyzlJm4lHzgVeRwX18au0IWBQ3uF5TRhG2R+ uP8Q== 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=JPA4KLeo10PTD9+EtMAe04s5BVECl33oGxH8DSeChdI=; b=PHTmaJNQqCPIDHLlVjXOvhV4fK64xa4h+lXE0I1HMLSFRaDvwHXS6iW0EKl3JPCD30 xFqgooApkMT5zT8p3itMBITMRp11AtwJSyZWhTTfTxvsZYa9xesiLlIYLcZrHDXI5W2b aPvpSqZareyqw7y2iZmS+OorfiAuHwOiVwvIIbCoQzAC6tP7He4X/K/lWZEN7eQHQGj+ vSdKj014Eu/F530rHI49r0bUA+PI1pBKA+hj8orEVAd5LDeojgN3Awn491HJtD/ITExr VbQjznNv3Lgi7KRPbcZimt7rEJS89Qg4kO/H8L64uA63Wj5d//3QJI6u5zbGpvIvmvDu tdvg== X-Gm-Message-State: AG10YOSXLiI9mGfGtXDrZUWOvmmIKHXaf+9155l0Pq1eIH1UMTVkJ2aoL4W+loK9AE8JrQ== X-Received: by 10.194.143.82 with SMTP id sc18mr44249174wjb.14.1456412753013; Thu, 25 Feb 2016 07:05:53 -0800 (PST) Received: from localhost.localdomain ([5.2.198.78]) by smtp.gmail.com with ESMTPSA id x65sm3645308wmg.4.2016.02.25.07.05.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Feb 2016 07:05:52 -0800 (PST) From: Alexandru Ardelean X-Google-Original-From: Alexandru Ardelean To: openwrt-devel@lists.openwrt.org Date: Thu, 25 Feb 2016 17:05:49 +0200 Message-Id: <1456412749-23878-1-git-send-email-aardelean@riverbed.com> X-Mailer: git-send-email 2.7.1 Subject: [OpenWrt-Devel] [PATCH] b53: reset vlans data when setting 'enable_vlan' 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: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" From: Alexandru Ardelean In our case we don't call reset (to reset the chip and the driver) on each reconfigure. So, we can re-use the 'enable_vlan' call, because this gets called once on each switch re-configure and we can reset all previously set VLANs. Signed-off-by: Alexandru Ardelean --- target/linux/generic/files/drivers/net/phy/b53/b53_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c index 676e301..a6bde8f 100644 --- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c @@ -590,6 +590,8 @@ static int b53_global_set_vlan_enable(struct switch_dev *dev, struct b53_device *priv = sw_to_b53(dev); priv->enable_vlan = val->value.i; + /* Reset VLANs whenever calling this ; this would set the system to a deterministic state */ + memset(priv->vlans, 0, sizeof(*priv->vlans) * dev->vlans); return 0; }