Author: adrian Date: Tue Oct 20 21:18:02 2015 New Revision: 289665 URL: https://svnweb.freebsd.org/changeset/base/289665
Log: AR8327: Fix up the ability to configure the vlangroup configuration for the CPU port I messed up when doing the reset_vlans method - setting vid[0] = 1 here was making it 'hidden' from configuration (as it needed ETHERSWITCH_VID_VALID as well) and so there was no way to configure vlangroup0. In per-port VLAN mode, vlangroup0 is for the CPU port (port0). Now, it normally wouldn't really matter - the CPU port thus sees all other ports. However there are two CPU ports on the AR8327 and so port0 (arge0) was seeing all traffic on port6 (arge1). If you thus tried to use arge1/port6 for anything (eg a WAN port) in a bridge group then things would very upset very quickly. Whilst here, add a comment to remind myself that yes, it'd be nice if we could specify a boot-time switch config. Tested: * AP135 reference platform w/ AR8327N switch Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Tue Oct 20 20:38:20 2015 (r289664) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Tue Oct 20 21:18:02 2015 (r289665) @@ -66,6 +66,14 @@ #include "miibus_if.h" #include "etherswitch_if.h" +/* + * AR8327 TODO: + * + * There should be a default hardware setup hint set for the default + * switch config. Otherwise the default is "all ports in one vlangroup", + * which means both CPU ports can see each other and that will quickly + * lead to traffic storms/loops. + */ static int ar8327_vlan_op(struct arswitch_softc *sc, uint32_t op, uint32_t vid, @@ -897,8 +905,8 @@ ar8327_reset_vlans(struct arswitch_softc /* * If dot1q - set pvid; dot1q, etc. */ - sc->vid[0] = 1; if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + sc->vid[0] = 1; for (i = 0; i < AR8327_NUM_PORTS; i++) { /* Each port - pvid 1 */ sc->hal.arswitch_vlan_set_pvid(sc, i, sc->vid[0]); _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"