Bug 1961417

Summary: check_pkt_larger results in duplicate OF stats and incorrect trace
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Tim Rozet <trozet>
Component: openvswitch2.17Assignee: Timothy Redaelli <tredaelli>
Status: NEW --- QA Contact: ovs-qe
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: RHEL 8.0CC: ctrautma, i.maximets, jhsiao, qding, ralongi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tim Rozet 2021-05-17 20:46:17 UTC
Description of problem:
When using check_pkt_larger action and resubmitting to another table, the packet counts show the same value for both potential paths:


https://gist.githubusercontent.com/trozet/4ac5b02c8ba220ce063a6f8e781568b0/raw/0cded7ded7419bb11bc33dfec7bcb6fc428383f8/gistfile1.txt

We can see in the above that there are a couple flows which will do check_pkt_larger. Specifically:

 cookie=0x4db28c763072cb10, duration=154.328s, table=0, n_packets=1, n_bytes=1512, priority=100,udp,in_port=eth0,tp_dst=32291 actions=check_pkt_larger(1412)->NXM_NX_REG0[0],resubmit(,11)

 cookie=0xdeff105, duration=194.652s, table=1, n_packets=951, n_bytes=372270, priority=100,ct_state=+est+trk,ip actions=check_pkt_larger(1412)->NXM_NX_REG0[0],resubmit(,11)

This totals 952 packets. Looking at table 11:
 cookie=0xdeff105, duration=194.652s, table=11, n_packets=952, n_bytes=373782, priority=10,reg0=0x1 actions=LOCAL
 cookie=0xdeff105, duration=194.652s, table=11, n_packets=952, n_bytes=373782, priority=1,reg0=0 actions=output:"patch-breth0_ov"

^ both of the above flows have 952 packets, even though they match on different reg0 values.

Another example showing ofproto trace, shows multiple resubmits into table 11 which is incorrect:

[root@ovn-worker ~]#  ovs-ofctl dump-flows breth0 table=11
 cookie=0xdeff105, duration=2563.744s, table=11, n_packets=15, n_bytes=7680, priority=10,reg0=0x1/0x1 actions=CONTROLLER:65535
 cookie=0xdeff105, duration=2563.744s, table=11, n_packets=15, n_bytes=7680, priority=1 actions=output:"patch-breth0_ov"




===============================================================================
recirc(0x10) - resume conntrack with default ct_state=trk|new (use --ct-next to customize)
===============================================================================

Flow: recirc_id=0x10,ct_state=new|trk,ct_zone=64000,eth,tcp,in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,nw_src=0.0.0.0,nw_dst=10.244.1.3,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=0,tp_dst=80,tcp_flags=0

bridge("breth0")
----------------
    thaw
        Resuming from table 1
 1. ip,nw_dst=10.244.0.0/16, priority 15, cookie 0xdeff105
    check_pkt_larger(1412)->NXM_NX_REG0[0]
    resubmit(,11)
    11. reg0=0x1/0x1, priority 10, cookie 0xdeff105
            CONTROLLER:65535
    resubmit(,11)
11. priority 1, cookie 0xdeff105
    output:2

However, the datapath seems to function correctly and packets go where they should. datapath flow:

recirc_id(0x7),in_port(4),ct_state(+new-est-rel+trk),eth(src=02:42:ac:12:00:04,dst=02:42:ac:12:00:03),eth_type(0x0800),ipv4(src=172.18.0.4/255.255.255.252,dst=10.244.0.4/255.255.255.252,ttl=64,frag=no), packets:17, bytes:25738, used:0.883s, actions:check_pkt_len(size=1412,gt(5),le(ct_clear,ct(zone=12,nat),recirc(0x5)))