Commit 29b77fb9 authored by Alessandro Rubini's avatar Alessandro Rubini

vlan: route 2 vlan numbers to Etherbone and 1 to streamer/nic

These numbers are only available at build time; there is no run-time
command to change them as yet.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent d4c72f47
......@@ -45,6 +45,22 @@ config VLAN_NR
default 10 if VLAN
default 0
config VLAN_1_FOR_CLASS7
int
default 20 if VLAN
default 0
config VLAN_2_FOR_CLASS7
int
default 30 if VLAN
default 0
config VLAN_FOR_CLASS6
int
default 100 if VLAN
default 0
# CONFIG_WR_SWITCH has no further options at all at this point
config WR_NODE_PCS16
......@@ -316,6 +332,18 @@ config VLAN_NR
depends on VLAN
int "Use this VLAN number for filter/tx/rx"
config VLAN_1_FOR_CLASS7
depends on VLAN
int "Route this VLAN to fabric class 7 (Etherbone)"
config VLAN_2_FOR_CLASS7
depends on VLAN
int "Route this VLAN too to fabric class 7 (Etherbone)"
config VLAN_FOR_CLASS6
depends on VLAN
int "Route this VLAN too to fabric class 6 (Streamer/NIC)"
config SDB_STORAGE
depends on WR_NODE
default y
......
......@@ -9,6 +9,11 @@ CONFIG_RAMSIZE=131072
CONFIG_PLL_VERBOSE=y
CONFIG_PFILTER_VERBOSE=y
CONFIG_WRC_VERBOSE=y
CONFIG_VLAN=y
CONFIG_VLAN_NR=10
CONFIG_VLAN_1_FOR_CLASS7=20
CONFIG_VLAN_2_FOR_CLASS7=30
CONFIG_VLAN_FOR_CLASS6=100
# CONFIG_WR_NODE_PCS16 is not set
CONFIG_STACKSIZE=2048
CONFIG_PPSI=y
......
......@@ -47,6 +47,9 @@ wrpc-dump: wrpc-dump.c dump-info-host.o
-I ../softpll \
$^ -o $@
pfilter-builder: pfilter-builder.c
$(CC) $(CFLAGS) -include ../include/generated/autoconf.h \
$@.c $(LDFLAGS) -o $@
dump-info-host.o: ../dump-info.o
......
......@@ -476,6 +476,22 @@ void pfilter_init_vlan(char *fname)
/* .... but only for our current VLAN */
pfilter_logic2(R_CLASS(0), FRAME_FOR_CPU, AND, FRAME_OUR_VLAN);
/*
* And route these build-time selected vlans to fabric 7 and 6.
* Class 7 is etherbone and class 6 is streamer or nic (or whatever).
* We get all broadcast and all frames for our mac.
*
* We reuse FRAME_OUR_VLAN, even if it's not OUR as in "this CPU"
*/
pfilter_logic2(R_TMP, FRAME_OUR_MAC, OR, FRAME_BROADCAST);
pfilter_cmp(7, CONFIG_VLAN_1_FOR_CLASS7, 0x0fff, MOV, FRAME_OUR_VLAN);
pfilter_cmp(7, CONFIG_VLAN_2_FOR_CLASS7, 0x0fff, OR, FRAME_OUR_VLAN);
pfilter_logic2(R_CLASS(7), R_TMP, AND, FRAME_OUR_VLAN);
pfilter_cmp(7, CONFIG_VLAN_FOR_CLASS6, 0x0fff, MOV, FRAME_OUR_VLAN);
pfilter_logic2(R_CLASS(6), R_TMP, AND, FRAME_OUR_VLAN);
pfilter_output(fname);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment