Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.
Prev Previous commit
Next Next commit
save the cpu id so we dont have to go over it again
  • Loading branch information
crucially committed Oct 21, 2013
commit 3c77c764d4b8b26aeaafb77e8e1a2cba9b52bcfe
5 changes: 3 additions & 2 deletions net/ipv4/inet_hashtables.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ struct sock *__inet_lookup_listener(struct net *net,
unsigned int hash = inet_lhashfn(net, hnum);
struct inet_listen_hashbucket *ilb = &hashinfo->listening_hash[hash];
int score, hiscore, matches = 0, reuseport = 0;
u32 phash = 0;
// u32 phash = 0;
int curr_cpu = smp_processor_id();

rcu_read_lock();
begin:
Expand All @@ -208,7 +209,7 @@ struct sock *__inet_lookup_listener(struct net *net,
it is critical that a RSS queue is bound to a specific cpu
*/

if (matches++ == smp_processor_id()) {
if (matches++ == curr_cpu) {
result = sk;
}

Expand Down