lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 18 Mar 2010 14:48:29 +0800 From: Changli Gao <xiaosuo@...il.com> To: Eric Dumazet <eric.dumazet@...il.com> Cc: Tom Herbert <therbert@...gle.com>, David Miller <davem@...emloft.net>, netdev@...r.kernel.org Subject: Re: [PATCH v7] rps: Receive Packet Steering On Thu, Mar 18, 2010 at 2:20 PM, Eric Dumazet <eric.dumazet@...il.com> wrote: > Le mercredi 17 mars 2010 à 16:50 -0700, Tom Herbert a écrit : >> >> Here is a patch for this... >> >> Allow specification of CPUs in rps to be done with a vector instead of a bit map. This allows relative weighting of CPUs in the map by repeating ones to give higher weight. >> >> For example "echo 0 0 0 3 4 4 4 4 > /sys/class/net/eth0/queues/rx-0/rps_cpus" >> >> assigns CPUs 0, 3, and 4 to the RPS mask with relative weights 3, 1, and 4 respectively. >> > > Hmm... > > I believe we should keep existing sysfs cpumask interface, because its > the only workable thing on a PAGE_SIZE=4096 machine with 4096 cpus. > > strlen("0 1 2 3 4 ... 4095") = 19369 > > Using base 16 instead of base 10 -> 16111 > sigh! How about adding file for each cpu weight setting. .../rx-0/rps_cpu0...n BTW: I think exporting the hook of hash function will help in some case. So users can choose which hash to use depend on their applications. I know FreeBSD supports hash based on flow, source or CPU. Some network application have multiple instances for taking full advantage of the SMP/C hardware, and each instance binds to a special CPU/Core, so they need some kind of load distributing algorithm for load balancing. For example, memcached uses hash based on key, and its developer may implement a hash function for RPS. Then it apply the following iptables rule: iptables -A PREROUTING -t nat -m cpu --cpuid 0 -m tcp --dport 1234 --REDIRECT 8081 iptables -A PREROUTING -t nat -m cpu --cpuid 0 -m tcp --dport 1234 --REDIRECT 8082 ... No other things to change, it can take full advantage of the underlying hardware transparently. -- Regards, Changli Gao(xiaosuo@...il.com) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists