Skip to content

Commit c57c054

Browse files
hao022davem330
authored andcommitted
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>
1 parent 6b098a0 commit c57c054

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎net/openvswitch/flow.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
7272
const struct sk_buff *skb)
7373
{
7474
struct flow_stats *stats;
75-
int node = numa_node_id();
7675
int cpu = smp_processor_id();
7776
int len = skb->len + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
7877

@@ -108,7 +107,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
108107
__GFP_THISNODE |
109108
__GFP_NOWARN |
110109
__GFP_NOMEMALLOC,
111-
node);
110+
numa_node_id());
112111
if (likely(new_stats)) {
113112
new_stats->used = jiffies;
114113
new_stats->packet_count = 1;

0 commit comments

Comments
 (0)