Hello,

in the way of templating OVS rules for hypervisor we use approach like this:

/openflow_add_aspoof:/
    ovs-ofctl add-flow $switch "in_port=$port priority=31000 cookie=$cookie 
dl_type=0x0800 dl_src=$mac nw_src=$ip action=normal"
    ovs-ofctl add-flow $switch "in_port=$port priority=31000 cookie=$cookie 
dl_type=0x0806 dl_src=$mac nw_src=$ip action=normal"
    ovs-ofctl add-flow $switch "in_port=$port priority=31000 cookie=$cookie 
dl_type=0x0800 dl_dst=$mac nw_dst=$ip action=normal"
    ovs-ofctl add-flow $switch "in_port=$port priority=31000 cookie=$cookie 
dl_type=0x0806 dl_dst=$mac nw_dst=$ip action=normal" 

/openflow_add_allow_bcast:/
    #ENABLE broadcasts
    ovs-ofctl add-flow $switch "in_port=$port priority=31000 cookie=$cookie 
dl_type=0x0806 nw_dst=$ip action=normal"          
    ovs-ofctl add-flow $switch "in_port=$port priority=31000 cookie=$cookie 
dl_type=0x0806 dl_src=$mac nw_src=$ip 
dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 action=normal"  
    ovs-ofctl add-flow $switch "in_port=$port priority=31000 cookie=$cookie 
dl_type=0x0800 dl_src=$mac nw_src=$ip 
dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 action=normal"      
    ovs-ofctl add-flow $switch "in_port=$port priority=31000 cookie=$cookie 
dl_type=0x0800 dl_src=$mac nw_src=$ip nw_dst=$bcast action=normal"
    ovs-ofctl add-flow $switch "in_port=$port priority=31000 cookie=$cookie 
dl_type=0x0800 dl_src=$mac nw_src=$ip nw_dst=255.255.255.255 action=normal"     
    


But if we needs to gets flows working through bond interface (LACP for ex.) - 
current OVS needs to to do some magic:

    bond_ports=`ovs-appctl lacp/show vlannet-bond|grep "actor port_id:"|awk 
'{sub(/^[ \t]+/, ""); print$3}'`
    portsArray=($bond_ports);
    
    if [ ${#portsArray[@]} -gt 0 ]; then
        for bond_port in "${portsArray[@]}"; do
            openflow_add_aspoof "$type" "$bond_port" "$dev" "$switch" "$ip" 
"$mac" "$cookie" "$bcast" "$access_array"
            openflow_add_allow_bcast "$type" "$bond_port" "$dev" "$switch" 
"$ip" "$mac" "$cookie" "$bcast" "$access_array"
        done
    fi


This is because OVS bond port is not the endpoint port (as in linux bonding) 
and we must apply flows to all bond interfaces leads to redundant flows 
(overhead for 4-port LACP is 3/4).
Do you have plans to get OVS bond working as single port with flows on it or we 
should use the linux bond?

-- 
*/Best regards,/*
/Eugene Istomin/

_______________________________________________
discuss mailing list
discuss@openvswitch.org
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to