[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1400274459-56304-12-git-send-email-jesse@nicira.com>
Date: Fri, 16 May 2014 14:07:38 -0700
From: Jesse Gross <jesse@...ira.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org, dev@...nvswitch.org,
Jarno Rajahalme <jrajahalme@...ira.com>,
Pravin B Shelar <pshelar@...ira.com>
Subject: [PATCH net-next 11/12] openvswitch: Use TCP flags in the flow key for stats.
From: Jarno Rajahalme <jrajahalme@...ira.com>
We already extract the TCP flags for the key, might as well use that
for stats.
Signed-off-by: Jarno Rajahalme <jrajahalme@...ira.com>
Acked-by: Pravin B Shelar <pshelar@...ira.com>
Signed-off-by: Jesse Gross <jesse@...ira.com>
---
net/openvswitch/flow.c | 12 +++++-------
1 file 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);
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists