Commit fd80f507 authored by Rahul Thakur's avatar Rahul Thakur

iopsys-brcm63xx-arm: add support for managed bridge

The managed bridge was broken by the changes done for unmanaged bridge.
That has been fixed, both are now supported.

Test:
Deployment - auto
QoS VLAN - auto
Managed bridge - Manual
Transparent bridge - Manual

Note:
1. Transparent bridge also works with this change now.
2. Transparent bridge will work with a UCI that is different from the
one that was earlier shared, updated config will be shared in email.
parent 42027de1
......@@ -236,10 +236,13 @@ create_vlan() {
vlanCtl_initTagRule
# Match the transmitting VOPI against baseL3IfName #
# Match the transmitting VOPI against baseL3IfName
vlanCtl_filterOnTxVlanDevice $NAME
# If hit, push an outer tag if non bridged interface #
if [ $BRIDGED -eq 0 ]; then
# If hit, push an outer tag if not unmanaged bridged interface
# Note that unmanaged is set only in case when interface is bridge
# and has no ip address. So, to check explicitly for bridge type
# is not necessary
if [ $UNMANAGED -eq 0 ]; then
vlanCtl_cmdPushVlanTag
# If type is 8021ad, push inner tag.
[ $TYPE == "8021ad" ] && vlanCtl_cmdPushVlanTag
......@@ -269,11 +272,16 @@ create_vlan() {
# If translation is enabled on this interface, modify outgoing VLAN ID
if [ $TVLANID -ne 0 ]; then
TAGINDEX=0
vlanCtl_cmdSetTagVid $VLANID $TAGINDEX
vlanCtl_cmdSetTagPbits $PRIORITY $TAGINDEX
TAGS=1
vlanCtl_insertTagRule $IFNAME $DIRECTION $TAGS $POSITION $TAGRULEID
# For managed interface, vlan id is anyway created at
# egress, so TVID makes no sense, it is only of importance
# in case of unmanaged bridges.
if [ $UNMANAGED -eq 1 ]; then
TAGINDEX=0
vlanCtl_cmdSetTagVid $VLANID $TAGINDEX
vlanCtl_cmdSetTagPbits $PRIORITY $TAGINDEX
TAGS=1
vlanCtl_insertTagRule $IFNAME $DIRECTION $TAGS $POSITION $TAGRULEID
fi
fi
# ======== Set rx rules ======== #
......@@ -296,12 +304,18 @@ create_vlan() {
TAGINDEX=1
[ $TYPE == "8021ad" ] && vlanCtl_filterOnTagVid $INNER_VLANID $TAGINDEX
# If VLAN translated vlan id is configured, then on ingress,
# write the translated vlan id into the header
if [ $TVLANID -ne 0 ]; then
TAGINDEX=0
vlanCtl_cmdSetTagVid $TVLANID $TAGINDEX
# For managed interfaces, pop the vlan header at rx
if [ $UNMANAGED -eq 0 ]; then
vlanCtl_cmdPopVlanTag
[ $TYPE == "8021ad" ] && vlanCtl_cmdPopVlanTag
else
# If VLAN translated vlan id is configured, then on ingress,
# write the translated vlan id into the header
if [ $TVLANID -ne 0 ]; then
TAGINDEX=0
vlanCtl_cmdSetTagVid $TVLANID $TAGINDEX
fi
fi
# Append this rule to the bottom of rx tag rule table-1 and table-2
......@@ -371,23 +385,30 @@ create_vlan() {
# Match the transmitting VOPI against baseL3IfName #
vlanCtl_filterOnTxVlanDevice $NAME
# For the untagged interface at tx, pop the tag if any
vlanCtl_cmdPopVlanTag
# Set rule to the top of tx tag rule table-0, table-1 and table-2.
DIRECTION="tx"
TAGS=1
TAGS=0
POSITION="rule-insert-before"
TAGRULEID="-1"
if [ $UNMANAGED -eq 1 ]; then
# For the untagged interface at tx, pop the tag if any
vlanCtl_cmdPopVlanTag
TAGS=1
fi
vlanCtl_insertTagRule $IFNAME $DIRECTION $TAGS $POSITION $TAGRULEID
if [ $BRIDGED -eq 1 ]; then
if [ $UNMANAGED -eq 0 ]; then
TAGS=1
vlanCtl_insertTagRule $IFNAME $DIRECTION $TAGS $POSITION $TAGRULEID
fi
TAGS=2
vlanCtl_insertTagRule $IFNAME $DIRECTION $TAGS $POSITION $TAGRULEID
fi
# ======== Set rx rules ========
vlanCtl_initTagRule
# Set rx vlan interface for this rule
......@@ -403,7 +424,8 @@ create_vlan() {
vlanCtl_cmdSetTagVid $VLANID $TAGINDEX
vlanCtl_cmdSetTagPbits $PRIORITY $TAGINDEX
fi
# If a managed interface, forward unconditionally to
# the rx vlan interface
DIRECTION="rx"
TAGS=0
POSITION="rule-insert-last"
......
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