[ovs-discuss] Reg. ofproto: ofproto_rule_insert__

Ben Pfaff blp at ovn.org
Thu Jun 14 22:24:50 UTC 2018


On Tue, Jun 12, 2018 at 06:02:19PM +0000, Vishal Deep Ajmera wrote:
> Hi,
> 
> In bundle based resync, we try to apply all rules from the bundle one-by-one. If a rule encounters any error, we revert back (undo) rules which were applied successfully. This is accomplished in function add_flow_revert() -> replace_rule_revert() -> ofproto_rule_insert__() using old_rule pointer. The old_rule state in this case would be RULE_REMOVED since the rule has been successfully replaced by new_rule. However, function ofproto_rule_insert__() is asserting when rule->state != RULE_INITIALIZED. Is this correct ? I think assert condition should be: ovs_assert(rule->state != RULE_INSERTED).
> 
> Does this make sense ? I am not very familiar with bundle based resync's though. If the change looks ok, I will post a patch in dev-list.

Thanks for the bug report.

The comment is pretty clear that a rule may not be reinserted and the
assertion matches that.  The comment probably reflects how it's not safe
to cmap_remove() and then reinsert a cmap_node (before a grace period
has elapsed).

Do you have an example of how to get the assertion to trigger?


More information about the discuss mailing list