Uploaded image for project: 'Fast Datapath Product'
  1. Fast Datapath Product
  2. FDP-540

CLONE [ovn24.03 fast-datapath-rhel-9] - ovn-controller wrong accounting of ofctrl_sb_flow_ref_usage-KB

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Minor Minor
    • None
    • None
    • ovn24.03
    • False
    • Hide

      None

      Show
      None
    • False

      # ovs-appctl -t  /var/run/ovn-ic/ovn-controller.3851.ctl memory/show
      idl-cells-OVN_Southbound:1647779 idl-cells-Open_vSwitch:9185 if_status_mgr_ifaces_state_usage-KB:2 if_status_mgr_ifaces_usage-KB:15 lflow-cache-entries-cache-expr:804 lflow-cache-entries-cache-matches:15167 lflow-cache-size-KB:2843 local_datapath_usage-KB:1 ofctrl_desired_flow_usage-KB:203461 ofctrl_installed_flow_usage-KB:140479 ofctrl_sb_flow_ref_usage-KB:4240487982
      

      there is some kind of integer overflow ofctrl_sb_flow_ref_usage-KB:4240487982 is surely incorrect

      A reproducer:

      # rpm -q --whatprovides /usr/bin/ovn-controller
      ovn23.09-host-23.09.0-91.el9fdp.x86_64
      
      #!/bin/bash
      set -x
      systemctl stop openvswitch
      systemctl stop ovn-controller
      systemctl stop ovn-northd
      
      rm /etc/openvswitch/conf.db
      rm /var/lib/ovn/ovnsb_db.db
      rm /var/lib/ovn/ovnnb_db.db
      
      ip netns del pods
      
      set -e
      
      systemctl start ovn-northd
      ovn-sbctl --inactivity-probe=0 set-connection ptcp:6642
      ovn-nbctl --wait=hv sync
      
      ovn-nbctl ls-add ls1
      ovn-nbctl lsp-add ls1 ls1p1 \
            -- pg-add pg1 ls1p1 \
            -- create address_set name=address________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ addresses='["0.0.0.1", "0.0.0.2"]' \
            -- acl-add pg1 to-lport 1000 'tcp && ip4.dst==$address________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________' drop \
            -- lsp-set-addresses ls1p1 "00:00:00:01:01:01 192.168.1.1" \
            -- set logical_switch_port ls1p1 options:requested-chassis=$(cat /etc/openvswitch/system-id.conf)
      
      systemctl start openvswitch
      systemctl start ovn-controller
      ovs-vsctl set open .  external_ids:ovn-remote=tcp:127.0.0.1:6642 \
                            external_ids:ovn-encap-type=geneve \                                                                                                                                                                                                       external_ids:ovn-encap-ip=10.224.123.2 \
                            external_ids:ovn-openflow-probe-interval=240
      
      node=ls1
      ovn-sbctl wait-until chassis `cat /etc/openvswitch/system-id.conf`
      ovs-vsctl wait-until port br-int
      ovn-nbctl --wait=hv sync
      
      ip netns add pods
      ovs-vsctl  add-port br-int  pod1 -- set interface pod1 type=internal -- set interface pod1 external_ids:iface-id=ls1p1
      A=$(ovn-nbctl --bare --columns addresses list logical_switch_port ls1p1)
      ip link set pod1 netns pods
      mac=${A% *}
      ip=${A#* }
      ip netns exec pods ip link set pod1 address ${mac}
      ip netns exec pods ip link set pod1 up
      ip netns exec pods ip addr add ${ip} dev pod1
      time ovs-vsctl wait-until interface pod1 external_ids:ovn-installed=true
      
      until ovn-appctl memory/show | grep ofctrl_sb_flow_ref_usage-KB:429496729; do
      ovn-nbctl set address_set address________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ addresses='["0.0.0.3"]' && ovn-nbctl --wait=hv sync
      ovn-nbctl set address_set address________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ addresses='["0.0.0.1", "0.0.0.2"]' && ovn-nbctl --wait=hv sync
      done
      
      

      expected result: ovn-appctl memory/show displays proper value for ofctrl_sb_flow_ref_usage-KB

      actual result:
      after 48 iterations:

      # ovn-appctl memory/show
      idl-cells-OVN_Southbound:1187 idl-cells-Open_vSwitch:157 if_status_mgr_ifaces_state_usage-KB:1 if_status_mgr_ifaces_usage-KB:1 lflow-cache-entries-cache-expr:3 lflow-cache-entries-cache-matches:73 lflow-cache-size-KB:8 local_datapath_usage-KB:1 ofctrl_desired_flow_usage-KB:32 ofctrl_installed_flow_usage-KB:23 ofctrl_sb_flow_ref_usage-KB:4294967295
      

      noticed while investigating unrelated ovn-controller issues in case 03746492

            amusil@redhat.com Ales Musil
            ovnteam@redhat.com OVN Team
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: