Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13373108pxu; Sun, 3 Jan 2021 12:11:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLTgGPCz9XCurPGGBsl6+DFACwS2azD1MI+ZuS+Ay/8PAlFsuNX7Poc9IlmqByeJ6NkUsJ X-Received: by 2002:a50:b742:: with SMTP id g60mr67284995ede.113.1609704684436; Sun, 03 Jan 2021 12:11:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609704684; cv=none; d=google.com; s=arc-20160816; b=re8scwyDKvjIAJP5r7RvWzGNGyLY92wmIvJdlJ9NOI2Ii6LmbSXhAvoZr1UTdEZ1d5 J02ky9ARMNr+8jDnxY2+Z9g1AcCaeT+noR01Vax9oMJTMR0d7ko7DXJ8SxtsMSmKRKBB ALhbseWDtojckdI6IjIbBG0veXA4a+IRt4nxqiFXsrnh92T02kuvL4q4ul30y1SS9T64 3EnoTLUe2enpu1AsK9Qt7MH+eu/wL3YHDzxdCkHEA2z5GV+V2/lYMGzVuXQ2YjnUYntI nRuezbia3QQf/lfqgR409p0zHIODebs4D+ssWznLiXdMh7GPR8iQvJs2jHEbafI5Dh1Y 5vWQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=apUPhe8XGFmm+Bi43EU6C/xYFjQp2KMTqbnzxE/Prgo=; b=tfshQYfpjw/zW8f6NMiFW+U5bB/gOvcXfbf466/KtL5UZtmnKbztbTP192nDmLMOq9 SxKHtIFxYjHmVHqqBx10VgXKeXksndVsCc8Ud9Ayyx4KXv4lKTjsTz6hH3DwVFQmmjnr +C1JTtf+rlMvNm3M7rWOebKdIJeo4ZHa1QeUlwNTNgCtGfjEAFnmMZEUyIP+nXezQke+ fxRSilvXklmCD0W4QCW+e7rFKQcRsLTnBDvHFhD5pRIIm3BbyEFrJvvlSqOsChKQ4nXN fF9Bw/GsRAxuhDPvTTVnh59XSP0irF81H10l6LJGusjjhb5IUNnetR6N6eHNI1t82YEp cUzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=Hx7USmsW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ss12si27638770ejb.55.2021.01.03.12.11.01; Sun, 03 Jan 2021 12:11:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=Hx7USmsW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727232AbhACSVC (ORCPT + 99 others); Sun, 3 Jan 2021 13:21:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727041AbhACSVB (ORCPT ); Sun, 3 Jan 2021 13:21:01 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 082CFC0613CF for ; Sun, 3 Jan 2021 10:20:20 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id b5so8990177pjl.0 for ; Sun, 03 Jan 2021 10:20:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=apUPhe8XGFmm+Bi43EU6C/xYFjQp2KMTqbnzxE/Prgo=; b=Hx7USmsWC6rsYBwFOAOs3KB4jnSIdXfa1hxNJgxQnIRTiKPsNOQ20ub3xbGhGtvFFe z4CAxghIGF+Dyi+skjVLYGw5M0fFf/ZuTfVHrBUQ8QWPXBZOfrsxUPXGLutzXg0y1yr7 AV/0FK2Kd2eRm/wjnygRqY+I8zTGl/FfBf+z+4osxlnEXR5j7jTrNCoz7MIkcblT1hm0 t5nszwGrARVOMQfo3yyZEKytwP56uVdLirCgrS4YfYEBd4IbMpTZIOBXAs5oKFoZUmkd iVOhAjMd5ZXVvrrYWDwi8ygUfGz5jrhS2y+ilw/9Ij8t2Qy2mJKOo2xwypqdr/plcI/y Sh8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=apUPhe8XGFmm+Bi43EU6C/xYFjQp2KMTqbnzxE/Prgo=; b=K28v+vbXt0miFkSWjkzjPXbDvJpfFn1sXjK9FQCltRLsVBjdwDG1wJiKUg95WL704N IhITqx4oOR6q8eEc3Pz4X3rN2UcxhwMA5xdSITgxRKPajqD91X0CcNM1AdxddDBsPTWz 7LTaK3/uOcWpIzZHrrTeevgJytyfidHub2cqQBysCR4ELbfz1iUgYSByXid8qAoOSvpd or9KKgPcuPVnTWT8VdTnQ7fD/dfpih6yGfcfOsk43fOkdsLq0nCjn97Oq3tYdsf7y6T5 Y0KWEy+4v9ypegAwZeATtCuA/YVTsyGyIRZ63lwWBJBnXldQb9jWbmtqRAjqmHZyQJau ld5Q== X-Gm-Message-State: AOAM531ejvz5HDP8I3dtoVosFri8Em4GA50m/vXRbnCgfq3nAwPvoi8U xk/+EksHZfnVkEVuElfW628W3g== X-Received: by 2002:a17:90a:d790:: with SMTP id z16mr26805961pju.88.1609698020326; Sun, 03 Jan 2021 10:20:20 -0800 (PST) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id f64sm55342846pfb.146.2021.01.03.10.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jan 2021 10:20:19 -0800 (PST) Date: Sun, 3 Jan 2021 10:20:11 -0800 From: Stephen Hemminger To: Masahiro Yamada Cc: Valdis =?UTF-8?B?S2zEk3RuaWVrcw==?= , Michal Marek , "David S. Miller" , Networking , Linux Kbuild mailing list , Linux Kernel Mailing List Subject: Re: Kconfig, DEFAULT_NETSCH, and shooting yourself in the foot.. Message-ID: <20210103102011.444ecaa4@hermes.local> In-Reply-To: References: <16871.1609618487@turing-police> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 3 Jan 2021 15:30:30 +0900 Masahiro Yamada wrote: > On Sun, Jan 3, 2021 at 5:14 AM Valdis Kl=C4=93tnieks wrote: > > > > Consider the following own goal I just discovered I scored: > > > > [~] zgrep -i fq_codel /proc/config.gz > > CONFIG_NET_SCH_FQ_CODEL=3Dm > > CONFIG_DEFAULT_FQ_CODEL=3Dy > > CONFIG_DEFAULT_NET_SCH=3D"fq_codel" > > > > Obviously, fq_codel didn't get set as the default, because that happens > > before the module gets loaded (which may never happen if the sysadmin > > thinks the DEFAULT_NET_SCH already made it happen) > > > > Whoops. My bad, probably - but.... > > > > The deeper question, part 1: > > > > There's this chunk in net/sched/Kconfig: > > > > config DEFAULT_NET_SCH > > string > > default "pfifo_fast" if DEFAULT_PFIFO_FAST > > default "fq" if DEFAULT_FQ > > default "fq_codel" if DEFAULT_FQ_CODEL > > default "fq_pie" if DEFAULT_FQ_PIE > > default "sfq" if DEFAULT_SFQ > > default "pfifo_fast" > > endif > > > > (And a similar chunk right above it with a similar issue) > > > > Should those be "if (foo=3Dy)" so =3Dm can't be chosen? (I'll be > > happy to write the patch if that's what we want) > > > > Deeper question, part 2: > > > > Should there be a way in the Kconfig language to ensure that > > these two chunks can't accidentally get out of sync? There's other > > places in the kernel where similar issues arise - a few days ago I was > > chasing a CPU governor issue where it looked like it was possible > > to set a default that was a module and thus possibly not actually loade= d. > > =20 >=20 >=20 > If there is a restriction where a modular discipline cannot be the defaul= t, > I think you can add 'depends on FOO =3D y'. >=20 >=20 >=20 > For example, >=20 >=20 > choice > prompt "Default" >=20 > config DEFAULT_FOO > bool "Use foo for default" > depends on FOO =3D y >=20 > config DEFAULT_BAR > bool "Use bar for default" > depends on BAR =3D y >=20 > config DEFAULT_FALLBACK > bool "fallback when nothing else is builtin" >=20 > endchoice >=20 >=20 >=20 >=20 >=20 You can use a qdisc that is a module, it just has to be available when devi= ce is loaded. Typically that means putting it in initramfs.