Warn the free of 'recirc_id' by wrong 'ofproto'.
authorAlex Wang <alexw@nicira.com>
Tue, 23 Dec 2014 22:15:44 +0000 (14:15 -0800)
committerAlex Wang <alexw@nicira.com>
Wed, 24 Dec 2014 02:30:08 +0000 (18:30 -0800)
Issues a ERR log when the 'recirc_id' is not freed by the
owning 'ofproto'.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
ofproto/ofproto-dpif.c
tests/ofproto-dpif.at

index 39288c1..dc555dd 100644 (file)
@@ -4841,6 +4841,13 @@ ofproto_dpif_free_recirc_id(struct ofproto_dpif *ofproto, uint32_t recirc_id)
         hmap_remove(&backer->recirc_map, &node->hmap_node);
         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);
+        }
+
         /* RCU postpone the free, since other threads may be referring
          * to 'node' at same time. */
         ovsrcu_postpone(free, node);
index 6fb0dce..4d484f8 100644 (file)
@@ -240,8 +240,6 @@ AT_CHECK([ovs-ofctl add-flows br-int flows.txt])
 # Should generate recirc_id(0x12d),dp_hash(0xcf/0xff).
 AT_CHECK([ovs-appctl netdev-dummy/receive p5 "in_port(5),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no)"])
 
-ovs-appctl time/warp 5000 100
-
 # Forces revalidators to update all stats.
 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [dnl
 megaflows disabled