Combinated Mode
Our switches support such a command "ovs-vsctl set-combinated-mode true | false".This command is for resolving the packets forwarding problem of push_vlan. Sometimes,the packets forwarding is not as expected.
    Eg:there are two flows in our switch below:
    priority=100, in_port=1, dl_vlan=1, actions=push_vlan:100, output:2
    priority=110,in_port=1,dl_vlan=100,actions=output:3
Sending packets match to the first flow: We expect the packets to forward to port 2 after pushing vlan 100, but the actual result is that port 3 receives these packets with outer vlan 100.
In order to solve this kind of problem, we add a new command "ovs-vsctl set-combinated-mode true|false". When enabling this combinated mode, each flow can have a new match field class-id added. Each flow has a different class-id, so the packets can be forwarded correctly. In hardware,each flow is separated with two flows with class-id as following:
    When user adds such two flows to the switch:
     priority=100, in_port=1, dl_vlan=1, actions=push_vlan:100, output:2
     priority=110,in_port=1,dl_vlan=100,actions=output:3
     In hardware,this flow can be sepeared to two parts in icap and vcap:
     vcap: priority=100, class-id=1, in_port=1, dl_vlan=1,  and push_vlan 100
     icap:  priority=100, class-id=1, in_port=1, dl_vlan=100, and output:2
         priority=110, class-id=2, in_port=1, dl_vlan=100, and output:3
Commands
enable combinatedmode
admin@PicOS-OVS$ovs-vsctl set-combinated-mode true
disable combinated mode(by default)
admin@PicOS-OVS$ovs-vsctl set-combinated-mode false
Example
admin@PicOS-OVS$ovs-vsctl add-br br0 --Â set bridge br0 datapath_type=pica8 admin@PicOS-OVS$ovs-vsctl add-port br0 ge-1/1/1 vlan_mode=trunk tag=1Â -- set interface ge-1/1/1 type=pica8 admin@PicOS-OVS$ovs-vsctl add-port br0 ge-1/1/2 vlan_mode=trunk tag=1 -- set interface ge-1/1/2 type=pica8 admin@PicOS-OVS$ovs-vsctl add-port br0 ge-1/1/3 vlan_mode=trunk tag=1Â -- set interface ge-1/1/3 type=pica8 admin@PicOS-OVS$ovs-vsctl set-combinated-mode true admin@PicOS-OVS$ovs-ofctl add-flow br0Â priority=100,in_port=1,dl_vlan=1,actions=push_vlan:100,output:2 admin@PicOS-OVS$ovs-ofctl add-flow br0Â priority=110,in_port=1,dl_vlan=100,actions=output:3
When sending packets match the first flow with dl_vlan=1 to ge-1/1/1,then ge-1/1/2 will forward packets with outer vlan 100, not ge-1/1/3. This will provide our expected result.
Â
Note
1. When enabling or disabling combinated mode, all the flows in table 0 are evicted from the switch, except the default drop flow;
2.When enabling combinated mode, the max flow numbers including push_vlan and other normal flows is different in different platforms:
P5401&&P5101&&P3922&&P3930&&AS6701&&P3780: the max number is 512.
P3290&&P3297&&P3295:the max number is 1024
Â
Â
Â
Â
Â
Â
Copyright © 2024 Pica8 Inc. All Rights Reserved.