mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 08:35:19 -05:00
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>
This commit is contained in:
parent
3ff901cb5d
commit
48a54f6bc4
2 changed files with 1 additions and 3 deletions
|
@ -69,7 +69,6 @@ struct fq {
|
||||||
struct list_head backlogs;
|
struct list_head backlogs;
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
u32 flows_cnt;
|
u32 flows_cnt;
|
||||||
siphash_key_t perturbation;
|
|
||||||
u32 limit;
|
u32 limit;
|
||||||
u32 memory_limit;
|
u32 memory_limit;
|
||||||
u32 memory_usage;
|
u32 memory_usage;
|
||||||
|
|
|
@ -108,7 +108,7 @@ begin:
|
||||||
|
|
||||||
static u32 fq_flow_idx(struct fq *fq, struct sk_buff *skb)
|
static u32 fq_flow_idx(struct fq *fq, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
u32 hash = skb_get_hash_perturb(skb, &fq->perturbation);
|
u32 hash = skb_get_hash(skb);
|
||||||
|
|
||||||
return reciprocal_scale(hash, fq->flows_cnt);
|
return reciprocal_scale(hash, fq->flows_cnt);
|
||||||
}
|
}
|
||||||
|
@ -308,7 +308,6 @@ static int fq_init(struct fq *fq, int flows_cnt)
|
||||||
INIT_LIST_HEAD(&fq->backlogs);
|
INIT_LIST_HEAD(&fq->backlogs);
|
||||||
spin_lock_init(&fq->lock);
|
spin_lock_init(&fq->lock);
|
||||||
fq->flows_cnt = max_t(u32, flows_cnt, 1);
|
fq->flows_cnt = max_t(u32, flows_cnt, 1);
|
||||||
get_random_bytes(&fq->perturbation, sizeof(fq->perturbation));
|
|
||||||
fq->quantum = 300;
|
fq->quantum = 300;
|
||||||
fq->limit = 8192;
|
fq->limit = 8192;
|
||||||
fq->memory_limit = 16 << 20; /* 16 MBytes */
|
fq->memory_limit = 16 << 20; /* 16 MBytes */
|
||||||
|
|
Loading…
Add table
Reference in a new issue