Lines Matching refs:stats
62 struct sw_flow_stats *stats; in ovs_flow_stats_update() local
66 stats = rcu_dereference(flow->stats[cpu]); in ovs_flow_stats_update()
69 if (likely(stats)) { in ovs_flow_stats_update()
70 spin_lock(&stats->lock); in ovs_flow_stats_update()
75 stats = rcu_dereference(flow->stats[0]); /* Pre-allocated. */ in ovs_flow_stats_update()
76 spin_lock(&stats->lock); in ovs_flow_stats_update()
88 likely(!rcu_access_pointer(flow->stats[cpu]))) { in ovs_flow_stats_update()
106 rcu_assign_pointer(flow->stats[cpu], in ovs_flow_stats_update()
116 stats->used = jiffies; in ovs_flow_stats_update()
117 stats->packet_count++; in ovs_flow_stats_update()
118 stats->byte_count += len; in ovs_flow_stats_update()
119 stats->tcp_flags |= tcp_flags; in ovs_flow_stats_update()
121 spin_unlock(&stats->lock); in ovs_flow_stats_update()
137 struct sw_flow_stats *stats = rcu_dereference_ovsl(flow->stats[cpu]); in ovs_flow_stats_get() local
139 if (stats) { in ovs_flow_stats_get()
143 spin_lock_bh(&stats->lock); in ovs_flow_stats_get()
144 if (!*used || time_after(stats->used, *used)) in ovs_flow_stats_get()
145 *used = stats->used; in ovs_flow_stats_get()
146 *tcp_flags |= stats->tcp_flags; in ovs_flow_stats_get()
147 ovs_stats->n_packets += stats->packet_count; in ovs_flow_stats_get()
148 ovs_stats->n_bytes += stats->byte_count; in ovs_flow_stats_get()
149 spin_unlock_bh(&stats->lock); in ovs_flow_stats_get()
161 struct sw_flow_stats *stats = ovsl_dereference(flow->stats[cpu]); in ovs_flow_stats_clear() local
163 if (stats) { in ovs_flow_stats_clear()
164 spin_lock_bh(&stats->lock); in ovs_flow_stats_clear()
165 stats->used = 0; in ovs_flow_stats_clear()
166 stats->packet_count = 0; in ovs_flow_stats_clear()
167 stats->byte_count = 0; in ovs_flow_stats_clear()
168 stats->tcp_flags = 0; in ovs_flow_stats_clear()
169 spin_unlock_bh(&stats->lock); in ovs_flow_stats_clear()