From owner-svn-src-all@freebsd.org Mon Mar 21 03:16:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA626AD6AC4; Mon, 21 Mar 2016 03:16:57 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC68D6E; Mon, 21 Mar 2016 03:16:57 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L3GuhN091544; Mon, 21 Mar 2016 03:16:56 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L3GuXO091542; Mon, 21 Mar 2016 03:16:56 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603210316.u2L3GuXO091542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 21 Mar 2016 03:16:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297132 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 03:16:58 -0000 Author: loos Date: Mon Mar 21 03:16:56 2016 New Revision: 297132 URL: https://svnweb.freebsd.org/changeset/base/297132 Log: Enable multicast addresses on vlan ports. Fixes the reception of broadcast packets on vlan aware mode. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswreg.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Mon Mar 21 02:38:21 2016 (r297131) +++ head/sys/arm/ti/cpsw/if_cpsw.c Mon Mar 21 03:16:56 2016 (r297132) @@ -140,7 +140,8 @@ static void cpsw_ale_read_entry(struct c static void cpsw_ale_write_entry(struct cpsw_softc *, uint16_t, uint32_t *); static int cpsw_ale_mc_entry_set(struct cpsw_softc *, uint8_t, int, uint8_t *); static void cpsw_ale_dump_table(struct cpsw_softc *); -static int cpsw_ale_update_vlan_table(struct cpsw_softc *, int, int, int); +static int cpsw_ale_update_vlan_table(struct cpsw_softc *, int, int, int, int, + int); static int cpswp_ale_update_addresses(struct cpswp_softc *, int); /* Statistics and sysctls. */ @@ -1148,8 +1149,9 @@ cpswp_init_locked(void *arg) cpsw_write_4(sc->swsc, CPSW_PORT_P_VLAN(sc->unit + 1), sc->vlan & 0xfff); cpsw_ale_update_vlan_table(sc->swsc, sc->vlan, - (1 << (sc->unit + 1)) | (1 << 0), - (1 << (sc->unit + 1)) | (1 << 0)); + (1 << (sc->unit + 1)) | (1 << 0), /* Member list */ + (1 << (sc->unit + 1)) | (1 << 0), /* Untagged egress */ + (1 << (sc->unit + 1)) | (1 << 0), 0); /* mcast reg flood */ } mii_mediachg(sc->mii); @@ -2368,7 +2370,8 @@ cpswp_ale_update_addresses(struct cpswp_ } static int -cpsw_ale_update_vlan_table(struct cpsw_softc *sc, int vlan, int ports, int untag) +cpsw_ale_update_vlan_table(struct cpsw_softc *sc, int vlan, int ports, + int untag, int mcregflood, int mcunregflood) { int free_index, i, matching_index; uint32_t ale_entry[3]; @@ -2394,7 +2397,8 @@ cpsw_ale_update_vlan_table(struct cpsw_s i = free_index; } - ale_entry[0] = (untag & 7) << 24 | (ports & 7); + ale_entry[0] = (untag & 7) << 24 | (mcregflood & 7) << 16 | + (mcunregflood & 7) << 8 | (ports & 7); ale_entry[1] = ALE_TYPE_VLAN << 28 | vlan << 16; ale_entry[2] = 0; cpsw_ale_write_entry(sc, i, ale_entry); Modified: head/sys/arm/ti/cpsw/if_cpswreg.h ============================================================================== --- head/sys/arm/ti/cpsw/if_cpswreg.h Mon Mar 21 02:38:21 2016 (r297131) +++ head/sys/arm/ti/cpsw/if_cpswreg.h Mon Mar 21 03:16:56 2016 (r297132) @@ -98,8 +98,8 @@ #define ALE_TYPE_VLAN 2 #define ALE_TYPE_VLAN_ADDR 3 #define ALE_VLAN(_a) ((_a[1] >> 16) & 0xfff) -#define ALE_VLAN_REGFLOOD(_a) ((_a[0] >> 8) & 7) -#define ALE_VLAN_UNREGFLOOD(_a) ((_a[0] >> 16) & 7) +#define ALE_VLAN_UNREGFLOOD(_a) ((_a[0] >> 8) & 7) +#define ALE_VLAN_REGFLOOD(_a) ((_a[0] >> 16) & 7) #define ALE_VLAN_UNTAG(_a) ((_a[0] >> 24) & 7) #define ALE_VLAN_MEMBERS(_a) (_a[0] & 7) #define CPSW_ALE_PORTCTL(p) (CPSW_ALE_OFFSET + 0x40 + ((p) * 0x04))