This commit changes the VLOG_ERR (for warning unmatched ofproto)
in ofproto_dpif_free_recirc_id() to an assert statement, so that
recirc_id is never allowed to be freed by non-owning ofproto.

Suggested-by: Ben Pfaff <b...@nicira.com>
Signed-off-by: Alex Wang <al...@nicira.com>
---
 ofproto/ofproto-dpif.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index b5fe73f..c92931d 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -5459,11 +5459,8 @@ ofproto_dpif_free_recirc_id(struct ofproto_dpif 
*ofproto, uint32_t recirc_id)
         ovs_mutex_unlock(&backer->recirc_mutex);
         recirc_id_free(backer->rid_pool, node->recirc_id);
 
-        if (node->ofproto != ofproto) {
-            VLOG_ERR("recirc_id %"PRIu32", freed by incorrect ofproto (%s),"
-                     " expect ofproto (%s)", node->recirc_id, ofproto->up.name,
-                     node->ofproto->up.name);
-        }
+        /* 'recirc_id' should never be freed by non-owning 'ofproto'. */
+        ovs_assert(node->ofproto == ofproto);
 
         /* RCU postpone the free, since other threads may be referring
          * to 'node' at same time. */
-- 
1.7.9.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to