Hi,

rte_flow has 'group' attribute and 'jump' action in order to support multiple
groups. This feature is known as multi-table support ('chain' in linux TC
flower) in general because a group means a table of flows. This will be added
to mlx5 PMD for 18.11. Example commands are:

        flow create 0 transfer priority 1 ingress
             pattern eth / vlan vid is 100 / end
             actions of_pop_vlan / jump group 100 / end

        flow create 0 transfer priority 1 ingress
             pattern eth / vlan vid is 200 / end
             actions of_pop_vlan / jump group 200 / end

        flow create 0 transfer group 100 priority 2 ingress
             pattern eth / ipv4 dst spec 192.168.40.0 dst prefix 24 / end
             actions drop / end

        flow create 0 transfer group 100 priority 2 ingress
             pattern end
             actions port_id id 1 / end

        flow create 0 transfer group 200 priority 2 ingress
             pattern eth / ipv4 dst spec 192.168.40.0 dst prefix 24 / end
             actions of_push_vlan ethertype 0x0800 / of_set_vlan_vid vlan_vid 
300 /
                     port_id 1 / end

        flow create 0 transfer group 200 priority 2 ingress
             pattern end
             actions of_push_vlan ethertype 0x0800 / of_set_vlan_vid vlan_vid 
400 /
                     port_id 1 / end

With theses flows, if a packet having vlan 200 and src_ip as 192.168.40.1, this
packet will hit the 2nd flow and the vlan tag will be stripped off. Then it will
hit the 5th flow because of the 'jump' action. As a result, the packet will have
a new vlan tag with vid=300 and will be forwarded to a different interface.  If
the packet had vlan 100, it would be dropped according to 3rd flow.


Thanks,
Yongseok

Reply via email to