[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1495500311-81095-1-git-send-email-gfree.wind@vip.163.com>
Date: Tue, 23 May 2017 08:45:11 +0800
From: gfree.wind@....163.com
To: davem@...emloft.net, netdev@...r.kernel.org
Cc: Gao Feng <gfree.wind@....163.com>
Subject: [PATCH net-next] net: rfs: Don't reset RFS entries when nothing changed
From: Gao Feng <gfree.wind@....163.com>
When the new RFS table size specified by sysctl equals the old one,
there is nothing changed actually. So it is unnecessary to reset the
RFS table entris.
Signed-off-by: Gao Feng <gfree.wind@....163.com>
---
net/core/sysctl_net_core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index ea23254..80b6a7e 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -69,11 +69,12 @@ static int rps_sock_flow_sysctl(struct ctl_table *table, int write,
}
rps_cpu_mask = roundup_pow_of_two(nr_cpu_ids) - 1;
sock_table->mask = size - 1;
+
+ for (i = 0; i < size; i++)
+ sock_table->ents[i] = RPS_NO_CPU;
} else
sock_table = orig_sock_table;
- for (i = 0; i < size; i++)
- sock_table->ents[i] = RPS_NO_CPU;
} else
sock_table = NULL;
--
1.9.1
Powered by blists - more mailing lists