[ovs-discuss] flow match reg0=1 is not working

Miroslav Kubiczek Miroslav.Kubiczek at adaptivemobile.com
Wed May 27 20:55:20 UTC 2020


On Wed, May 27, 2020 at 11:24:24AM +0200, Miroslav Kubiczek wrote:
>> I'd like to configure flows to use different table based on packet size. I
>> have configured the flows like this:
>>
>> #ovs-ofctl dump-flows br0
>> ...
>> cookie=0x0, table=0, priority=20000
>> actions=check_pkt_larger(100)->NXM_NX_REG0[0],resubmit(,1)
>> cookie=0x1, table=1, priority=1000,udp,reg0=0,tp_dst=2123
>> actions=resubmit(,2)
>> ...
>>
>> The problem is that the 2nd flow is always positive, i.e. it's always
>> resubmitted to table 2. I tried it also with reg0=1 but it has the same
>> effect. Am I doing anything wrong or is it a bug?

>This makes it sound like the feature doesn't work at all, but we know
>that it does, since it's used in OVN.  In your place, I'd launch into
>the general purpose troubleshooting procedure here, starting with
>checking the "ofproto/trace" results, then looking at the datapath
>flows, and moving on from there.

Thanks for quick reply Ben. The ofproto/trace shows:

# ovs-appctl ofproto/trace br0 in_port=1,udp,udp_dst=2123
             -> output to native tunnel
             -> tunneling to 192.168.200.2 via br0
             -> tunneling from f4:03:43:c3:a2:60 192.168.200.1 to ae:df:6c:75:18:8b 192.168.200.2

        bridge("br0")
        --------------
         0. priority 20000
            check_pkt_larger(2)->NXM_NX_REG0[0]
            resubmit(,1)
             1. in_port=LOCAL,dl_src=f4:03:43:c3:a2:60,dl_dst=ae:df:6c:75:18:8b, priority 1
                    output:4
            resubmit(,1)
         1. in_port=LOCAL,dl_src=f4:03:43:c3:a2:60,dl_dst=ae:df:6c:75:18:8b, priority 1
            output:4
    resubmit(,1)
 1. priority 0
    CONTROLLER:65535

Final flow: unchanged
Megaflow: recirc_id=0,eth,udp,in_port=1,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,nw_src=0.0.0.0/2,nw_dst=0.0.0.0/2,nw_ecn=0,nw_frag=no,tp_dst=2123
Datapath actions: check_pkt_len(size=2,gt(clone(tnl_push(tnl_port(4),header(size=50,type=4,eth(dst=ae:df:6c:75:18:8b,src=f4:03:43:c3:a2:60,dl_type=0x0800),ipv4(src=192.168.200.1,dst=192.168.200.2,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=4789,csum=0xffff),vxlan(flags=0x8000000,vni=0x0)),out_port(3)),check_pkt_len(size=2,gt(5),le(5)))),le(userspace(pid=0,controller(reason=6,dont_send=1,continuation=0,recirc_id=1196,rule_cookie=0,controller_id=0,max_len=65535))))

How can I check the reg[0] value was set?
I suspect that the register is set but the next flow ignores the value in the match.


More information about the discuss mailing list