Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp230806rdg; Thu, 12 Oct 2023 04:14:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFopPN4G+HDUI/riVByLYyr2ccLMSkvIojXadJCIIKmUD5OnQ+FdRIw//T3EdPXnN6fWiHg X-Received: by 2002:a17:903:1207:b0:1c0:bcbc:d64 with SMTP id l7-20020a170903120700b001c0bcbc0d64mr25526363plh.51.1697109283629; Thu, 12 Oct 2023 04:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697109283; cv=none; d=google.com; s=arc-20160816; b=MpxygCAcudJncdDZbQUCCDu+OnRsbDjsKw6WJt/An6iePToiZdb6ldRuWB41akI6Ds CsUgsrSTDwTnBB5kKHzipbY8qcSgBraouHxHEeR+NB220TOzG8ljYdJlWwR5pFb8y62P OHpZlCxwkL0yu9yK1SkevGwyKhHrmyS4GZbSY+UwlpmHdRJSHZy/Bv7PtZBXhGUHoM62 2fxC6996opzooQTZ0kCayqzowPe91BSOQpDZ/wNuVBDN2N+dzppRnUGCOPaGnuWX06UU sdwYWHsCgA0mE0x7XyvO+evCRtOH2IBBn1UH/jAchpd93mHIeU12EIq0+obO67bOO/jG sI7w== 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=JtB8IDZz5dk1cNl4dqJ3VZqh/YbjyD7s+JDKd6G9pwQ=; fh=Y8M2sZ2XO+pZt/BBlIAACnnh4xUE6kU0kxeA2C14q1Q=; b=fnx4r8M5o55h1k89IdNwrQREkgKE0OBv5Z68LbQFFMbVVM9xSiFiMXyAq6U8SDsIWH xTno2F/pzkhnskA50Qwxo4p0XZArbA5bOBdRG1TD9/DJCi2HnH+jvbiV/imh1IYscZ7I XUSSf3x0IgtaR9nGvP1TJdac27M8J1yXs6raH7U9r+TioaRHqvBMrKNyyr8GP5cHIeBT 4Bof+F9d7Pzsp5nU89I30h/OILk+f7fCKK/8E7S7/w+wPYzlYbZYG4t40rIneJZdDQJa pXSeZ4tTILg0KUiSTvXDKfwEY3XhUk5B2Sv8obf/tcu/3BNpGNPqw5UPFnCeUsHAOQdM wdQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id i2-20020a17090332c200b001c9bcb6f00asi2108593plr.528.2023.10.12.04.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 04:14:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 6B666825B488; Thu, 12 Oct 2023 04:14:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343649AbjJLLO3 (ORCPT + 99 others); Thu, 12 Oct 2023 07:14:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235687AbjJLLO1 (ORCPT ); Thu, 12 Oct 2023 07:14:27 -0400 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1468C4; Thu, 12 Oct 2023 04:14:25 -0700 (PDT) Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-9ae75ece209so135708466b.3; Thu, 12 Oct 2023 04:14:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697109262; x=1697714062; 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=JtB8IDZz5dk1cNl4dqJ3VZqh/YbjyD7s+JDKd6G9pwQ=; b=PwOpaSCmvvv/VNHf9uqHZeUNQd662kRTywsuiengjCmpAZebV/aJVu4UhQ0QUS1+Tl GruToI0QOpExD/FubFt28KGVWxMBCwyOTXE2T6chE1TaWDBndsn9ttVElG3ipg3BrYjS n3Q88t+ZCS5TT7GL/XybASUL8mzOFuiNeFRp1AybY/hZzw05ql7Hef2tacyNwHk81+q1 1UgWp1kgxqyP+Wz1HotSA5pV3GxmbFr7RPyGfaegNg1SFIjLUNfifve3PDo/b2mewbof rutvTJBO+SLtEK720vRTYG61Xww8iOcRKvtza5a4Te0h00HOabVGcnWmAzzME8WGzj4V ENOA== X-Gm-Message-State: AOJu0Yz+x8UNoB12O4CGtWWtl6W1PM/x4L/VIABHeprzgBdJIR1bjwkO dI+4OdtbTJ+Y7U3Bw3xWg48= X-Received: by 2002:a17:906:73d4:b0:9b8:df8e:cbdd with SMTP id n20-20020a17090673d400b009b8df8ecbddmr19417346ejl.38.1697109261432; Thu, 12 Oct 2023 04:14:21 -0700 (PDT) Received: from localhost (fwdproxy-cln-011.fbsv.net. [2a03:2880:31ff:b::face:b00c]) by smtp.gmail.com with ESMTPSA id w22-20020aa7dcd6000000b00536e03f62bcsm10053640edu.59.2023.10.12.04.14.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 04:14:20 -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 v4 0/4] net: netconsole: configfs entries for boot target Date: Thu, 12 Oct 2023 04:13:57 -0700 Message-Id: <20231012111401.333798-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=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 12 Oct 2023 04:14:38 -0700 (PDT) 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 4: * Rename NETCONSOLE_PARAM_TARGET_NAME to NETCONSOLE_PARAM_TARGET_PREFIX * Version 3: * Move some functions around 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