[ovs-dev] which fields should be masked or unmasked while using megaflow match?

ychen ychen103103 at 163.com
Wed Dec 27 11:48:30 UTC 2017


HI, is there any policy about which fields should be wildcard when using megaflow match?
exp 1:
 table=0, priorIty=0,actions=NORMAL
 then the datapath flow is like that:
 recirc_id(0),in_port(3),eth(src=b6:49:dd:5d:3a:a6,dst=2e:b5:7b:d6:52:c2),eth_type(0x0806), packets:0, bytes:0, used:never, actions:2
 recirc_id(0),in_port(2),eth(src=2e:b5:7b:d6:52:c2,dst=b6:49:dd:5d:3a:a6),eth_type(0x0800),ipv4(frag=no), packets:12, bytes:1176, used:0.825s, actions:3


exp 2:
table=0,in_port=1,actions=2
table=0,in_port=2,actions=1
then the datapath flow is like that:
recirc_id(0),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:26, bytes:2548, used:0.441s, actions:3
recirc_id(0),in_port(3),eth_type(0x0800),ipv4(frag=no), packets:26, bytes:2548, used:0.441s, actions:2


my question is why ETH_SRC, ETH_DST is needed when using normal action?


exp 3:
table=0,in_port=1,nw_src=1.1.1.0/24, actions=2
table=0,in_port=2,nw_src=1.1.1.0/24, actions=1
then the datapath flow is like that:
recirc_id(0),in_port(3),eth_type(0x0800),ipv4(src=1.1.1.0/255.255.255.0,frag=no), packets:1863, bytes:182574, used:0.552s, actions:2
recirc_id(0),in_port(2),eth_type(0x0800),ipv4(src=1.1.1.0/255.255.255.0,frag=no), packets:1863, bytes:182574, used:0.552s, actions:3


exp 4:
table=0,in_port=1,nw_src=1.1.1.0/24, actions=mod_nw_src:1.1.1.3, output:2
table=0,in_port=2,actions=1


then the datapath flow is like that:
recirc_id(0),in_port(3),eth_type(0x0800),ipv4(src=1.1.1.2,frag=no), packets:37, bytes:3626, used:0.332s, actions:set(ipv4(src=1.1.1.3)),2
recirc_id(0),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:37, bytes:3626, used:0.332s, actions:3


my question is why NW_SRC=1.1.1.2 should be all masked with 0xff, why not 0xffffff00 like the rule we created?


in one word, is there any rules to set flow mask when using megaflow match? which fields should be wildcard? why? 
we can extract all fields from packets, and we can find the rule match the packet, but why the datapath flow match fields is not the same as userspace rule?


More information about the dev mailing list