|
1 | | ---- a/net/sched/sch_sfq.c 2024-12-09 16:55:55.000000000 +0000 |
2 | | -+++ b/net/sched/sch_sfq.c 2025-01-03 13:22:02.510816133 +0000 |
| 1 | +--- a/net/sched/sch_sfq.c 2026-06-14 01:11:03.351041400 +0800 |
| 2 | ++++ b/net/sched/sch_sfq.c 2026-06-14 01:15:48.262088400 +0800 |
3 | 3 | @@ -71,11 +71,11 @@ |
4 | 4 |
|
5 | 5 | It is easy to increase these values, but not in flight. */ |
6 | 6 |
|
7 | 7 | -#define SFQ_MAX_DEPTH 127 /* max number of packets per flow */ |
8 | 8 | -#define SFQ_DEFAULT_FLOWS 128 |
9 | | -+#define SFQ_MAX_DEPTH 268 /* max number of packets per flow */ |
10 | | -+#define SFQ_DEFAULT_FLOWS 212 |
| 9 | ++#define SFQ_MAX_DEPTH 352 /* max number of packets per flow */ |
| 10 | ++#define SFQ_DEFAULT_FLOWS 274 |
11 | 11 | #define SFQ_MAX_FLOWS (0x10000 - SFQ_MAX_DEPTH - 1) /* max number of flows */ |
12 | 12 | #define SFQ_EMPTY_SLOT 0xffff |
13 | 13 | -#define SFQ_DEFAULT_HASH_DIVISOR 1024 |
|
28 | 28 | u8 flags; |
29 | 29 | struct tcf_proto __rcu *filter_list; |
30 | 30 | struct tcf_block *block; |
31 | | -@@ -754,7 +754,9 @@ |
| 31 | +@@ -639,9 +639,10 @@ |
| 32 | + unsigned int divisor; |
| 33 | + int perturb_period; |
| 34 | + u8 headdrop; |
| 35 | +- u8 maxdepth; |
| 36 | ++ u16 maxdepth; |
| 37 | + int limit; |
| 38 | + u8 flags; |
| 39 | ++ u8 hook_max = 0; |
| 40 | + |
| 41 | + |
| 42 | + if (opt->nla_len < nla_attr_size(sizeof(*ctl))) |
| 43 | +@@ -694,6 +695,7 @@ |
| 44 | + } |
| 45 | + if (ctl_v1) { |
| 46 | + if (ctl_v1->depth) |
| 47 | ++ hook_max = ctl_v1->depth == 1 ? 1 : hook_max; |
| 48 | + maxdepth = min_t(u32, ctl_v1->depth, SFQ_MAX_DEPTH); |
| 49 | + if (p) { |
| 50 | + red_set_parms(p, |
| 51 | +@@ -708,9 +710,10 @@ |
| 52 | + } |
| 53 | + if (ctl->limit) { |
| 54 | + limit = min_t(u32, ctl->limit, maxdepth * maxflows); |
| 55 | ++ hook_max = ctl->limit == 1 ? 1 : hook_max; |
| 56 | + maxflows = min_t(u32, maxflows, limit); |
| 57 | + } |
| 58 | +- if (limit == 1) { |
| 59 | ++ if (limit == 1 && hook_max != 1) { |
| 60 | + sch_tree_unlock(sch); |
| 61 | + kfree(p); |
| 62 | + NL_SET_ERR_MSG_MOD(extack, "invalid limit"); |
| 63 | +@@ -723,6 +726,8 @@ |
| 64 | + q->headdrop = headdrop; |
| 65 | + q->maxdepth = maxdepth; |
| 66 | + q->maxflows = maxflows; |
| 67 | ++ if (hook_max == 1) |
| 68 | ++ q->limit = q->maxdepth = SFQ_MAX_DEPTH; |
| 69 | + WRITE_ONCE(q->perturb_period, perturb_period); |
| 70 | + q->quantum = quantum; |
| 71 | + q->flags = flags; |
| 72 | +@@ -797,7 +802,9 @@ |
32 | 73 | q->divisor = SFQ_DEFAULT_HASH_DIVISOR; |
33 | 74 | q->maxflows = SFQ_DEFAULT_FLOWS; |
34 | 75 | q->quantum = psched_mtu(qdisc_dev(sch)); |
35 | 76 | - q->perturb_period = 0; |
36 | | -+ q->perturb_period = 225 * HZ; |
| 77 | ++ q->perturb_period = 300 * HZ; |
37 | 78 | + q->headdrop = 1; |
38 | 79 | + mod_timer(&q->perturb_timer, jiffies + q->perturb_period); |
39 | 80 | get_random_bytes(&q->perturbation, sizeof(q->perturbation)); |
|
0 commit comments