svn commit: r262683 - head/sys/dev/etherswitch/arswitch

Adrian Chadd adrian at FreeBSD.org
Sun Mar 2 07:10:43 UTC 2014


Author: adrian
Date: Sun Mar  2 07:10:43 2014
New Revision: 262683
URL: http://svnweb.freebsd.org/changeset/base/262683

Log:
  Set all of the ports into the same vlangroup; there's only one vlangroup
  (pvid=1) and we already configure them to send to other ports.
  
  Setting pvid=portnum would mean that there were separate vlangroups
  for each ports, but 'leaking' into other ports.  The result? All port
  traffic flooded to all other port traffic.
  
  Tested:
  
  * DB120, AR9344 + AR8327 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	Sun Mar  2 06:36:49 2014	(r262682)
+++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c	Sun Mar  2 07:10:43 2014	(r262683)
@@ -720,9 +720,9 @@ ar8327_reset_vlans(struct arswitch_softc
 	 * flows.  All ports can see other ports.
 	 */
 	for (i = 0; i < AR8327_NUM_PORTS; i++) {
-		/* set pvid = i */
-		t = i << AR8327_PORT_VLAN0_DEF_SVID_S;
-		t |= i << AR8327_PORT_VLAN0_DEF_CVID_S;
+		/* set pvid = 1; there's only one vlangroup */
+		t = 1 << AR8327_PORT_VLAN0_DEF_SVID_S;
+		t |= 1 << AR8327_PORT_VLAN0_DEF_CVID_S;
 		arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN0(i), t);
 
 		/* set egress == out_keep */
@@ -732,8 +732,7 @@ ar8327_reset_vlans(struct arswitch_softc
 		t |= mode << AR8327_PORT_VLAN1_OUT_MODE_S;
 		arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN1(i), t);
 
-		/* Set ingress = out_keep; members = 0x3f for all ports */
-
+		/* Ports can see other ports */
 		t = (0x3f & ~(1 << i));	/* all ports besides us */
 		t |= AR8327_PORT_LOOKUP_LEARN;
 


More information about the svn-src-all mailing list