Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp9153rdg; Tue, 10 Oct 2023 02:38:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGLbI+7wSgXidJufbUMEDvTeSBUsiJ0veIMWYa7mpFbWpcXtk/AdpKSysPKh71Ig+8LLn8 X-Received: by 2002:a05:6830:ca:b0:6c4:ded2:44d0 with SMTP id x10-20020a05683000ca00b006c4ded244d0mr19428038oto.27.1696930703423; Tue, 10 Oct 2023 02:38:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696930703; cv=none; d=google.com; s=arc-20160816; b=Y5Pm/6VT8Cjk/u6V7cq0MB3e6p7uSA1BGUiHkKDJkXwvDqQWxxL7bBGYMPXxUM3V9z 26T91GSKzNIAh+5Ty8LlC8Hk5W9/d2N/Ka5T6zjdwD5iu/fgvosIUBa5ZfDkLAjSShQb SBFeJwdYkXMckgRjCAg0MjlKmwzBwSx129N1tsxYTHitnMC26SUFtOADpwhSnjLVam5G zoemfqbPGwTt+vYde4JLoeGC1xuTa9GxOQ074u22nNivSQbRHQxCRLjAbskNq6kb61Q9 ZCneB5KiHi4umHfeZwptI2GY0KdAsoGl6epJ3eNqgmIXt1CZ75EmVvtAVh8yoBlxUW0b mQFw== 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=a8CLQTcJrYOwRTqvT9o06ssVLzSd0KqWTzYK7stGT78=; fh=Y8M2sZ2XO+pZt/BBlIAACnnh4xUE6kU0kxeA2C14q1Q=; b=jVu3B8ZpOu35rA8KKpS0tWyXpCEjeijlzAAfN+7EQxveE76NtC1XNK2l4F+7lz1z3G Sp8iKZDeEbQofjv9q6S56J1cbP4t1Up9B2cM5XKNwOCwvARNx4bx8JNcyuzMfg68dIkr b+OPsGs637vOD4MzxanBmYV5pIyRBY3LNyS/cdqx877Tdckd7b2I6wm54O3KRwbyW3Eb g1Ji0+YDYnW6ucxzzH0ntqmYVCne/tkYx5Z5dcYc+nqKrCmAxY3dVQlPvhEOLJfaJ1nD JQqsntSmk+E2MhVROJ2f5pJGlRaaqPUVNJX4xA9wagUR821qTnrBKafXKJoczGKyWzCd K8jw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id j26-20020a63551a000000b00582f1f73c82si8831175pgb.381.2023.10.10.02.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 02:38:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2EB438028FE9; Tue, 10 Oct 2023 02:38:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230148AbjJJJiK (ORCPT + 99 others); Tue, 10 Oct 2023 05:38:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjJJJiJ (ORCPT ); Tue, 10 Oct 2023 05:38:09 -0400 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BE9893; Tue, 10 Oct 2023 02:38:06 -0700 (PDT) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-9ae2cc4d17eso973760666b.1; Tue, 10 Oct 2023 02:38:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696930685; x=1697535485; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=a8CLQTcJrYOwRTqvT9o06ssVLzSd0KqWTzYK7stGT78=; b=ex2yHlG5a2b5VSBTEqWopu7/4R2fO22Xkb1XRvsfBLxqd8YZXuck+wTik5nyCP2sDV kKWNaIVN4CuVuRCJVQa/H/qT3zMMsEbclfABdyz3ro9YWoqSIfnWpELODTXWRz0tnPWI CiXhSJ1EyPO4QKSaTUxe9vircyAkT8sQspInn/Dv+PtOM38/R/e77CR+1b9C76UDzWrE i2pGFCTjSHTBjT1hlK5B04/NQ1HCOefTfUjDK4uRV7nnL2liNPxpW5s/MQ72ZkvD4GT0 y+V2sSKREaj+h79ZWbD5/K/rNVfYWcIhmqKcUee8Lsr2XMhrRPzNca+IQAeoHiFccv6w SzMw== X-Gm-Message-State: AOJu0Yz9nKq8d+JRX1u/jHbVAU8TrjkXSHAPyh2wpqVHmrXlGF0KwS50 amtYbrcS7Nzn4YmUQ3TEnrNocFphKAc= X-Received: by 2002:a17:906:310b:b0:9b5:f25d:9261 with SMTP id 11-20020a170906310b00b009b5f25d9261mr15657614ejx.22.1696930684587; Tue, 10 Oct 2023 02:38:04 -0700 (PDT) Received: from localhost (fwdproxy-cln-005.fbsv.net. [2a03:2880:31ff:5::face:b00c]) by smtp.gmail.com with ESMTPSA id l7-20020a170906a40700b009ae587ce133sm8196942ejz.188.2023.10.10.02.38.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 02:38:02 -0700 (PDT) From: Breno Leitao To: jlbec@evilplan.org, kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com Cc: hch@lst.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, horms@kernel.org Subject: [PATCH net-next v3 0/4] net: netconsole: configfs entries for boot target Date: Tue, 10 Oct 2023 02:37:47 -0700 Message-Id: <20231010093751.3878229-1-leitao@debian.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 10 Oct 2023 02:38:19 -0700 (PDT) X-Spam-Level: ** There is a limitation in netconsole, where it is impossible to disable or modify the target created from the command line parameter. (netconsole=...). "netconsole" cmdline parameter sets the remote IP, and if the remote IP changes, the machine needs to be rebooted (with the new remote IP set in the command line parameter). This allows the user to modify a target without the need to restart the machine. This functionality sits on top of the dynamic target reconfiguration that is already implemented in netconsole. The way to modify a boot time target is creating special named configfs directories, that will be associated with the targets coming from `netconsole=...`. Example: Let's suppose you have two netconsole targets defined at boot time:: netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc;4444@10.0.0.1/eth1,9353@10.0.0.3/12:34:56:78:9a:bc You can modify these targets in runtime by creating the following targets:: $ mkdir cmdline1 $ cat cmdline1/remote_ip 10.0.0.3 $ echo 0 > cmdline1/enabled $ echo 10.0.0.4 > cmdline1/remote_ip $ echo 1 > cmdline1/enabled --- Changelog: * Version 3: * Move alloc_param_target() to the bottom of the file to avoid forward declaration. * Version 2: * Replaced the name of the NETCONSOLE_PARAM_TARGET_NAME macro * Improved the code documentation * Improved the user documentation --- Breno Leitao (4): netconsole: move init/cleanup functions lower netconsole: Initialize configfs_item for default targets netconsole: Attach cmdline target to dynamic target Documentation: netconsole: add support for cmdline targets Documentation/networking/netconsole.rst | 22 +++- drivers/net/netconsole.c | 155 ++++++++++++++++-------- 2 files changed, 121 insertions(+), 56 deletions(-) -- 2.34.1