This avoids unnecessarily regenerating the skb flow hash
Unified · Split
| @@ -69,7 +69,6 @@ struct fq { · 68 unmodified lines | |||
| 69 | struct list_head backlogs; | 69 | struct list_head backlogs; |
| 70 | spinlock_t lock; | 70 | spinlock_t lock; |
| 71 | u32 flows_cnt; | 71 | u32 flows_cnt; |
| 72 | siphash_key_t perturbation; | ||
| 73 | u32 limit; | 72 | u32 limit; |
| 74 | u32 memory_limit; | 73 | u32 memory_limit; |
| 75 | u32 memory_usage; | 74 | u32 memory_usage; |
| @@ -108,7 +108,7 @@ begin: · 107 unmodified lines | |||
| 108 | 108 | ||
| 109 | static u32 fq_flow_idx(struct fq *fq, struct sk_buff *skb) | 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 | return reciprocal_scale(hash, fq->flows_cnt); | 113 | return reciprocal_scale(hash, fq->flows_cnt); |
| 114 | } | 114 | } |
| @@ -308,7 +308,6 @@ static int fq_init(struct fq *fq, int flows_cnt) · 193 unmodified lines | |||
| 308 | INIT_LIST_HEAD(&fq->backlogs); | 308 | INIT_LIST_HEAD(&fq->backlogs); |
| 309 | spin_lock_init(&fq->lock); | 309 | spin_lock_init(&fq->lock); |
| 310 | fq->flows_cnt = max_t(u32, flows_cnt, 1); | 310 | fq->flows_cnt = max_t(u32, flows_cnt, 1); |
| 311 | get_random_bytes(&fq->perturbation, sizeof(fq->perturbation)); | ||
| 312 | fq->quantum = 300; | 311 | fq->quantum = 300; |
| 313 | fq->limit = 8192; | 312 | fq->limit = 8192; |
| 314 | fq->memory_limit = 16 << 20; /* 16 MBytes */ | 313 | fq->memory_limit = 16 << 20; /* 16 MBytes */ |