Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Oct 2015 21:18:02 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r289665 - head/sys/dev/etherswitch/arswitch
Message-ID:  <201510202118.t9KLI2ZK078186@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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]);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510202118.t9KLI2ZK078186>