Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5558511pxb; Mon, 28 Mar 2022 14:12:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxK+iKZ+nLpZu/0J+sETEVltvSDrkiD5NP7bDCx8HBN0v1Z+71fsUorCj/OAtGqSmZpGOfg X-Received: by 2002:a9d:5913:0:b0:5cd:a050:8f55 with SMTP id t19-20020a9d5913000000b005cda0508f55mr11120879oth.44.1648501942176; Mon, 28 Mar 2022 14:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648501942; cv=none; d=google.com; s=arc-20160816; b=FnBdy3QQVbzKFBp9e8vRjnpgwRYTPV3xvxPydLDS+T0UxcCvW8ZWbI0XljFp3mN6m/ AT83UYuRchpbWLHElXTLcxY4vqIm/ZStna2kXsAKE7t7QScqHtT4er07k7TAbvf6+JYn hJ9ZuoM+X4aOomOxG2rytDeB9y9IVkKU+a/oC7eQ3CiJTa4VSzl4s92cY3M7wkrZ7zrg JvSHqey56jU+UfJclzE5G6ehQhbDfgPpx6gFnqApWV8rPzzOM+jsprl8r90o18wXReME FHM1k1P+l7RYXuth531W5xo4INo70+r2jejyqKxmTQ0ad1Bw1/euHdVtEYtJR0NoBMAm Zj+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=A1SpiF+kbpFLZuaEwi4m09lrLc8FCTkqeSmulTDS7v8=; b=mDcxOmljZ+Vjd8lyflXFjycXcG3qQNL6XyMTtVVWTYLUtntu6Cu+PX331nBXi/MlFY OwI+4VALdQSpkYh5t86HMOgPO4VACiRleC+OH2xLC0K+8zbc4qNBlCGngwft1uwcCc6w 8Lir6lhs4Ct2lhmGdjieptGGzpHNQx9sGWwJia5v3Jz6iwDn7aod+zvwAEIAWVcPr2pa mmmsg4t3IiKV527WabRQBQmsjpMneFxd6LMOYTkLN/GO+5Sac1n2OaBbg6ATXIuue+6Z zPuTzx0khiQ97kCJgp2yAiXxO+3hvkhDSUcNDYJhmDQJhP7khPbcR0KgWj2sn/hHq06Z 2SNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s40-20020a05687024a800b000da85b4241fsi11217378oaq.107.2022.03.28.14.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 14:12:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 107AB506E9; Mon, 28 Mar 2022 14:03:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242232AbiC1MFg (ORCPT + 99 others); Mon, 28 Mar 2022 08:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236940AbiC1MFd (ORCPT ); Mon, 28 Mar 2022 08:05:33 -0400 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7A711C10D; Mon, 28 Mar 2022 05:03:51 -0700 (PDT) Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4KRrvV0xw9z9sSS; Mon, 28 Mar 2022 14:03:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mfpM4CKHYgi1; Mon, 28 Mar 2022 14:03:50 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4KRrvV02fJz9sS2; Mon, 28 Mar 2022 14:03:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E1AE78B774; Mon, 28 Mar 2022 14:03:49 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id MgrrJHZN3a_P; Mon, 28 Mar 2022 14:03:49 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [172.25.230.108]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B6F0F8B763; Mon, 28 Mar 2022 14:03:49 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.16.1) with ESMTPS id 22SC3Zcv101576 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 28 Mar 2022 14:03:35 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.17.1/Submit) id 22SC3Zt6101574; Mon, 28 Mar 2022 14:03:35 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: "David S. Miller" , Jakub Kicinski , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Paolo Abeni , "Toke Hoiland-Jorgensen" Cc: Christophe Leroy , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, cake@lists.bufferbloat.net Subject: [PATCH net-next] sch_cake: Take into account guideline DEF/DGSIC/36 from French Administration Date: Mon, 28 Mar 2022 14:03:24 +0200 Message-Id: <356a242a964fabbdf876a18c7640eb6ead6d0e6b.1648468695.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1648469002; l=3970; s=20211009; h=from:subject:message-id; bh=75ZCbmpZ80bUhHxXSdf4GpKIzWiERVR/QGymj1/HGQo=; b=Fs903hJX2Cs+qgU3qX+Py8DrjakQWxDT+D60UGyUYwRrYfyRDj6afp/qaD/70uRZ0cKSYgmx1xjq A93LoYRrC5XR7J3/rP/1hI5OaB7/kpadZQBoW5pbBonw7UUV37nW X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org French Administration has written a guideline that defines additional DSCP values for use in its networks. Add new CAKE diffserv tables to take those new values into account and add CONFIG_NET_SCH_CAKE_DGSIC to select those tables instead of the default ones. The document is available at https://www.bo.sga.defense.gouv.fr/texte/signe/264219/N%C2%B0%2036/DEF/DGSIC.pdf or https://www.bo.sga.defense.gouv.fr/texte/264219/N%C2%B0%2036/DEF/DGSIC.html Signed-off-by: Christophe Leroy --- net/sched/Kconfig | 11 +++++++++++ net/sched/sch_cake.c | 42 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/net/sched/Kconfig b/net/sched/Kconfig index 1e8ab4749c6c..b99f247404e0 100644 --- a/net/sched/Kconfig +++ b/net/sched/Kconfig @@ -331,6 +331,17 @@ config NET_SCH_CAKE If unsure, say N. +config NET_SCH_CAKE_DGSIC + bool "CAKE: Follow French Administration's guideline DEF/DGSIC/36" + depends on NET_SCH_CAKE + help + Say Y here if you want to use the Common Applications Kept Enhanced + (CAKE) queue management algorithm in an environment that requires to + take into account additional DSCP values defined by the French + Administration in the guideline document identified DEF/DGSIC/36, + available at + https://www.bo.sga.defense.gouv.fr/texte/signe/264219/N%C2%B0%2036/DEF/DGSIC.pdf + config NET_SCH_FQ tristate "Fair Queue" help diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c index a43a58a73d09..3d9af3a68c05 100644 --- a/net/sched/sch_cake.c +++ b/net/sched/sch_cake.c @@ -322,6 +322,17 @@ static const u8 diffserv8[] = { 7, 2, 2, 2, 2, 2, 2, 2, }; +static const u8 diffserv8_dgsic[] = { + 2, 0, 1, 2, 4, 2, 2, 2, + 1, 1, 1, 2, 1, 1, 1, 2, + 5, 4, 4, 2, 4, 4, 4, 2, + 3, 3, 3, 2, 3, 3, 3, 2, + 6, 3, 3, 2, 3, 3, 3, 2, + 6, 6, 6, 2, 6, 6, 6, 2, + 7, 2, 2, 2, 2, 2, 2, 2, + 7, 2, 2, 2, 2, 2, 2, 2, +}; + static const u8 diffserv4[] = { 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, @@ -333,6 +344,17 @@ static const u8 diffserv4[] = { 3, 0, 0, 0, 0, 0, 0, 0, }; +static const u8 diffserv4_dgsic[] = { + 0, 1, 0, 0, 2, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 0, 2, 2, 2, 0, + 2, 2, 2, 0, 2, 2, 2, 0, + 3, 2, 2, 0, 2, 2, 2, 0, + 3, 3, 3, 0, 3, 3, 3, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, +}; + static const u8 diffserv3[] = { 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, @@ -344,6 +366,17 @@ static const u8 diffserv3[] = { 2, 0, 0, 0, 0, 0, 0, 0, }; +static const u8 diffserv3_dgsic[] = { + 0, 1, 0, 0, 2, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2, 2, 0, 2, 2, 2, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, +}; + static const u8 besteffort[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2409,7 +2442,8 @@ static int cake_config_diffserv8(struct Qdisc *sch) q->tin_cnt = 8; /* codepoint to class mapping */ - q->tin_index = diffserv8; + q->tin_index = IS_ENABLED(CONFIG_NET_SCH_CAKE_DGSIC) ? diffserv8_dgsic : + diffserv8; q->tin_order = normal_order; /* class characteristics */ @@ -2452,7 +2486,8 @@ static int cake_config_diffserv4(struct Qdisc *sch) q->tin_cnt = 4; /* codepoint to class mapping */ - q->tin_index = diffserv4; + q->tin_index = IS_ENABLED(CONFIG_NET_SCH_CAKE_DGSIC) ? diffserv4_dgsic : + diffserv4; q->tin_order = bulk_order; /* class characteristics */ @@ -2489,7 +2524,8 @@ static int cake_config_diffserv3(struct Qdisc *sch) q->tin_cnt = 3; /* codepoint to class mapping */ - q->tin_index = diffserv3; + q->tin_index = IS_ENABLED(CONFIG_NET_SCH_CAKE_DGSIC) ? diffserv3_dgsic : + diffserv3; q->tin_order = bulk_order; /* class characteristics */ -- 2.35.1