Hi,

ovn-controller creates one patch port pair per localnet port.  When many
tagged localnet ports share the same bridge mapping, the provider bridge
gets one patch port per logical switch.  The provider bridge only has
the default NORMAL flow, so NORMAL floods every broadcast or multicast
frame from the uplink to all of these patch ports.  Each copy then
enters br-int and is checked against the localnet ingress flows, and all
copies except one are dropped there because the VLAN does not match.

This can be reproduced on current main.  In a sandbox (dummy datapath)
with 1500 logical switches, each with a VIF and a localnet port tagged
with a different VLAN on the same bridge mapping, an ofproto/trace of
one ARP request from the uplink enters br-int 2999 times: 1500 times for
the request, plus 1499 more when NORMAL floods the ARP reply generated
by OVN.  The trace is 15169 lines long, and 20 such traces take 474 ms.

As an experiment, we set the VLAN membership of the provider bridge side
of each patch port to the tag of its localnet port:

  ovs-vsctl set port patch-<localnet>-to-br-int trunks=<tag>

With that, NORMAL floods a frame with VLAN X only to the patch port of
the localnet port with tag X.  In the same sandbox, the trace enters
br-int once (179 lines), and 20 traces take 74 ms.  Unicast and
broadcast between the uplink and the VIFs still work in both directions.
We left untagged localnet ports unchanged.

For background, this is how we found it: we run OVN 23.03 with OVS 3.1
and about 1500 (staging) to 2500 (production) VLAN tenant networks on
one physical network.  On a staging chassis with 1476 tagged localnet
ports, the same change gave:

  - ovs-vswitchd CPU: 324-383% -> 13-32%
  - upcalls (dpif_execute): ~630/s -> ~40/s
  - datapath flow put/del: ~470/s -> ~35/s
  - lost upcalls: a few per 30 seconds -> 0

During bursts of ARP requests we have also seen "lost packet on handler"
and, we believe as a consequence, BFD sessions expiring on gateway
chassis.

Doing this from outside OVN is fragile.  The patch ports belong to
ovn-controller, so a recreated port comes back without the setting, and
a wrong tag would cut off that network.  So we would like to ask:

1. Would it be acceptable for ovn-controller to set trunks=<tag> on the
   provider bridge side of the patch port it creates for a tagged
   localnet port, maybe behind an option?  Is there any case where OVN
   sends frames through a tagged localnet patch port untagged or with a
   different VLAN, which this would break?

2. Or is there a better or recommended way to handle many VLAN localnet
   ports on the same physical network?  For example, one patch port per
   bridge mapping instead of one per localnet port.

If (1) sounds reasonable, I can send a patch.

For context, I recently sent "controller: Avoid quadratic patch port
lookup in patch_run()." for another part of the same scaling problem.

Thanks,
Howon
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to