When cfm is deleted from a port, all modules should release their reference so that the cfm struct can be removed from the global hmap and freed. Therein, the reference held by xlate module can only be released when the need_revalidate flag is set (e.g set to REV_RECONFIGURE). And this flag should be set while removing cfm from ofport. Unfortunately, this has never been done before and the bug was hidden by another bug fixed in recent commit a190839 (netdev-vport: Do not update netdev when there is no config change.)
To fix this issue, this commit makes the code set need_revalidate when removing cfm from ofport. Signed-off-by: Alex Wang <[email protected]> --- ofproto/ofproto-dpif.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 6402404..42ff747 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -1915,13 +1915,11 @@ static int set_cfm(struct ofport *ofport_, const struct cfm_settings *s) { struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); + struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto); int error = 0; if (s) { if (!ofport->cfm) { - struct ofproto_dpif *ofproto; - - ofproto = ofproto_dpif_cast(ofport->up.ofproto); ofproto->backer->need_revalidate = REV_RECONFIGURE; ofport->cfm = cfm_create(ofport->up.netdev); } @@ -1935,6 +1933,7 @@ set_cfm(struct ofport *ofport_, const struct cfm_settings *s) } cfm_unref(ofport->cfm); ofport->cfm = NULL; + ofproto->backer->need_revalidate = REV_RECONFIGURE; out: ofproto_dpif_monitor_port_update(ofport, ofport->bfd, ofport->cfm, ofport->lldp, ofport->up.pp.hw_addr); -- 1.7.9.5 _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
