Squashed commit of the following:
commit
f10682ce0c9e034bef3d3a42a3e2fcebe0c94691
Author: Bhagya Tholpady <bbantwal@cisco.com>
Date: Fri May 24 17:06:38 2019 -0400
flow: check if flow is actually deleted before updating memstats
if ( flow->next )
unlink_uni(flow);
- memory::MemoryCap::update_deallocations(config.cap_weight);
- return hash_table->remove(flow->key);
+ bool deleted = hash_table->remove(flow->key);
+
+ // FIXIT-M This check is added for offload case where both Flow::reset
+ // and Flow::retire try remove the flow from hash. Flow::reset should
+ // just mark the flow as pending instead of trying to remove it.
+ if ( deleted )
+ memory::MemoryCap::update_deallocations(config.cap_weight);
+
+ return deleted;
}
int FlowCache::retire(Flow* flow)