diff options
author | Tonghao Zhang <xiangxia.m.yue@gmail.com> | 2017-07-18 02:28:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-07-19 16:49:39 -0400 |
commit | c57c054eb5b1ccf230c49f736f7a018fcbc3e952 (patch) | |
tree | 7974676b06abaa42d1553bc18fab5d9ec430a3b2 /net/openvswitch/flow.c | |
parent | 6b098a08ad93660e72e9ddbf5869f93bb5719386 (diff) |
openvswitch: Optimize updating for OvS flow_stats.
In the ovs_flow_stats_update(), we only use the node
var to alloc flow_stats struct. But this is not a
common case, it is unnecessary to call the numa_node_id()
everytime. This patch is not a bugfix, but there maybe
a small increase.
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/flow.c')
-rw-r--r-- | net/openvswitch/flow.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index 597d96faca45..6ef51e764367 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c | |||
@@ -72,7 +72,6 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags, | |||
72 | const struct sk_buff *skb) | 72 | const struct sk_buff *skb) |
73 | { | 73 | { |
74 | struct flow_stats *stats; | 74 | struct flow_stats *stats; |
75 | int node = numa_node_id(); | ||
76 | int cpu = smp_processor_id(); | 75 | int cpu = smp_processor_id(); |
77 | int len = skb->len + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0); | 76 | int len = skb->len + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0); |
78 | 77 | ||
@@ -108,7 +107,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags, | |||
108 | __GFP_THISNODE | | 107 | __GFP_THISNODE | |
109 | __GFP_NOWARN | | 108 | __GFP_NOWARN | |
110 | __GFP_NOMEMALLOC, | 109 | __GFP_NOMEMALLOC, |
111 | node); | 110 | numa_node_id()); |
112 | if (likely(new_stats)) { | 111 | if (likely(new_stats)) { |
113 | new_stats->used = jiffies; | 112 | new_stats->used = jiffies; |
114 | new_stats->packet_count = 1; | 113 | new_stats->packet_count = 1; |