Thomas Gleixner | fb9e53c | 2019-05-29 07:12:31 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2016 Qualcomm Atheros, Inc |
| 4 | * |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 5 | * Based on net/sched/sch_fq_codel.c |
| 6 | */ |
| 7 | #ifndef __NET_SCHED_FQ_IMPL_H |
| 8 | #define __NET_SCHED_FQ_IMPL_H |
| 9 | |
| 10 | #include <net/fq.h> |
| 11 | |
| 12 | /* functions that are embedded into includer */ |
| 13 | |
Felix Fietkau | 07be2fe | 2020-12-18 19:47:13 +0100 | [diff] [blame] | 14 | |
| 15 | static void |
| 16 | __fq_adjust_removal(struct fq *fq, struct fq_flow *flow, unsigned int packets, |
| 17 | unsigned int bytes, unsigned int truesize) |
| 18 | { |
| 19 | struct fq_tin *tin = flow->tin; |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 20 | int idx; |
Felix Fietkau | 07be2fe | 2020-12-18 19:47:13 +0100 | [diff] [blame] | 21 | |
| 22 | tin->backlog_bytes -= bytes; |
| 23 | tin->backlog_packets -= packets; |
| 24 | flow->backlog -= bytes; |
| 25 | fq->backlog -= packets; |
| 26 | fq->memory_usage -= truesize; |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 27 | |
| 28 | if (flow->backlog) |
| 29 | return; |
| 30 | |
| 31 | if (flow == &tin->default_flow) { |
| 32 | list_del_init(&tin->tin_list); |
| 33 | return; |
| 34 | } |
| 35 | |
| 36 | idx = flow - fq->flows; |
| 37 | __clear_bit(idx, fq->flows_bitmap); |
Felix Fietkau | 07be2fe | 2020-12-18 19:47:13 +0100 | [diff] [blame] | 38 | } |
| 39 | |
Johannes Berg | 8c418b5 | 2017-10-06 11:53:32 +0200 | [diff] [blame] | 40 | static void fq_adjust_removal(struct fq *fq, |
| 41 | struct fq_flow *flow, |
| 42 | struct sk_buff *skb) |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 43 | { |
Felix Fietkau | 07be2fe | 2020-12-18 19:47:13 +0100 | [diff] [blame] | 44 | __fq_adjust_removal(fq, flow, 1, skb->len, skb->truesize); |
Johannes Berg | 8c418b5 | 2017-10-06 11:53:32 +0200 | [diff] [blame] | 45 | } |
| 46 | |
Johannes Berg | 8c418b5 | 2017-10-06 11:53:32 +0200 | [diff] [blame] | 47 | static struct sk_buff *fq_flow_dequeue(struct fq *fq, |
| 48 | struct fq_flow *flow) |
| 49 | { |
| 50 | struct sk_buff *skb; |
| 51 | |
| 52 | lockdep_assert_held(&fq->lock); |
| 53 | |
| 54 | skb = __skb_dequeue(&flow->queue); |
| 55 | if (!skb) |
| 56 | return NULL; |
| 57 | |
| 58 | fq_adjust_removal(fq, flow, skb); |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 59 | |
| 60 | return skb; |
| 61 | } |
| 62 | |
Felix Fietkau | 07be2fe | 2020-12-18 19:47:13 +0100 | [diff] [blame] | 63 | static int fq_flow_drop(struct fq *fq, struct fq_flow *flow, |
| 64 | fq_skb_free_t free_func) |
| 65 | { |
| 66 | unsigned int packets = 0, bytes = 0, truesize = 0; |
| 67 | struct fq_tin *tin = flow->tin; |
| 68 | struct sk_buff *skb; |
| 69 | int pending; |
| 70 | |
| 71 | lockdep_assert_held(&fq->lock); |
| 72 | |
| 73 | pending = min_t(int, 32, skb_queue_len(&flow->queue) / 2); |
| 74 | do { |
| 75 | skb = __skb_dequeue(&flow->queue); |
| 76 | if (!skb) |
| 77 | break; |
| 78 | |
| 79 | packets++; |
| 80 | bytes += skb->len; |
| 81 | truesize += skb->truesize; |
| 82 | free_func(fq, tin, flow, skb); |
| 83 | } while (packets < pending); |
| 84 | |
| 85 | __fq_adjust_removal(fq, flow, packets, bytes, truesize); |
Felix Fietkau | 07be2fe | 2020-12-18 19:47:13 +0100 | [diff] [blame] | 86 | |
| 87 | return packets; |
| 88 | } |
| 89 | |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 90 | static struct sk_buff *fq_tin_dequeue(struct fq *fq, |
| 91 | struct fq_tin *tin, |
| 92 | fq_tin_dequeue_t dequeue_func) |
| 93 | { |
| 94 | struct fq_flow *flow; |
| 95 | struct list_head *head; |
| 96 | struct sk_buff *skb; |
| 97 | |
| 98 | lockdep_assert_held(&fq->lock); |
| 99 | |
| 100 | begin: |
| 101 | head = &tin->new_flows; |
| 102 | if (list_empty(head)) { |
| 103 | head = &tin->old_flows; |
| 104 | if (list_empty(head)) |
| 105 | return NULL; |
| 106 | } |
| 107 | |
| 108 | flow = list_first_entry(head, struct fq_flow, flowchain); |
| 109 | |
| 110 | if (flow->deficit <= 0) { |
| 111 | flow->deficit += fq->quantum; |
| 112 | list_move_tail(&flow->flowchain, |
| 113 | &tin->old_flows); |
| 114 | goto begin; |
| 115 | } |
| 116 | |
| 117 | skb = dequeue_func(fq, tin, flow); |
| 118 | if (!skb) { |
| 119 | /* force a pass through old_flows to prevent starvation */ |
| 120 | if ((head == &tin->new_flows) && |
| 121 | !list_empty(&tin->old_flows)) { |
| 122 | list_move_tail(&flow->flowchain, &tin->old_flows); |
| 123 | } else { |
| 124 | list_del_init(&flow->flowchain); |
| 125 | flow->tin = NULL; |
| 126 | } |
| 127 | goto begin; |
| 128 | } |
| 129 | |
| 130 | flow->deficit -= skb->len; |
| 131 | tin->tx_bytes += skb->len; |
| 132 | tin->tx_packets++; |
| 133 | |
| 134 | return skb; |
| 135 | } |
| 136 | |
Felix Fietkau | f2af2df | 2019-03-16 18:06:32 +0100 | [diff] [blame] | 137 | static u32 fq_flow_idx(struct fq *fq, struct sk_buff *skb) |
| 138 | { |
Felix Fietkau | 48a54f6b | 2020-07-26 15:09:46 +0200 | [diff] [blame] | 139 | u32 hash = skb_get_hash(skb); |
Felix Fietkau | f2af2df | 2019-03-16 18:06:32 +0100 | [diff] [blame] | 140 | |
| 141 | return reciprocal_scale(hash, fq->flows_cnt); |
| 142 | } |
| 143 | |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 144 | static struct fq_flow *fq_flow_classify(struct fq *fq, |
Felix Fietkau | f2af2df | 2019-03-16 18:06:32 +0100 | [diff] [blame] | 145 | struct fq_tin *tin, u32 idx, |
Felix Fietkau | bf9009b | 2020-12-18 19:47:14 +0100 | [diff] [blame] | 146 | struct sk_buff *skb) |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 147 | { |
| 148 | struct fq_flow *flow; |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 149 | |
| 150 | lockdep_assert_held(&fq->lock); |
| 151 | |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 152 | flow = &fq->flows[idx]; |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 153 | if (flow->tin && flow->tin != tin) { |
Felix Fietkau | bf9009b | 2020-12-18 19:47:14 +0100 | [diff] [blame] | 154 | flow = &tin->default_flow; |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 155 | tin->collisions++; |
| 156 | fq->collisions++; |
| 157 | } |
| 158 | |
| 159 | if (!flow->tin) |
| 160 | tin->flows++; |
| 161 | |
| 162 | return flow; |
| 163 | } |
| 164 | |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 165 | static struct fq_flow *fq_find_fattest_flow(struct fq *fq) |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 166 | { |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 167 | struct fq_tin *tin; |
| 168 | struct fq_flow *flow = NULL; |
| 169 | u32 len = 0; |
| 170 | int i; |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 171 | |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 172 | for_each_set_bit(i, fq->flows_bitmap, fq->flows_cnt) { |
| 173 | struct fq_flow *cur = &fq->flows[i]; |
| 174 | unsigned int cur_len; |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 175 | |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 176 | cur_len = cur->backlog; |
| 177 | if (cur_len <= len) |
| 178 | continue; |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 179 | |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 180 | flow = cur; |
| 181 | len = cur_len; |
| 182 | } |
| 183 | |
| 184 | list_for_each_entry(tin, &fq->tin_backlog, tin_list) { |
| 185 | unsigned int cur_len = tin->default_flow.backlog; |
| 186 | |
| 187 | if (cur_len <= len) |
| 188 | continue; |
| 189 | |
| 190 | flow = &tin->default_flow; |
| 191 | len = cur_len; |
| 192 | } |
| 193 | |
| 194 | return flow; |
Michal Kazior | b43e719 | 2016-04-27 12:59:13 +0200 | [diff] [blame] | 195 | } |
| 196 | |
| 197 | static void fq_tin_enqueue(struct fq *fq, |
Felix Fietkau | f2af2df | 2019-03-16 18:06:32 +0100 | [diff] [blame] | 198 | struct fq_tin *tin, u32 idx, |
Michal Kazior | b43e719 | 2016-04-27 12:59:13 +0200 | [diff] [blame] | 199 | struct sk_buff *skb, |
Felix Fietkau | bf9009b | 2020-12-18 19:47:14 +0100 | [diff] [blame] | 200 | fq_skb_free_t free_func) |
Michal Kazior | b43e719 | 2016-04-27 12:59:13 +0200 | [diff] [blame] | 201 | { |
| 202 | struct fq_flow *flow; |
Toke Høiland-Jørgensen | 0bfe649 | 2017-10-16 17:05:57 +0200 | [diff] [blame] | 203 | bool oom; |
Michal Kazior | b43e719 | 2016-04-27 12:59:13 +0200 | [diff] [blame] | 204 | |
| 205 | lockdep_assert_held(&fq->lock); |
| 206 | |
Felix Fietkau | bf9009b | 2020-12-18 19:47:14 +0100 | [diff] [blame] | 207 | flow = fq_flow_classify(fq, tin, idx, skb); |
Michal Kazior | b43e719 | 2016-04-27 12:59:13 +0200 | [diff] [blame] | 208 | |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 209 | if (!flow->backlog) { |
| 210 | if (flow != &tin->default_flow) |
| 211 | __set_bit(idx, fq->flows_bitmap); |
| 212 | else if (list_empty(&tin->tin_list)) |
| 213 | list_add(&tin->tin_list, &fq->tin_backlog); |
| 214 | } |
| 215 | |
Michal Kazior | b43e719 | 2016-04-27 12:59:13 +0200 | [diff] [blame] | 216 | flow->tin = tin; |
| 217 | flow->backlog += skb->len; |
| 218 | tin->backlog_bytes += skb->len; |
| 219 | tin->backlog_packets++; |
Toke Høiland-Jørgensen | 097b065 | 2016-09-23 21:59:09 +0200 | [diff] [blame] | 220 | fq->memory_usage += skb->truesize; |
Michal Kazior | b43e719 | 2016-04-27 12:59:13 +0200 | [diff] [blame] | 221 | fq->backlog++; |
| 222 | |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 223 | if (list_empty(&flow->flowchain)) { |
| 224 | flow->deficit = fq->quantum; |
| 225 | list_add_tail(&flow->flowchain, |
| 226 | &tin->new_flows); |
| 227 | } |
| 228 | |
| 229 | __skb_queue_tail(&flow->queue, skb); |
Toke Høiland-Jørgensen | 0bfe649 | 2017-10-16 17:05:57 +0200 | [diff] [blame] | 230 | oom = (fq->memory_usage > fq->memory_limit); |
| 231 | while (fq->backlog > fq->limit || oom) { |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 232 | flow = fq_find_fattest_flow(fq); |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 233 | if (!flow) |
| 234 | return; |
| 235 | |
Felix Fietkau | 07be2fe | 2020-12-18 19:47:13 +0100 | [diff] [blame] | 236 | if (!fq_flow_drop(fq, flow, free_func)) |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 237 | return; |
| 238 | |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 239 | flow->tin->overlimit++; |
| 240 | fq->overlimit++; |
Toke Høiland-Jørgensen | 0bfe649 | 2017-10-16 17:05:57 +0200 | [diff] [blame] | 241 | if (oom) { |
Toke Høiland-Jørgensen | 097b065 | 2016-09-23 21:59:09 +0200 | [diff] [blame] | 242 | fq->overmemory++; |
Toke Høiland-Jørgensen | 0bfe649 | 2017-10-16 17:05:57 +0200 | [diff] [blame] | 243 | oom = (fq->memory_usage > fq->memory_limit); |
| 244 | } |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 245 | } |
| 246 | } |
| 247 | |
Johannes Berg | 8c418b5 | 2017-10-06 11:53:32 +0200 | [diff] [blame] | 248 | static void fq_flow_filter(struct fq *fq, |
| 249 | struct fq_flow *flow, |
| 250 | fq_skb_filter_t filter_func, |
| 251 | void *filter_data, |
| 252 | fq_skb_free_t free_func) |
| 253 | { |
| 254 | struct fq_tin *tin = flow->tin; |
| 255 | struct sk_buff *skb, *tmp; |
| 256 | |
| 257 | lockdep_assert_held(&fq->lock); |
| 258 | |
| 259 | skb_queue_walk_safe(&flow->queue, skb, tmp) { |
| 260 | if (!filter_func(fq, tin, flow, skb, filter_data)) |
| 261 | continue; |
| 262 | |
| 263 | __skb_unlink(skb, &flow->queue); |
| 264 | fq_adjust_removal(fq, flow, skb); |
| 265 | free_func(fq, tin, flow, skb); |
| 266 | } |
Johannes Berg | 8c418b5 | 2017-10-06 11:53:32 +0200 | [diff] [blame] | 267 | } |
| 268 | |
| 269 | static void fq_tin_filter(struct fq *fq, |
| 270 | struct fq_tin *tin, |
| 271 | fq_skb_filter_t filter_func, |
| 272 | void *filter_data, |
| 273 | fq_skb_free_t free_func) |
| 274 | { |
| 275 | struct fq_flow *flow; |
| 276 | |
| 277 | lockdep_assert_held(&fq->lock); |
| 278 | |
| 279 | list_for_each_entry(flow, &tin->new_flows, flowchain) |
| 280 | fq_flow_filter(fq, flow, filter_func, filter_data, free_func); |
| 281 | list_for_each_entry(flow, &tin->old_flows, flowchain) |
| 282 | fq_flow_filter(fq, flow, filter_func, filter_data, free_func); |
| 283 | } |
| 284 | |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 285 | static void fq_flow_reset(struct fq *fq, |
| 286 | struct fq_flow *flow, |
| 287 | fq_skb_free_t free_func) |
| 288 | { |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 289 | struct fq_tin *tin = flow->tin; |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 290 | struct sk_buff *skb; |
| 291 | |
| 292 | while ((skb = fq_flow_dequeue(fq, flow))) |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 293 | free_func(fq, tin, flow, skb); |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 294 | |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 295 | if (!list_empty(&flow->flowchain)) { |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 296 | list_del_init(&flow->flowchain); |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 297 | if (list_empty(&tin->new_flows) && |
| 298 | list_empty(&tin->old_flows)) |
| 299 | list_del_init(&tin->tin_list); |
| 300 | } |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 301 | |
| 302 | flow->tin = NULL; |
| 303 | |
| 304 | WARN_ON_ONCE(flow->backlog); |
| 305 | } |
| 306 | |
| 307 | static void fq_tin_reset(struct fq *fq, |
| 308 | struct fq_tin *tin, |
| 309 | fq_skb_free_t free_func) |
| 310 | { |
| 311 | struct list_head *head; |
| 312 | struct fq_flow *flow; |
| 313 | |
| 314 | for (;;) { |
| 315 | head = &tin->new_flows; |
| 316 | if (list_empty(head)) { |
| 317 | head = &tin->old_flows; |
| 318 | if (list_empty(head)) |
| 319 | break; |
| 320 | } |
| 321 | |
| 322 | flow = list_first_entry(head, struct fq_flow, flowchain); |
| 323 | fq_flow_reset(fq, flow, free_func); |
| 324 | } |
| 325 | |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 326 | WARN_ON_ONCE(!list_empty(&tin->tin_list)); |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 327 | WARN_ON_ONCE(tin->backlog_bytes); |
| 328 | WARN_ON_ONCE(tin->backlog_packets); |
| 329 | } |
| 330 | |
| 331 | static void fq_flow_init(struct fq_flow *flow) |
| 332 | { |
| 333 | INIT_LIST_HEAD(&flow->flowchain); |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 334 | __skb_queue_head_init(&flow->queue); |
| 335 | } |
| 336 | |
| 337 | static void fq_tin_init(struct fq_tin *tin) |
| 338 | { |
| 339 | INIT_LIST_HEAD(&tin->new_flows); |
| 340 | INIT_LIST_HEAD(&tin->old_flows); |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 341 | INIT_LIST_HEAD(&tin->tin_list); |
Felix Fietkau | bf9009b | 2020-12-18 19:47:14 +0100 | [diff] [blame] | 342 | fq_flow_init(&tin->default_flow); |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 343 | } |
| 344 | |
| 345 | static int fq_init(struct fq *fq, int flows_cnt) |
| 346 | { |
| 347 | int i; |
| 348 | |
| 349 | memset(fq, 0, sizeof(fq[0])); |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 350 | spin_lock_init(&fq->lock); |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 351 | INIT_LIST_HEAD(&fq->tin_backlog); |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 352 | fq->flows_cnt = max_t(u32, flows_cnt, 1); |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 353 | fq->quantum = 300; |
| 354 | fq->limit = 8192; |
Toke Høiland-Jørgensen | 097b065 | 2016-09-23 21:59:09 +0200 | [diff] [blame] | 355 | fq->memory_limit = 16 << 20; /* 16 MBytes */ |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 356 | |
Toke Høiland-Jørgensen | 71e67c3 | 2019-11-05 16:57:50 +0100 | [diff] [blame] | 357 | fq->flows = kvcalloc(fq->flows_cnt, sizeof(fq->flows[0]), GFP_KERNEL); |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 358 | if (!fq->flows) |
| 359 | return -ENOMEM; |
| 360 | |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 361 | fq->flows_bitmap = kcalloc(BITS_TO_LONGS(fq->flows_cnt), sizeof(long), |
| 362 | GFP_KERNEL); |
| 363 | if (!fq->flows_bitmap) { |
| 364 | kvfree(fq->flows); |
| 365 | fq->flows = NULL; |
| 366 | return -ENOMEM; |
| 367 | } |
| 368 | |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 369 | for (i = 0; i < fq->flows_cnt; i++) |
| 370 | fq_flow_init(&fq->flows[i]); |
| 371 | |
| 372 | return 0; |
| 373 | } |
| 374 | |
| 375 | static void fq_reset(struct fq *fq, |
| 376 | fq_skb_free_t free_func) |
| 377 | { |
| 378 | int i; |
| 379 | |
| 380 | for (i = 0; i < fq->flows_cnt; i++) |
| 381 | fq_flow_reset(fq, &fq->flows[i], free_func); |
| 382 | |
Toke Høiland-Jørgensen | 71e67c3 | 2019-11-05 16:57:50 +0100 | [diff] [blame] | 383 | kvfree(fq->flows); |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 384 | fq->flows = NULL; |
Felix Fietkau | d7b6492 | 2020-12-18 19:47:15 +0100 | [diff] [blame] | 385 | |
| 386 | kfree(fq->flows_bitmap); |
| 387 | fq->flows_bitmap = NULL; |
Michal Kazior | 557fc4a | 2016-04-22 14:20:13 +0200 | [diff] [blame] | 388 | } |
| 389 | |
| 390 | #endif |