Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/fq_impl: use skb_get_hash instead of skb_get_hash_perturb

This avoids unnecessarily regenerating the skb flow hash

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20200726130947.88145-1-nbd@nbd.name
[small commit message fixup]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Felix Fietkau and committed by
Johannes Berg
48a54f6b 3ff901cb

+1 -3
-1
include/net/fq.h
··· 69 69 struct list_head backlogs; 70 70 spinlock_t lock; 71 71 u32 flows_cnt; 72 - siphash_key_t perturbation; 73 72 u32 limit; 74 73 u32 memory_limit; 75 74 u32 memory_usage;
+1 -2
include/net/fq_impl.h
··· 108 108 109 109 static u32 fq_flow_idx(struct fq *fq, struct sk_buff *skb) 110 110 { 111 - u32 hash = skb_get_hash_perturb(skb, &fq->perturbation); 111 + u32 hash = skb_get_hash(skb); 112 112 113 113 return reciprocal_scale(hash, fq->flows_cnt); 114 114 } ··· 308 308 INIT_LIST_HEAD(&fq->backlogs); 309 309 spin_lock_init(&fq->lock); 310 310 fq->flows_cnt = max_t(u32, flows_cnt, 1); 311 - get_random_bytes(&fq->perturbation, sizeof(fq->perturbation)); 312 311 fq->quantum = 300; 313 312 fq->limit = 8192; 314 313 fq->memory_limit = 16 << 20; /* 16 MBytes */