summaryrefslogtreecommitdiffstats
path: root/net/openvswitch
diff options
context:
space:
mode:
authorJarno Rajahalme <jrajahalme@nicira.com>2014-03-27 12:51:49 -0700
committerJesse Gross <jesse@nicira.com>2014-05-16 13:40:29 -0700
commit88d73f6c411ac2f057829b93b3cf202ee551f6cb (patch)
treebccf1930aa70037e5e3a7d1d08f8470c188408fb /net/openvswitch
parentd92ab13558599cf73bbc269ce257fe16575d327a (diff)
downloadop-kernel-dev-88d73f6c411ac2f057829b93b3cf202ee551f6cb.zip
op-kernel-dev-88d73f6c411ac2f057829b93b3cf202ee551f6cb.tar.gz
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')
-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 432f04d..e0fc12b 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)
stats = rcu_dereference(flow->stats[node]);
- if ((flow->key.eth.type == htons(ETH_P_IP) ||
- flow->key.eth.type == htons(ETH_P_IPV6)) &&
- flow->key.ip.frag != OVS_FRAG_TYPE_LATER &&
- flow->key.ip.proto == IPPROTO_TCP &&
- likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) {
- tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb));
+ if (likely(flow->key.ip.proto == IPPROTO_TCP)) {
+ if (likely(flow->key.eth.type == htons(ETH_P_IP)))
+ tcp_flags = flow->key.ipv4.tp.flags;
+ else if (likely(flow->key.eth.type == htons(ETH_P_IPV6)))
+ tcp_flags = flow->key.ipv6.tp.flags;
}
-
/* Check if already have node-specific stats. */
if (likely(stats)) {
spin_lock(&stats->lock);
OpenPOWER on IntegriCloud