This avoids unnecessarily regenerating the skb flow hash
Showing the changes to include (2 of 2 files). Show all
Unified · Split
| @@ -69,7 +69,6 @@ struct fq { · 68 unmodified lines | ||
| 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; |
| @@ -108,7 +108,7 @@ begin: · 107 unmodified lines | ||
| 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,7 +308,6 @@ static int fq_init(struct fq *fq, int flows_cnt) · 193 unmodified lines | ||
| 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 */ |