[ovs-git] [ovn-org/ovn] 347868: lflow.c: Rename function convert_acts_to_expr to c...

Han Zhou noreply at github.com
Thu Sep 17 17:34:47 UTC 2020


  Branch: refs/heads/branch-20.09
  Home:   https://github.com/ovn-org/ovn
  Commit: 347868408411b9aa75e251f2555dd00ff45b6c29
      https://github.com/ovn-org/ovn/commit/347868408411b9aa75e251f2555dd00ff45b6c29
  Author: Han Zhou <hzhou at ovn.org>
  Date:   2020-09-17 (Thu, 17 Sep 2020)

  Changed paths:
    M controller/lflow.c

  Log Message:
  -----------
  lflow.c: Rename function convert_acts_to_expr to convert_match_to_expr.

The name was misleading because it in fact parses lflow match instead
of actions.

Fixes: 1213bc8270 ("ovn-controller: Cache logical flow expr matches.")
Cc: Numan Siddique <numans at ovn.org>
Acked-by: Numan Siddique <numans at ovn.org>
Acked-by: Dumitru Ceara <dceara at redhat.com>
Signed-off-by: Han Zhou <hzhou at ovn.org>


  Commit: 927b3868c96d81a02e3dbebe68a61b051e8fc8fb
      https://github.com/ovn-org/ovn/commit/927b3868c96d81a02e3dbebe68a61b051e8fc8fb
  Author: Han Zhou <hzhou at ovn.org>
  Date:   2020-09-17 (Thu, 17 Sep 2020)

  Changed paths:
    M controller/lflow.c
    M controller/lflow.h
    M tests/ovn.at

  Log Message:
  -----------
  lflow.c: Avoid adding redundant resource refs for port-bindings.

When a lport is referenced by a logical flow where port-binding refs
needs to be added, currently it can add the same reference pair multiple
times in below situations (introduced in commit ade4e77):

1) In add_matches_to_flow_table(), different matches from same lflow
   can have same inport/outport.

2) In is_chassis_resident_cb(), a lflow can have multiple is_chassis_resident
   check for same lport (although not very common), and at the same time
   the lport used in is_chassis_resident can overlap with the inport/
   outport of the same flow.

Now because of the redundant entries added, it results in unexpected behavior
such as same lflow being processed multiple times as a waste of processing.
More severely, after commit 580aea72e it can result in orphaned pointer leading
to crash, as reported in [0].

This patch fixes the problems by checking existence of same reference before
adding in lflow_resource_add(). To do this check efficiently, hmap is used to
replace the list struct for the resource-to-lflow index.

[0] https://mail.openvswitch.org/pipermail/ovs-dev/2020-September/374991.html

Reported-by: Dumitru Ceara <dceara at redhat.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2020-September/374991.html
Fixes: ade4e779d3fb ("ovn-controller: Use the tracked runtime data changes for flow calculation.")
Fixes: 580aea72e26f ("ovn-controller: Fix conjunction handling with incremental processing.")
Acked-by: Dumitru Ceara <dceara at redhat.com>
Acked-by: Numan Siddique <numans at ovn.org>
Signed-off-by: Han Zhou <hzhou at ovn.org>


  Commit: c3cbf03d87caf9947d6adcee97e90f25cdfb7e8d
      https://github.com/ovn-org/ovn/commit/c3cbf03d87caf9947d6adcee97e90f25cdfb7e8d
  Author: Han Zhou <hzhou at ovn.org>
  Date:   2020-09-17 (Thu, 17 Sep 2020)

  Changed paths:
    M controller/lflow.c

  Log Message:
  -----------
  lflow.c: Release ref_lflow_node as soon as it is not needed.

If a resource doesn't have any lflows referencing it any more, the
node ref_lflow_node in lflow_resource_ref.ref_lflow_table should
be removed and released. Otherwise, the table could keep growing
in some scenarios, until a recompute is triggered. Now that the
chance of triggering recompute is lower and there are more resources
references maintained (for type port-binding), this problem is
more likely to happen than before. This patch fixes the problem
by releasing the node as soon as it is not needed.

Fixes: d2aa2c7cafe ("ovn-controller: Maintain resource references for logical flows.")
Acked-by: Dumitru Ceara <dceara at redhat.com>
Acked-by: Numan Siddique <numans at ovn.org>
Signed-off-by: Han Zhou <hzhou at ovn.org>


Compare: https://github.com/ovn-org/ovn/compare/24ac0a496ace...c3cbf03d87ca


More information about the git mailing list