aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/codel_impl.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2021-10-15 11:33:09 +0100
committerDavid S. Miller <davem@davemloft.net>2021-10-15 11:33:09 +0100
commitf3fafbcbe873cb4bf45d62623bf39897ab5f46b4 (patch)
tree7cbd2d668e45099e5eb4943bef211c211e8f9749 /include/net/codel_impl.h
parenttcp: switch orphan_count to bare per-cpu counters (diff)
parentfq_codel: implement L4S style ce_threshold_ect1 marking (diff)
downloadlinux-dev-f3fafbcbe873cb4bf45d62623bf39897ab5f46b4.tar.xz
linux-dev-f3fafbcbe873cb4bf45d62623bf39897ab5f46b4.zip
Merge branch 'L4S-style-ce_threshold_ect1-marking'
Eric Dumazet says: ==================== net/sched: implement L4S style ce_threshold_ect1 marking As suggested by Ingemar Johansson, Neal Cardwell, and others, fq_codel can be used for Low Latency, Low Loss, Scalable Throughput (L4S) with a small change. In ce_threshold_ect1 mode, only ECT(1) packets can be marked to CE if their sojourn time is above the threshold. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/codel_impl.h')
-rw-r--r--include/net/codel_impl.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/net/codel_impl.h b/include/net/codel_impl.h
index d289b91dcd65..7af2c3eb3c43 100644
--- a/include/net/codel_impl.h
+++ b/include/net/codel_impl.h
@@ -54,6 +54,7 @@ static void codel_params_init(struct codel_params *params)
params->interval = MS2TIME(100);
params->target = MS2TIME(5);
params->ce_threshold = CODEL_DISABLED_THRESHOLD;
+ params->ce_threshold_ect1 = false;
params->ecn = false;
}
@@ -246,9 +247,20 @@ static struct sk_buff *codel_dequeue(void *ctx,
vars->rec_inv_sqrt);
}
end:
- if (skb && codel_time_after(vars->ldelay, params->ce_threshold) &&
- INET_ECN_set_ce(skb))
- stats->ce_mark++;
+ if (skb && codel_time_after(vars->ldelay, params->ce_threshold)) {
+ bool set_ce = true;
+
+ if (params->ce_threshold_ect1) {
+ /* Note: if skb_get_dsfield() returns -1, following
+ * gives INET_ECN_MASK, which is != INET_ECN_ECT_1.
+ */
+ u8 ecn = skb_get_dsfield(skb) & INET_ECN_MASK;
+
+ set_ce = (ecn == INET_ECN_ECT_1);
+ }
+ if (set_ce && INET_ECN_set_ce(skb))
+ stats->ce_mark++;
+ }
return skb;
}