diff options
Diffstat (limited to 'include/net/fq_impl.h')
-rw-r--r-- | include/net/fq_impl.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/net/fq_impl.h b/include/net/fq_impl.h index 4e6131cd3f43..ac1a2317941e 100644 --- a/include/net/fq_impl.h +++ b/include/net/fq_impl.h | |||
@@ -146,6 +146,7 @@ static void fq_tin_enqueue(struct fq *fq, | |||
146 | fq_flow_get_default_t get_default_func) | 146 | fq_flow_get_default_t get_default_func) |
147 | { | 147 | { |
148 | struct fq_flow *flow; | 148 | struct fq_flow *flow; |
149 | bool oom; | ||
149 | 150 | ||
150 | lockdep_assert_held(&fq->lock); | 151 | lockdep_assert_held(&fq->lock); |
151 | 152 | ||
@@ -167,8 +168,8 @@ static void fq_tin_enqueue(struct fq *fq, | |||
167 | } | 168 | } |
168 | 169 | ||
169 | __skb_queue_tail(&flow->queue, skb); | 170 | __skb_queue_tail(&flow->queue, skb); |
170 | 171 | oom = (fq->memory_usage > fq->memory_limit); | |
171 | if (fq->backlog > fq->limit || fq->memory_usage > fq->memory_limit) { | 172 | while (fq->backlog > fq->limit || oom) { |
172 | flow = list_first_entry_or_null(&fq->backlogs, | 173 | flow = list_first_entry_or_null(&fq->backlogs, |
173 | struct fq_flow, | 174 | struct fq_flow, |
174 | backlogchain); | 175 | backlogchain); |
@@ -183,8 +184,10 @@ static void fq_tin_enqueue(struct fq *fq, | |||
183 | 184 | ||
184 | flow->tin->overlimit++; | 185 | flow->tin->overlimit++; |
185 | fq->overlimit++; | 186 | fq->overlimit++; |
186 | if (fq->memory_usage > fq->memory_limit) | 187 | if (oom) { |
187 | fq->overmemory++; | 188 | fq->overmemory++; |
189 | oom = (fq->memory_usage > fq->memory_limit); | ||
190 | } | ||
188 | } | 191 | } |
189 | } | 192 | } |
190 | 193 | ||