netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: rfs: Don't reset RFS entries when nothing changed
@ 2017-05-23  0:45 gfree.wind
  2017-05-23  3:02 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: gfree.wind @ 2017-05-23  0:45 UTC (permalink / raw)
  To: davem, netdev; +Cc: Gao Feng

From: Gao Feng <gfree.wind@vip.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@vip.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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-23  3:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-23  0:45 [PATCH net-next] net: rfs: Don't reset RFS entries when nothing changed gfree.wind
2017-05-23  3:02 ` David Miller
2017-05-23  3:10   ` Gao Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).