Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
The FDP team is no longer accepting new bugs in Bugzilla. Please report your issues under FDP project in Jira. Thanks.

Bug 1938950

Summary: [ovn-controller] ovn-controller does not use IDL indexes when iterating on port bindings
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Dumitru Ceara <dceara>
Component: ovn2.13Assignee: Dumitru Ceara <dceara>
Status: CLOSED ERRATA QA Contact: ying xu <yinxu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: FDP 20.HCC: ctrautma, dcbw, jishi, kfida, mmichels, ralongi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovn-2021-21.06.0-3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-29 20:05:04 UTC 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:
Attachments:
Description Flags
NB database. none

Description Dumitru Ceara 2021-03-15 10:17:11 UTC
Created attachment 1763345 [details]
NB database.

Description of problem:

In patch_run()/add_bridge_mappings() ovn-controller iterates on all port bindings while the only interesting port bindings are of type "localnet" or "l2gateway".

This can be easily optimized (and should yield ~5% performance boost) by using IDL indexes.

The same optimization can be applied to physical_run() when iterating on port bindings of type="vtep".

How reproducible:
Profile ovn-controller with perf.

Steps to Reproduce:
1. Start OVN making it point to the attached NB DB.
2. Bind VIFs corresponding to some of the port bindings to the local ovn-controller (e.g., lp_19.99.0.6, lp_19.99.0.9, lp_19.99.0.12, lp_19.99.0.13).
3. Start ovn-controller with perf:
perf record -g ovn-controller
4. Check the perf report:
perf report

Actual results:
        Children      Self  Command         Shared Object   Symbol
      +    5.79%     5.34%  ovn-controller  ovn-controller  [.] patch_run

Expected results:
        Children      Self  Command         Shared Object   Symbol
      +    0.55%     0.04%  ovn-controller  ovn-controller  [.] patch_run

Comment 1 Dumitru Ceara 2021-03-26 16:44:15 UTC
Fix posted for review:
http://patchwork.ozlabs.org/project/ovn/list/?series=236011&state=*

Comment 2 Dan Williams 2021-05-25 18:26:26 UTC
Applied to master (21.06) on 2021-03-28

Comment 6 ying xu 2021-07-12 10:01:01 UTC
Hi,
could you pls help verify this bug? I can't reproduce it.
Thanks very much!

Comment 7 Dumitru Ceara 2021-07-14 09:06:45 UTC
Without fix, compiled with CFLAGS="-g -O2 -fno-omit-frame-pointer -fno-common":

$ perf report -i perf.data.nofix --stdio
# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 96K of event 'cycles'
# Event count (approx.): 75413674670
#
# Children      Self  Command         Shared Object        Symbol                                            
# ........  ........  ..............  ...................  ..................................................
#
[...]
     5.49%     5.13%  ovn-controller  ovn-controller       [.] patch_run
            |          
             --5.13%--0x495641000b6f7b3d
                       __libc_start_main
                       main
                       |          
                        --5.00%--patch_run


With fix (ovn-2021-21.06.0-4.el8fdp recompiled with CFLAGS="-g -O2 -fno-omit-frame-pointer -fno-common"):
$ perf report -i perf.data.fix --stdio
# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 86K of event 'cycles'
# Event count (approx.): 66652773704
#
# Children      Self  Command         Shared Object        Symbol                                            
# ........  ........  ..............  ...................  ..................................................
#
     0.06%     0.00%  ovn-controller  ovn-controller       [.] patch_run

Looks good to me, thanks!

Regards,
Dumitru

Comment 8 ying xu 2021-07-15 00:03:38 UTC
according to comment7,set this bug to verified.

Comment 10 errata-xmlrpc 2021-07-29 20:05:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (ovn bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:2969