- dp_netdev_flow_unref(flow);
-}
-
-static struct dp_netdev_flow *
-dp_netdev_flow_ref(const struct dp_netdev_flow *flow_)
-{
- struct dp_netdev_flow *flow = CONST_CAST(struct dp_netdev_flow *, flow_);
- if (flow) {
- ovs_refcount_ref(&flow->ref_cnt);
- }
- return flow;
-}
-
-static void
-dp_netdev_flow_unref(struct dp_netdev_flow *flow)
-{
- if (flow && ovs_refcount_unref(&flow->ref_cnt) == 1) {
- struct dp_netdev_flow_stats *bucket;
- size_t i;
-
- OVSTHREAD_STATS_FOR_EACH_BUCKET (bucket, i, &flow->stats) {
- ovs_mutex_destroy(&bucket->mutex);
- free_cacheline(bucket);
- }
- ovsthread_stats_destroy(&flow->stats);
-
- cls_rule_destroy(CONST_CAST(struct cls_rule *, &flow->cr));
- ovs_mutex_lock(&flow->mutex);
- dp_netdev_actions_unref(flow->actions);
- ovs_mutex_unlock(&flow->mutex);
- ovs_mutex_destroy(&flow->mutex);
- free(flow);
- }