2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-20 03:24:03 +08:00

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>
This commit is contained in:
Jarno Rajahalme 2014-03-27 12:51:49 -07:00 committed by Jesse Gross
parent d92ab13558
commit 88d73f6c41

View File

@ -69,14 +69,12 @@ void ovs_flow_stats_update(struct sw_flow *flow, struct sk_buff *skb)
stats = rcu_dereference(flow->stats[node]); stats = rcu_dereference(flow->stats[node]);
if ((flow->key.eth.type == htons(ETH_P_IP) || if (likely(flow->key.ip.proto == IPPROTO_TCP)) {
flow->key.eth.type == htons(ETH_P_IPV6)) && if (likely(flow->key.eth.type == htons(ETH_P_IP)))
flow->key.ip.frag != OVS_FRAG_TYPE_LATER && tcp_flags = flow->key.ipv4.tp.flags;
flow->key.ip.proto == IPPROTO_TCP && else if (likely(flow->key.eth.type == htons(ETH_P_IPV6)))
likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) { tcp_flags = flow->key.ipv6.tp.flags;
tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb));
} }
/* Check if already have node-specific stats. */ /* Check if already have node-specific stats. */
if (likely(stats)) { if (likely(stats)) {
spin_lock(&stats->lock); spin_lock(&stats->lock);