git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
revalidator: Fix ukey stats cache updating.
[sliver-openvswitch.git]
/
datapath
/
flow.c
diff --git
a/datapath/flow.c
b/datapath/flow.c
index
4e9c4c7
..
c52081b
100644
(file)
--- a/
datapath/flow.c
+++ b/
datapath/flow.c
@@
-62,10
+62,10
@@
u64 ovs_flow_used_time(unsigned long flow_jiffies)
#define TCP_FLAGS_BE16(tp) (*(__be16 *)&tcp_flag_word(tp) & htons(0x0FFF))
#define TCP_FLAGS_BE16(tp) (*(__be16 *)&tcp_flag_word(tp) & htons(0x0FFF))
-void ovs_flow_stats_update(struct sw_flow *flow, struct sk_buff *skb)
+void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
+ struct sk_buff *skb)
{
struct flow_stats *stats;
{
struct flow_stats *stats;
- __be16 tcp_flags = flow->key.tp.flags;
int node = numa_node_id();
stats = rcu_dereference(flow->stats[node]);
int node = numa_node_id();
stats = rcu_dereference(flow->stats[node]);
@@
-123,7
+123,9
@@
unlock:
spin_unlock(&stats->lock);
}
spin_unlock(&stats->lock);
}
-void ovs_flow_stats_get(struct sw_flow *flow, struct ovs_flow_stats *ovs_stats,
+/* Must be called with rcu_read_lock or ovs_mutex. */
+void ovs_flow_stats_get(const struct sw_flow *flow,
+ struct ovs_flow_stats *ovs_stats,
unsigned long *used, __be16 *tcp_flags)
{
int node;
unsigned long *used, __be16 *tcp_flags)
{
int node;
@@
-133,7
+135,7
@@
void ovs_flow_stats_get(struct sw_flow *flow, struct ovs_flow_stats *ovs_stats,
memset(ovs_stats, 0, sizeof(*ovs_stats));
for_each_node(node) {
memset(ovs_stats, 0, sizeof(*ovs_stats));
for_each_node(node) {
- struct flow_stats *stats = rcu_dereference(flow->stats[node]);
+ struct flow_stats *stats = rcu_dereference
_ovsl
(flow->stats[node]);
if (stats) {
/* Local CPU may write on non-local stats, so we must
if (stats) {
/* Local CPU may write on non-local stats, so we must
@@
-150,12
+152,13
@@
void ovs_flow_stats_get(struct sw_flow *flow, struct ovs_flow_stats *ovs_stats,
}
}
}
}
+/* Called with ovs_mutex. */
void ovs_flow_stats_clear(struct sw_flow *flow)
{
int node;
for_each_node(node) {
void ovs_flow_stats_clear(struct sw_flow *flow)
{
int node;
for_each_node(node) {
- struct flow_stats *stats =
rcu
_dereference(flow->stats[node]);
+ struct flow_stats *stats =
ovsl
_dereference(flow->stats[node]);
if (stats) {
spin_lock_bh(&stats->lock);
if (stats) {
spin_lock_bh(&stats->lock);