projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[RAMEN9610-21564]net/flow_dissector: switch to siphash
[GitHub/MotorolaMobilityLLC/kernel-slsi.git]
/
include
/
net
/
fq_impl.h
diff --git
a/include/net/fq_impl.h
b/include/net/fq_impl.h
index 4e6131cd3f43dfb711049a1925abbea6074ec25b..46903e23eab9bad0c83eb781662eb129baf78d48 100644
(file)
--- a/
include/net/fq_impl.h
+++ b/
include/net/fq_impl.h
@@
-105,7
+105,7
@@
static struct fq_flow *fq_flow_classify(struct fq *fq,
lockdep_assert_held(&fq->lock);
lockdep_assert_held(&fq->lock);
- hash = skb_get_hash_perturb(skb, fq->perturbation);
+ hash = skb_get_hash_perturb(skb,
&
fq->perturbation);
idx = reciprocal_scale(hash, fq->flows_cnt);
flow = &fq->flows[idx];
idx = reciprocal_scale(hash, fq->flows_cnt);
flow = &fq->flows[idx];
@@
-146,6
+146,7
@@
static void fq_tin_enqueue(struct fq *fq,
fq_flow_get_default_t get_default_func)
{
struct fq_flow *flow;
fq_flow_get_default_t get_default_func)
{
struct fq_flow *flow;
+ bool oom;
lockdep_assert_held(&fq->lock);
lockdep_assert_held(&fq->lock);
@@
-167,8
+168,8
@@
static void fq_tin_enqueue(struct fq *fq,
}
__skb_queue_tail(&flow->queue, skb);
}
__skb_queue_tail(&flow->queue, skb);
-
-
if (fq->backlog > fq->limit || fq->memory_usage > fq->memory_limit
) {
+ oom = (fq->memory_usage > fq->memory_limit);
+
while (fq->backlog > fq->limit || oom
) {
flow = list_first_entry_or_null(&fq->backlogs,
struct fq_flow,
backlogchain);
flow = list_first_entry_or_null(&fq->backlogs,
struct fq_flow,
backlogchain);
@@
-183,8
+184,10
@@
static void fq_tin_enqueue(struct fq *fq,
flow->tin->overlimit++;
fq->overlimit++;
flow->tin->overlimit++;
fq->overlimit++;
- if (
fq->memory_usage > fq->memory_limit)
+ if (
oom) {
fq->overmemory++;
fq->overmemory++;
+ oom = (fq->memory_usage > fq->memory_limit);
+ }
}
}
}
}
@@
-252,7
+255,7
@@
static int fq_init(struct fq *fq, int flows_cnt)
INIT_LIST_HEAD(&fq->backlogs);
spin_lock_init(&fq->lock);
fq->flows_cnt = max_t(u32, flows_cnt, 1);
INIT_LIST_HEAD(&fq->backlogs);
spin_lock_init(&fq->lock);
fq->flows_cnt = max_t(u32, flows_cnt, 1);
-
fq->perturbation = prandom_u32(
);
+
get_random_bytes(&fq->perturbation, sizeof(fq->perturbation)
);
fq->quantum = 300;
fq->limit = 8192;
fq->memory_limit = 16 << 20; /* 16 MBytes */
fq->quantum = 300;
fq->limit = 8192;
fq->memory_limit = 16 << 20; /* 16 MBytes */