mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-01 19:41:19 +00:00
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>
This commit is contained in:
parent
6b098a08ad
commit
c57c054eb5
1 changed files with 1 additions and 2 deletions
|
@ -72,7 +72,6 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
|
||||||
const struct sk_buff *skb)
|
const struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct flow_stats *stats;
|
struct flow_stats *stats;
|
||||||
int node = numa_node_id();
|
|
||||||
int cpu = smp_processor_id();
|
int cpu = smp_processor_id();
|
||||||
int len = skb->len + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
|
int len = skb->len + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
|
||||||
|
|
||||||
|
@ -108,7 +107,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
|
||||||
__GFP_THISNODE |
|
__GFP_THISNODE |
|
||||||
__GFP_NOWARN |
|
__GFP_NOWARN |
|
||||||
__GFP_NOMEMALLOC,
|
__GFP_NOMEMALLOC,
|
||||||
node);
|
numa_node_id());
|
||||||
if (likely(new_stats)) {
|
if (likely(new_stats)) {
|
||||||
new_stats->used = jiffies;
|
new_stats->used = jiffies;
|
||||||
new_stats->packet_count = 1;
|
new_stats->packet_count = 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue