From patchwork Tue Apr 26 11:45:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 92911 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 673C1B6F07 for ; Tue, 26 Apr 2011 21:45:59 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754888Ab1DZLpw (ORCPT ); Tue, 26 Apr 2011 07:45:52 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:50048 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754564Ab1DZLpv (ORCPT ); Tue, 26 Apr 2011 07:45:51 -0400 Received: by wya21 with SMTP id 21so369176wya.19 for ; Tue, 26 Apr 2011 04:45:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer; bh=fnwzwnKoqmyCPvaQtqTVgaCY3x0zqjEKYYWvNl6CHaE=; b=CHKmQGjoqjUx8cTCv2O9mEafyJTKnk8UmIkHP0UueNIZ/8hYc+sF99K+EQgcsLTZqE BwH1ZjmmWIdbAVF6tD/PnXCUzumFD+prqh6e0epEVqr0DCyZY0Rh58NSP8pBrpvVvrvR GYrjto7u/fK/PSSvCHrCgcE83mBZwzVH1QHpM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=lPcF1WZaJXxzD6i/zOzRocF17RrhbInr7O7l0MaMeioY44r4RjgsKnvrWK7LnRgo+F 9WnOk/4Ds2AqH+cAiae0PvHEASX78h/nMhHZL2OLFxqhjYT8sM4E7/RhSXc58UaOKm7y n7C8Fg0x1HxVmE8fU5wHmznZmY3IcEm/GV4zY= Received: by 10.227.11.146 with SMTP id t18mr685186wbt.104.1303818350284; Tue, 26 Apr 2011 04:45:50 -0700 (PDT) Received: from macbook.be.48ers.dk (191.207-78-194.adsl-fix.skynet.be [194.78.207.191]) by mx.google.com with ESMTPS id w25sm3796104wbd.5.2011.04.26.04.45.46 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 26 Apr 2011 04:45:48 -0700 (PDT) Received: by macbook.be.48ers.dk (Postfix, from userid 1000) id EC380C3AA9; Tue, 26 Apr 2011 13:45:42 +0200 (CEST) From: Peter Korsgaard To: davem@davemloft.net, buytenh@wantstofly.org, netdev@vger.kernel.org Cc: Peter Korsgaard Subject: [PATCH] dsa/mv88e6131: fix unknown multicast/broadcast forwarding on mv88e6085 Date: Tue, 26 Apr 2011 13:45:41 +0200 Message-Id: <1303818341-13839-1-git-send-email-jacmet@sunsite.dk> X-Mailer: git-send-email 1.7.2.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The 88e6085 has a few differences from the other devices in the port control registers, causing unknown multicast/broadcast packets to get dropped when using the standard port setup. At the same time update kconfig to clarify that the mv88e6085 is now supported. Signed-off-by: Peter Korsgaard Acked-by: Lennert Buytenhek --- net/dsa/Kconfig | 4 ++-- net/dsa/mv88e6131.c | 26 +++++++++++++++++++++----- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig index 87bb5f4..c53ded2 100644 --- a/net/dsa/Kconfig +++ b/net/dsa/Kconfig @@ -41,12 +41,12 @@ config NET_DSA_MV88E6XXX_NEED_PPU default n config NET_DSA_MV88E6131 - bool "Marvell 88E6095/6095F/6131 ethernet switch chip support" + bool "Marvell 88E6085/6095/6095F/6131 ethernet switch chip support" select NET_DSA_MV88E6XXX select NET_DSA_MV88E6XXX_NEED_PPU select NET_DSA_TAG_DSA ---help--- - This enables support for the Marvell 88E6095/6095F/6131 + This enables support for the Marvell 88E6085/6095/6095F/6131 ethernet switch chips. config NET_DSA_MV88E6123_61_65 diff --git a/net/dsa/mv88e6131.c b/net/dsa/mv88e6131.c index 3da4188..45f7411 100644 --- a/net/dsa/mv88e6131.c +++ b/net/dsa/mv88e6131.c @@ -207,8 +207,15 @@ static int mv88e6131_setup_port(struct dsa_switch *ds, int p) * mode, but do not enable forwarding of unknown unicasts. */ val = 0x0433; - if (p == dsa_upstream_port(ds)) + if (p == dsa_upstream_port(ds)) { val |= 0x0104; + /* + * On 6085, unknown multicast forward is controlled + * here rather than in Port Control 2 register. + */ + if (ps->id == ID_6085) + val |= 0x0008; + } if (ds->dsa_port_mask & (1 << p)) val |= 0x0100; REG_WRITE(addr, 0x04, val); @@ -251,10 +258,19 @@ static int mv88e6131_setup_port(struct dsa_switch *ds, int p) * If this is the upstream port for this switch, enable * forwarding of unknown multicast addresses. */ - val = 0x0080 | dsa_upstream_port(ds); - if (p == dsa_upstream_port(ds)) - val |= 0x0040; - REG_WRITE(addr, 0x08, val); + if (ps->id == ID_6085) + /* + * on 6085, bits 3:0 are reserved, bit 6 control ARP + * mirroring, and multicast forward is handled in + * Port Control register. + */ + REG_WRITE(addr, 0x08, 0x0080); + else { + val = 0x0080 | dsa_upstream_port(ds); + if (p == dsa_upstream_port(ds)) + val |= 0x0040; + REG_WRITE(addr, 0x08, val); + } /* * Rate Control: disable ingress rate limiting.