diff options
Diffstat (limited to 'include/net/codel_impl.h')
-rw-r--r-- | include/net/codel_impl.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/net/codel_impl.h b/include/net/codel_impl.h index 7af2c3eb3c43..137d40d8cbeb 100644 --- a/include/net/codel_impl.h +++ b/include/net/codel_impl.h @@ -54,7 +54,8 @@ 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->ce_threshold_mask = 0; + params->ce_threshold_selector = 0; params->ecn = false; } @@ -250,13 +251,12 @@ end: 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; + if (params->ce_threshold_mask) { + int dsfield = skb_get_dsfield(skb); - set_ce = (ecn == INET_ECN_ECT_1); + set_ce = (dsfield >= 0 && + (((u8)dsfield & params->ce_threshold_mask) == + params->ce_threshold_selector)); } if (set_ce && INET_ECN_set_ce(skb)) stats->ce_mark++; |