From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id EE7B73B2A4; Wed, 12 Jan 2022 18:08:24 -0500 (EST) Received: by mail-ed1-x535.google.com with SMTP id a18so16019601edj.7; Wed, 12 Jan 2022 15:08:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=Ia1LBtYIkvV6LfkjKDX6XbWJQVE7iphhNrt/tP6Mj0Q=; b=UrYYMcZDmFO2CAN7rHubsXKuzkSN9BUWqU7O5UGOqjfNP2quXV3nBraqO5T7zID+BE DWYu7J8/BYWouIfSC79pN2LOYkn5P4jcs1r2jRdqqDv6NYfHPG42P2HoHY6G6MH2adr/ F5MQMuzMKBXZ5oOY2HcmfFV7xDmtjHScQs87+b/I4G11FEelD7VhpbGQQolfnN4hMw7i pcp+23D0y6fcao2meFFi9QuKeXpP2yaUL5OeRkg0bcAg1uLuRylXW4pftuXld51s0rzL C8qGeqW028Z8wIUG45hKFPnSdz31QV8DXAiCHRImlIlRCUG2V4hEi2+fuUdRW5qjNWYK 48fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=Ia1LBtYIkvV6LfkjKDX6XbWJQVE7iphhNrt/tP6Mj0Q=; b=kDO27yfbal4mKlCQG9WMj2oHhr/foP5tf4HuK7h7xmo6Ret/TToPMsKDU8jmS+C2c2 cWhEAwOiKkX73vQhR4tIv5S4X+zNPkSh3B+2nQcFiCz4MGG1foBkrtuw71x9kWFdWriy 8LgQ9rt0ixpXlkEoYBr4h/H8Xee9KHesfsodMqq7Ipuav/8LEW+OoGwGgEVvPBJloItr KzQJZUNKpkezEVbwirAr6bxzms+wIB/GaN1otjmrmobgkbyqHncNZrwc/W8IPjTdFQdO qomeH9u4Ic/ykH+Fmlww7al0jvi4YfIzzrpDN4WiTO9VbP2TxjPFAQWPnhiS3NnDvh6Y lRLA== X-Gm-Message-State: AOAM532SKwf4YPmHb/VfXR5e2lG5CP71Tdvj/aQGbJ5QN21/sKEKboqu z+0oj6jtXr06de4G462bVHWGszFI7PS4kZuWnqrgczeU X-Google-Smtp-Source: ABdhPJz2W/9dZ59nSzBi/GPxZgcaDmb5UFzFtdabXuWndr8rQ5XhOliV4d8uglzxlYT6wwhhoG21Nq+dW2zmPwG26co= X-Received: by 2002:a17:907:9085:: with SMTP id ge5mr1534699ejb.128.1642028903572; Wed, 12 Jan 2022 15:08:23 -0800 (PST) MIME-Version: 1.0 References: <20220107202249.3812322-1-kevin@bracey.fi> In-Reply-To: <20220107202249.3812322-1-kevin@bracey.fi> From: Dave Taht Date: Wed, 12 Jan 2022 15:08:10 -0800 Message-ID: To: cerowrt-devel , Cake List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: [Cerowrt-devel] Fwd: [PATCH net-next] net_sched: restore "mpu xxx" handling X-BeenThere: cerowrt-devel@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Development issues regarding the cerowrt test router project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2022 23:08:25 -0000 this has been broken this long?? ---------- Forwarded message --------- From: Kevin Bracey Date: Fri, Jan 7, 2022 at 4:56 PM Subject: [PATCH net-next] net_sched: restore "mpu xxx" handling To: Cc: Kevin Bracey , Eric Dumazet , Jiri Pirko , Vimalkumar commit 56b765b79e9a ("htb: improved accuracy at high rates") broke "overhead X", "linklayer atm" and "mpu X" attributes. "overhead X" and "linklayer atm" have already been fixed. This restores the "mpu X" handling, as might be used by DOCSIS or Ethernet shaping: tc class add ... htb rate X overhead 4 mpu 64 The code being fixed is used by htb, tbf and act_police. Cake has its own mpu handling. qdisc_calculate_pkt_len still uses the size table containing values adjusted for mpu by user space. Fixes: 56b765b79e9a ("htb: improved accuracy at high rates") Signed-off-by: Kevin Bracey Cc: Eric Dumazet Cc: Jiri Pirko Cc: Vimalkumar --- include/net/sch_generic.h | 5 +++++ net/sched/sch_generic.c | 1 + 2 files changed, 6 insertions(+) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index c70e6d2b2fdd..fddca0aa73ef 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -1244,6 +1244,7 @@ struct psched_ratecfg { u64 rate_bytes_ps; /* bytes per second */ u32 mult; u16 overhead; + u16 mpu; u8 linklayer; u8 shift; }; @@ -1253,6 +1254,9 @@ static inline u64 psched_l2t_ns(const struct psched_ratecfg *r, { len +=3D r->overhead; + if (len < r->mpu) + len =3D r->mpu; + if (unlikely(r->linklayer =3D=3D TC_LINKLAYER_ATM)) return ((u64)(DIV_ROUND_UP(len,48)*53) * r->mult) >> r->shi= ft; @@ -1275,6 +1279,7 @@ static inline void psched_ratecfg_getrate(struct tc_ratespec *res, res->rate =3D min_t(u64, r->rate_bytes_ps, ~0U); res->overhead =3D r->overhead; + res->mpu =3D r->mpu; res->linklayer =3D (r->linklayer & TC_LINKLAYER_MASK); } diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 3b0f62095803..5d391fe3137d 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -1474,6 +1474,7 @@ void psched_ratecfg_precompute(struct psched_ratecfg = *r, { memset(r, 0, sizeof(*r)); r->overhead =3D conf->overhead; + r->mpu =3D conf->mpu; r->rate_bytes_ps =3D max_t(u64, conf->rate, rate64); r->linklayer =3D (conf->linklayer & TC_LINKLAYER_MASK); psched_ratecfg_precompute__(r->rate_bytes_ps, &r->mult, &r->shift); -- 2.25.1 --=20 I tried to build a better future, a few times: https://wayforward.archive.org/?site=3Dhttps%3A%2F%2Fwww.icei.org Dave T=C3=A4ht CEO, TekLibre, LLC