[PATCH 4/8] net: sparc64 netdev_map_to_cpu()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Hong H. Pham <hong.pham@xxxxxxxxxxxxx>

Override default netdev_map_to_cpu() implementation with SPARC64
optimized version.

If your (per port) number of receive helpers is at least half the
number of online CPUs, the flow hashing would have a good chance of
evenly distributing the work to strands (cpus) on separate cores.
The sparc optimized cpu distribution for netdev receive helpers would
have little or no effect.

If your number of netdev receive helpers is less than half the number
of online CPUs, the sparc optimized cpu placement with rx flow hashing
has a better chance to distribute work across more cores.

Worst case is if you have 8 rx helpers and all of them are assigned
to the same strand on a single core.  This can happen with the
"generic" linear assignment.  This can't happen with the sparc
optimized netdev_map_to_cpu().

Signed-off-by: Hong H. Pham <hong.pham@xxxxxxxxxxxxx>
---
 arch/sparc/kernel/cpumap.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/sparc/kernel/cpumap.c b/arch/sparc/kernel/cpumap.c
index 7430ed0..8aa308f 100644
--- a/arch/sparc/kernel/cpumap.c
+++ b/arch/sparc/kernel/cpumap.c
@@ -421,6 +421,12 @@ int map_to_cpu(unsigned int index)
 }
 EXPORT_SYMBOL(map_to_cpu);
 
+/* Override default implementation in net/core/dev.c */
+int netdev_map_to_cpu(unsigned int index)
+{
+	return map_to_cpu(index);
+}
+
 void cpu_map_rebuild(void)
 {
 	unsigned long flag;
-- 
1.6.0.4.766.g6fc4a

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux