Skip to content

Commit

Permalink
datapath: Optimize updating for OvS flow_stats.
Browse files Browse the repository at this point in the history
Upstream commit:
	commit c57c054eb5b1ccf230c49f736f7a018fcbc3e952
	Author: Tonghao Zhang <[email protected]>
	Date:   Mon Jul 17 23:28:05 2017 -0700

	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 <[email protected]>
	Signed-off-by: David S. Miller <[email protected]>

Signed-off-by: Tonghao Zhang <[email protected]>
Signed-off-by: Andy Zhou <[email protected]>
  • Loading branch information
xpu22 authored and azhou-nicira committed Sep 22, 2017
1 parent dde28a2 commit 230f723
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions datapath/flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
const struct sk_buff *skb)
{
struct flow_stats *stats;
int node = numa_node_id();
int cpu = smp_processor_id();
int len = skb->len + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);

Expand Down Expand Up @@ -107,7 +106,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
__GFP_THISNODE |
__GFP_NOWARN |
__GFP_NOMEMALLOC,
node);
numa_node_id());
if (likely(new_stats)) {
new_stats->used = jiffies;
new_stats->packet_count = 1;
Expand Down

0 comments on commit 230f723

Please sign in to comment.