Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2152406rwo; Thu, 3 Aug 2023 05:37:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWur6Bdtph9EgIalnqqUd1diuZy1nVND+RM496pMopzZe4E+5YwhNaPo3vuurH+FNTzlVf X-Received: by 2002:a05:6a20:ce91:b0:13f:9cee:ff42 with SMTP id if17-20020a056a20ce9100b0013f9ceeff42mr746660pzb.41.1691066266962; Thu, 03 Aug 2023 05:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691066266; cv=none; d=google.com; s=arc-20160816; b=CRkMT8tbyL4JAT4cYyKODyTbS4Y78Cmy8mqHTbKi9IeBYXgSeXpy/wewg4rsdIsA7a jqXfjF0bloSd0IER0ze1eVe8fVPk8FTURhhA3PEnN3nX59YxHOp3EFHBrgQQRtdjMhMg 5tK4bnKPwM3qLJcFaIoouLlfTYb0eGDNRNeiEiwibLtASd1HZU/eWehfTQv7JkxCOQ2R ZV7hWmAg50ij3KfQV2V/3YRkv4KWzka3gZMLV562ibWAa2iS+1Dtbuwuo+FGG2/FNWt0 hs/e+QrtHHsBDTb8LmJ0q1zhi0RZjA2LbKWdSsJF5LXyfD1m7jtgTtmLyTaHy/zXO5W1 wKnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=qVUTi9M5sLcie6yIGG2nnYWviv8Jo0VEzp70AMTqbEE=; fh=reX0Y8h/i2efqY6VIwzwmQbwgQ494sSXHf6GzGbI9Hs=; b=ILcMbt3GOqAZ1jPmh48GEtXKj3+E0IoDo3Ljwu3Ej2U+y3Wdgb7ch26vgPUYlGrzJ6 Hfoakhtmmf4rNj2zV3754eyxmQVl1rJeWapSUo6Rug6JI+GAOFr5Iee4Ta8yEdWfKE0m qgtfkCjbCHGX0e8MkS7lluDqhHOFvipTkEeetLSHBEo+fYAIaYxDTU15FdMvLcZu7b+Q nLQ7p8V9SqwEZjMKtgnnBpp8S0VWDKqMItrTkJ8zQxSu3VWZe7/RZ2mVre9D/RCKZf20 er/66bWXNQpDmvM/0hvKu14Pw8GGQgMId3nDy+iwaYzvAInMi0/wNZxEkNYJtbKPSXKO Jn5Q== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v12-20020a056a00148c00b00682d831af28si5108735pfu.348.2023.08.03.05.37.34; Thu, 03 Aug 2023 05:37:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234196AbjHCL3c (ORCPT + 99 others); Thu, 3 Aug 2023 07:29:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234218AbjHCL3a (ORCPT ); Thu, 3 Aug 2023 07:29:30 -0400 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E217A1981; Thu, 3 Aug 2023 04:29:24 -0700 (PDT) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-99357737980so119851166b.2; Thu, 03 Aug 2023 04:29:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691062163; x=1691666963; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qVUTi9M5sLcie6yIGG2nnYWviv8Jo0VEzp70AMTqbEE=; b=iFrKy0sETDaCuaQaqWt7dGy/PZ4/MU2p4PGFUMklXBtb+IKdJp7tbIeA1Mn7vcoE/9 caWe7boyfiaXeIyqu5hZN9e5diARiTkU4+RjVhDLwUc3QN7zf2fYQ/XyqQr8a95j1iG9 6an7wCd7AkD/EuIRuQcLAeV+tED8s6zQlZHokyCPH+wF7ZuFYOiHoBebE7z2P58nyw9a fwqj84+PxlZsWCYFTHwe8BQYTRMVhA68ztGCbBqIR9sE3jduUKJlpe0w909MXgXA717x kemQKsMDtc+Z4Mx1O5Nx0AueJl7A8286qkOaNX5dUR90P9EbzPZnafVhaWZ7vKln7DUM JF4g== X-Gm-Message-State: ABy/qLbtFpbwQq1WCItr2C1+01eQmcFU/VP2mnV57925ptSD2DxrE5Qe hOSqV55DlzjZuPAVV/kBaS4= X-Received: by 2002:a17:906:5198:b0:973:fd02:a41f with SMTP id y24-20020a170906519800b00973fd02a41fmr8429104ejk.40.1691062163118; Thu, 03 Aug 2023 04:29:23 -0700 (PDT) Received: from gmail.com (fwdproxy-cln-008.fbsv.net. [2a03:2880:31ff:8::face:b00c]) by smtp.gmail.com with ESMTPSA id se9-20020a170906ce4900b0099364d9f0e6sm10389437ejb.117.2023.08.03.04.29.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 04:29:22 -0700 (PDT) Date: Thu, 3 Aug 2023 04:29:20 -0700 From: Breno Leitao To: Eric Dumazet Cc: rdunlap@infradead.org, benjamin.poirier@gmail.com, "David S. Miller" , Jakub Kicinski , Paolo Abeni , leit@meta.com, "open list:NETWORKING DRIVERS" , open list Subject: Re: [PATCH net-next v3] netconsole: Enable compile time configuration Message-ID: References: <20230801100533.3350037-1-leitao@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,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 On Thu, Aug 03, 2023 at 09:47:43AM +0200, Eric Dumazet wrote: > On Tue, Aug 1, 2023 at 12:06 PM Breno Leitao wrote: > > > > Enable netconsole features to be set at compilation time. Create two > > Kconfig options that allow users to set extended logs and release > > prepending features at compilation time. > > > > Right now, the user needs to pass command line parameters to netconsole, > > such as "+"/"r" to enable extended logs and version prepending features. > > > > With these two options, the user could set the default values for the > > features at compile time, and don't need to pass it in the command line > > to get them enabled, simplifying the command line. > > > > Signed-off-by: Breno Leitao > > --- > > v1 -> v2: > > * Improvements in the Kconfig help section. > > v2 -> v3: > > * Honour the Kconfig settings when creating sysfs targets > > * Add "by default" in a Kconfig help. > > --- > > drivers/net/Kconfig | 22 ++++++++++++++++++++++ > > drivers/net/netconsole.c | 10 ++++++++++ > > 2 files changed, 32 insertions(+) > > > > diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig > > index 368c6f5b327e..55fb9509bcae 100644 > > --- a/drivers/net/Kconfig > > +++ b/drivers/net/Kconfig > > @@ -332,6 +332,28 @@ config NETCONSOLE_DYNAMIC > > at runtime through a userspace interface exported using configfs. > > See for details. > > > > +config NETCONSOLE_EXTENDED_LOG > > + bool "Set kernel extended message by default" > > + depends on NETCONSOLE > > + default n > > + help > > + Set extended log support for netconsole message. If this option is > > + set, log messages are transmitted with extended metadata header in a > > + format similar to /dev/kmsg. See > > + for details. > > + > > +config NETCONSOLE_PREPEND_RELEASE > > + bool "Prepend kernel release version in the message by default" > > + depends on NETCONSOLE_EXTENDED_LOG > > + default n > > + help > > + Set kernel release to be prepended to each netconsole message by > > + default. If this option is set, the kernel release is prepended into > > + the first field of every netconsole message, so, the netconsole > > + server/peer can easily identify what kernel release is logging each > > + message. See for > > + details. > > + > > config NETPOLL > > def_bool NETCONSOLE > > > > diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c > > index 87f18aedd3bd..e3b6155f4529 100644 > > --- a/drivers/net/netconsole.c > > +++ b/drivers/net/netconsole.c > > @@ -181,6 +181,11 @@ static struct netconsole_target *alloc_param_target(char *target_config) > > if (!nt) > > goto fail; > > > > + if (IS_ENABLED(CONFIG_NETCONSOLE_EXTENDED_LOG)) > > + nt->extended = true; > > + if (IS_ENABLED(CONFIG_NETCONSOLE_PREPEND_RELEASE)) > > + nt->release = true; > > + > > nt->np.name = "netconsole"; > > strscpy(nt->np.dev_name, "eth0", IFNAMSIZ); > > nt->np.local_port = 6665; > > @@ -681,6 +686,11 @@ static struct config_item *make_netconsole_target(struct config_group *group, > > nt->np.remote_port = 6666; > > eth_broadcast_addr(nt->np.remote_mac); > > > > + if (IS_ENABLED(CONFIG_NETCONSOLE_EXTENDED_LOG)) > > + nt->extended = true; > > + if (IS_ENABLED(CONFIG_NETCONSOLE_PREPEND_RELEASE)) > > + nt->release = true; > > + > > Instead of duplicating these, what about adding a preliminary helper > in a separate patch ? That is a good idea, I will update. Thanks!