aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/flow.c
diff options
context:
space:
mode:
authorJarno Rajahalme <jrajahalme@nicira.com>2014-03-27 15:51:49 -0400
committerJesse Gross <jesse@nicira.com>2014-05-16 16:40:29 -0400
commit88d73f6c411ac2f057829b93b3cf202ee551f6cb (patch)
treebccf1930aa70037e5e3a7d1d08f8470c188408fb /net/openvswitch/flow.c
parentd92ab13558599cf73bbc269ce257fe16575d327a (diff)
openvswitch: Use TCP flags in the flow key for stats.
We already extract the TCP flags for the key, might as well use that for stats. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'net/openvswitch/flow.c')
-rw-r--r--net/openvswitch/flow.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index 432f04d5c896..e0fc12bbeeb1 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -69,14 +69,12 @@ void ovs_flow_stats_update(struct sw_flow *flow, struct sk_buff *skb)
69 69
70 stats = rcu_dereference(flow->stats[node]); 70 stats = rcu_dereference(flow->stats[node]);
71 71
72 if ((flow->key.eth.type == htons(ETH_P_IP) || 72 if (likely(flow->key.ip.proto == IPPROTO_TCP)) {
73 flow->key.eth.type == htons(ETH_P_IPV6)) && 73 if (likely(flow->key.eth.type == htons(ETH_P_IP)))
74 flow->key.ip.frag != OVS_FRAG_TYPE_LATER && 74 tcp_flags = flow->key.ipv4.tp.flags;
75 flow->key.ip.proto == IPPROTO_TCP && 75 else if (likely(flow->key.eth.type == htons(ETH_P_IPV6)))
76 likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) { 76 tcp_flags = flow->key.ipv6.tp.flags;
77 tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb));
78 } 77 }
79
80 /* Check if already have node-specific stats. */ 78 /* Check if already have node-specific stats. */
81 if (likely(stats)) { 79 if (likely(stats)) {
82 spin_lock(&stats->lock); 80 spin_lock(&stats->lock);