mbox series

[ovs-dev,ovn,v2,0/2] Caching logical flow expr tree for each lflow

Message ID 20200121143955.245616-1-numans@ovn.org
Headers show
Series Caching logical flow expr tree for each lflow | expand

Message

Numan Siddique Jan. 21, 2020, 2:39 p.m. UTC
From: Numan Siddique <numans@ovn.org>

This patch series tries to improve the time taken to proceess logical
flows by caching the expr tree. For large scale deployments with lots
of logical flows, the logical flow processing to OpenFlow rules
takes a lot of time as it is CPU intensive.

This patch series tries to improve this by caching the expr tree
generated for each logical flow so that we don't have to generate the
expr tree for each lflow_run().

Below are the details of the OVN resource in my setup

No of logical switches - 49
No of logical ports    - 1191
No of logical routers  - 7
No of logical ports    - 51
No of ACLs             - 1221
No of Logical flows    - 664736

On a chassis hosting 7 distributed router ports and around 1090
port bindings, the no of OVS rules was 921162.

Without this patch, the function add_logical_flows() took ~15 seconds.
And with this patch it took ~10 seconds. There is a good 34% improvement
in logical flow processing.

v1 -> v2
=======
 * Addressed review comments from Han.

Numan Siddique (2):
  expr: Evaluate the condition expression in a separate step.
  ovn-controller: Cache logical flow expr tree for each lflow.

 controller/lflow.c          | 191 +++++++++++++++++++++++++++---------
 controller/lflow.h          |   9 +-
 controller/ovn-controller.c |  16 ++-
 include/ovn/expr.h          |  10 +-
 lib/expr.c                  |  55 ++++++++---
 tests/test-ovn.c            |  10 +-
 utilities/ovn-trace.c       |   5 +-
 7 files changed, 218 insertions(+), 78 deletions(-)

Comments

Han Zhou Jan. 21, 2020, 8:05 p.m. UTC | #1
On Tue, Jan 21, 2020 at 6:40 AM <numans@ovn.org> wrote:
>
> From: Numan Siddique <numans@ovn.org>
>
> This patch series tries to improve the time taken to proceess logical
> flows by caching the expr tree. For large scale deployments with lots
> of logical flows, the logical flow processing to OpenFlow rules
> takes a lot of time as it is CPU intensive.
>
> This patch series tries to improve this by caching the expr tree
> generated for each logical flow so that we don't have to generate the
> expr tree for each lflow_run().
>
> Below are the details of the OVN resource in my setup
>
> No of logical switches - 49
> No of logical ports    - 1191
> No of logical routers  - 7
> No of logical ports    - 51
> No of ACLs             - 1221
> No of Logical flows    - 664736
>
> On a chassis hosting 7 distributed router ports and around 1090
> port bindings, the no of OVS rules was 921162.
>
> Without this patch, the function add_logical_flows() took ~15 seconds.
> And with this patch it took ~10 seconds. There is a good 34% improvement
> in logical flow processing.
>
> v1 -> v2
> =======
>  * Addressed review comments from Han.
>
> Numan Siddique (2):
>   expr: Evaluate the condition expression in a separate step.
>   ovn-controller: Cache logical flow expr tree for each lflow.
>
>  controller/lflow.c          | 191 +++++++++++++++++++++++++++---------
>  controller/lflow.h          |   9 +-
>  controller/ovn-controller.c |  16 ++-
>  include/ovn/expr.h          |  10 +-
>  lib/expr.c                  |  55 ++++++++---
>  tests/test-ovn.c            |  10 +-
>  utilities/ovn-trace.c       |   5 +-
>  7 files changed, 218 insertions(+), 78 deletions(-)
>
> --
> 2.24.1
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

For v2 of the series:
Acked-by: Han Zhou <hzhou@ovn.org>
Mark Michelson Jan. 21, 2020, 8:42 p.m. UTC | #2
I have pushed the series to master.

On 1/21/20 3:05 PM, Han Zhou wrote:
> On Tue, Jan 21, 2020 at 6:40 AM <numans@ovn.org> wrote:
>>
>> From: Numan Siddique <numans@ovn.org>
>>
>> This patch series tries to improve the time taken to proceess logical
>> flows by caching the expr tree. For large scale deployments with lots
>> of logical flows, the logical flow processing to OpenFlow rules
>> takes a lot of time as it is CPU intensive.
>>
>> This patch series tries to improve this by caching the expr tree
>> generated for each logical flow so that we don't have to generate the
>> expr tree for each lflow_run().
>>
>> Below are the details of the OVN resource in my setup
>>
>> No of logical switches - 49
>> No of logical ports    - 1191
>> No of logical routers  - 7
>> No of logical ports    - 51
>> No of ACLs             - 1221
>> No of Logical flows    - 664736
>>
>> On a chassis hosting 7 distributed router ports and around 1090
>> port bindings, the no of OVS rules was 921162.
>>
>> Without this patch, the function add_logical_flows() took ~15 seconds.
>> And with this patch it took ~10 seconds. There is a good 34% improvement
>> in logical flow processing.
>>
>> v1 -> v2
>> =======
>>   * Addressed review comments from Han.
>>
>> Numan Siddique (2):
>>    expr: Evaluate the condition expression in a separate step.
>>    ovn-controller: Cache logical flow expr tree for each lflow.
>>
>>   controller/lflow.c          | 191 +++++++++++++++++++++++++++---------
>>   controller/lflow.h          |   9 +-
>>   controller/ovn-controller.c |  16 ++-
>>   include/ovn/expr.h          |  10 +-
>>   lib/expr.c                  |  55 ++++++++---
>>   tests/test-ovn.c            |  10 +-
>>   utilities/ovn-trace.c       |   5 +-
>>   7 files changed, 218 insertions(+), 78 deletions(-)
>>
>> --
>> 2.24.1
>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> 
> For v2 of the series:
> Acked-by: Han Zhou <hzhou@ovn.org>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>