Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp352275lqs; Tue, 5 Mar 2024 04:14:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW7YJARG900jt2eNVecvvVEokg3bSNFOXg13u8XUyM6K3xx2r6k0nTQTAjMn3eNbB6ZBRXi4kye2cgoaYr5mxdB8w/vWGA8zcyWH4ac9Q== X-Google-Smtp-Source: AGHT+IHLlyDQCFUZinClXDtsKsVjZxCxwbzpyZ3p2lrIZege6Sm+9vxLQ+XBeWRjZYR/Xoy7Ctu/ X-Received: by 2002:a0c:f7c4:0:b0:68f:325f:d88c with SMTP id f4-20020a0cf7c4000000b0068f325fd88cmr1793902qvo.1.1709640874862; Tue, 05 Mar 2024 04:14:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709640874; cv=pass; d=google.com; s=arc-20160816; b=m1agrunCvDZ4faPO/gN+FCf7ibScbdAKKtu+nHPsDaT5SmGFPb2JpKYB3q3o9LVf7c 08nDUx/RlXJEqcNlu7z2iAaSX46XRoXkEsQ2T524fAvJ8LbVtjHtKBc2FXvwLhFaeRao lcjkHomzsHjN00qTKT+4o2TQqOXkIArwwHtATgyCgeiCqf5sVb9Ye51P47f6qCTcQZn0 2grxFjVC7jeamcIqGGLoxzhBZC3oKSbYMQbr2IrA4a0g0etyJqZqdIuK5pfub1dEMAWQ s7wZOcCkhng87dXB8K36apMU9p3gzB7sgLRQ3l9CN/DHlT3OFLsq5BWdOHqn+YQSmHoq YK3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=7HURfjI7Faw+R208eEH1/6yoOtyByjWguc0Ty+w+M30=; fh=jhY8rr5NbTHmL8g8Q8Ew3LbAi2tVqOeCj70UC6+z0Mg=; b=xNql7vX+h3TLjt0/a1jRws3sT2OAcIVaVfO91piE+OYCmOBdzaO7io97QLjkFtXDOT iZf8pFc2K1PFr5DXE9nQbTkATPTXuqXJDy1ebGFceEdnAIh5WOaTwBw1Do+CixnFTVgg heg1drJb9iLBcIRVTenNKGYizgHmnR7dEnBa5x/NzBJY5UsYqeCzKUqmRKHV2z22ZXWn iCxACAmchBsTbzpSPcJQBzk3sKqK8aHCWevrjT8zkstSvb1ADqG7VpoKDo5mKOAdMg9M FXBKsC6kaOOi+P5VQDDBfkaL89bE2PotPyirk17+UI3VlCo0KzSr7LDBoFdXQfrRzkjF GOqg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LzVCvSui; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-92335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92335-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 13-20020a0562140ccd00b0068f8d411539si11718874qvx.464.2024.03.05.04.14.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 04:14:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LzVCvSui; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-92335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92335-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6B45B1C2443C for ; Tue, 5 Mar 2024 12:14:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D9E55A4E3; Tue, 5 Mar 2024 12:14:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LzVCvSui" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 606BC5A0FA for ; Tue, 5 Mar 2024 12:14:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709640861; cv=none; b=DDKz1d289edB/m5tG2S/8T3qjA8auNuI9uB20tNSCZQ5djm8ikHRAarEYEOpvvzr81Gy5rISGxtYgJzQkckJ61Nb5XiUN90SFKigWDdAhx4G+jm9WkHMNMaERzEewlGFcMiN7qFYj3RirBVL7AGTHRXxuNzolOJBjkGFgcC2Qk0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709640861; c=relaxed/simple; bh=iUUfZ5ZCtCnqfF/mXQXgZgS5VBRFnGVcwXPjE7EqbMM=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=MAV0OwIeM3ZiuaVh/s0ebK0xAorbeX5AIdohNEf7qV5Sva2FUpljHfQpA5t4f0TQr6KKKopR3eOqxQKTPIJxnGiJsiUextezJzKXrwHiAGpLCv8lmnjO6ydMHLNqNSTPGuRPi49cEcT4cFBGZLfg/SvMPOBz4oG2IBu3xtE1sUo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=LzVCvSui; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709640858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=7HURfjI7Faw+R208eEH1/6yoOtyByjWguc0Ty+w+M30=; b=LzVCvSuib1rmjitT2lQm5MMBU5lnhJdyQHgIe4dMBat7VUrnw8f3st050vYUq7JDRPkw4j ZW15gqzIx9kyphsEzjPjtAOGA5adNDkiOZyy+ANEGJiDhfQvtsyK0gtdcb/d9VEfElUeLa keYzria8sqFsWOXPWRbgMdMtUFyzw4k= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-530-FXNQOVPJO--7-hca_ma90A-1; Tue, 05 Mar 2024 07:14:16 -0500 X-MC-Unique: FXNQOVPJO--7-hca_ma90A-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3377bf95b77so643053f8f.0 for ; Tue, 05 Mar 2024 04:14:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709640855; x=1710245655; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7HURfjI7Faw+R208eEH1/6yoOtyByjWguc0Ty+w+M30=; b=Yc0//MzDss89KZLekR9gEYKjf+OV1v6OX2QgdkURVJwEv7wAu/aC438A5xIRRMjE8Y 74MYIenDSPHtAAyGOGW75tcha6vZGHd2IaEOSnftMUbG2j9xeveaRLUwfnggi5C+ieTW BXZkLxRLGtyjJc+0fDTymksbhqr8tLY6le75IsAhz6r6JoK4rxdJjSKMcB2ekpnJRqed FYXvILEpFwsKlbS4KRPQIGzP3nTUjOfQ9Di8kVwlamBl0+rRwX80UAl36sQJ3je4Edk9 eFJgpgRLoU4v5MKu6DtH7fNjWBgCVmDZz0BpgqYj/BqR3TNsaVvdbP9KQV9LOSk00n89 FICw== X-Forwarded-Encrypted: i=1; AJvYcCXdKzRbYAPBJCsgQCttR/BpXrJMQNqsRR0id38O4v3BhX1LARHxQ4JFlGmcDtoq+HhhExBf/wa2k6rgzaKrdvAqlttSnVdhMe2t0XW7 X-Gm-Message-State: AOJu0YynyBAPFrtLdCKVWEa/ofFb0W04S/vJHEUN7z0Dzy+jRXhetdO7 Ss5SCWpwOsW1XMVf9mElLB8SC7SPadwuJ7qIg23E3ZcgDXZnN7eZ5bhUIYCK+sMg5HsKtRKsQrx 50GHVi6NQ/9hF4x4WPWDAY5xs+UCaslijRVdKWe1MeKqldO2w/E8q+20MlADtjw== X-Received: by 2002:a05:600c:511c:b0:412:b2af:2632 with SMTP id o28-20020a05600c511c00b00412b2af2632mr144224wms.0.1709640855458; Tue, 05 Mar 2024 04:14:15 -0800 (PST) X-Received: by 2002:a05:600c:511c:b0:412:b2af:2632 with SMTP id o28-20020a05600c511c00b00412b2af2632mr144211wms.0.1709640855093; Tue, 05 Mar 2024 04:14:15 -0800 (PST) Received: from gerbillo.redhat.com (146-241-235-19.dyn.eolo.it. [146.241.235.19]) by smtp.gmail.com with ESMTPSA id i9-20020a5d6309000000b0033e122a9a91sm14128708wru.105.2024.03.05.04.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 04:14:14 -0800 (PST) Message-ID: <8a3ccdc5445d0cfda36418dd50746f13f447bdaa.camel@redhat.com> Subject: Re: [PATCH net-next v3] net: netconsole: Add continuation line prefix to userdata messages From: Paolo Abeni To: Matthew Wood , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jonathan Corbet , Breno Leitao Cc: netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 05 Mar 2024 13:14:13 +0100 In-Reply-To: <20240301185855.944405-1-thepacketgeek@gmail.com> References: <20240301185855.944405-1-thepacketgeek@gmail.com> Autocrypt: addr=pabeni@redhat.com; prefer-encrypt=mutual; keydata=mQINBGISiDUBEAC5uMdJicjm3ZlWQJG4u2EU1EhWUSx8IZLUTmEE8zmjPJFSYDcjtfGcbzLPb63BvX7FADmTOkO7gwtDgm501XnQaZgBUnCOUT8qv5MkKsFH20h1XJyqjPeGM55YFAXc+a4WD0YyO5M0+KhDeRLoildeRna1ey944VlZ6Inf67zMYw9vfE5XozBtytFIrRyGEWkQwkjaYhr1cGM8ia24QQVQid3P7SPkR78kJmrT32sGk+TdR4YnZzBvVaojX4AroZrrAQVdOLQWR+w4w1mONfJvahNdjq73tKv51nIpu4SAC1Zmnm3x4u9r22mbMDr0uWqDqwhsvkanYmn4umDKc1ZkBnDIbbumd40x9CKgG6ogVlLYeJa9WyfVMOHDF6f0wRjFjxVoPO6p/ZDkuEa67KCpJnXNYipLJ3MYhdKWBZw0xc3LKiKc+nMfQlo76T/qHMDfRMaMhk+L8gWc3ZlRQFG0/Pd1pdQEiRuvfM5DUXDo/YOZLV0NfRFU9SmtIPhbdm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lTuUTpoyT3xwAzkmSxN1nABoutHEO/N87fpIbpbZaIdinF7b9srwUvDOKsywfs5HMiUZhLKoZzCcU/AEFjQsPTATACGsWf3JYPnWxL9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Fri, 2024-03-01 at 10:58 -0800, Matthew Wood wrote: > Add a space (' ') prefix to every userdata line to match docs for > dev-kmsg. To account for this extra character in each userdata entry, > reduce userdata entry names (directory name) from 54 characters to 53. >=20 > According to the dev-kmsg docs, a space is used for subsequent lines to > mark them as continuation lines. >=20 > > A line starting with ' ', is a continuation line, adding > > key/value pairs to the log message, which provide the machine > > readable context of the message, for reliable processing in > > userspace. >=20 > Testing for this patch:: >=20 > cd /sys/kernel/config/netconsole && mkdir cmdline0 > cd cmdline0 > mkdir userdata/test && echo "hello" > userdata/test/value > mkdir userdata/test2 && echo "hello2" > userdata/test2/value > echo "message" > /dev/kmsg >=20 > Outputs:: >=20 > 6.8.0-rc5-virtme,12,493,231373579,-;message > test=3Dhello > test2=3Dhello2 >=20 > And I confirmed all testing works as expected from the original patchset >=20 > Fixes: df03f830d099 ("net: netconsole: cache userdata formatted string in= netconsole_target") > Reviewed-by: Breno Leitao I guess the tag arrived off-list, because I can't see any sign of it on the ML?!? > Signed-off-by: Matthew Wood > --- >=20 > v1 -> v2: > - Calculate 53 byte user data name from: entry length - formatting chars = - value length > - Update docs to reflect 53 byte limit for user data name (director) > v2 -> v3: > - Added #define for userdata formatting character length (3) > - Matched all #defines indent level >=20 > Documentation/networking/netconsole.rst | 8 ++++---- > drivers/net/netconsole.c | 14 +++++++++----- > 2 files changed, 13 insertions(+), 9 deletions(-) >=20 > diff --git a/Documentation/networking/netconsole.rst b/Documentation/netw= orking/netconsole.rst > index b28c525e5d1e..d55c2a22ec7a 100644 > --- a/Documentation/networking/netconsole.rst > +++ b/Documentation/networking/netconsole.rst > @@ -180,7 +180,7 @@ Custom user data can be appended to the end of messag= es with netconsole > dynamic configuration enabled. User data entries can be modified without > changing the "enabled" attribute of a target. > =20 > -Directories (keys) under `userdata` are limited to 54 character length, = and > +Directories (keys) under `userdata` are limited to 53 character length, = and > data in `userdata//value` are limited to 200 bytes:: > =20 > cd /sys/kernel/config/netconsole && mkdir cmdline0 > @@ -197,8 +197,8 @@ Messages will now include this additional user data:: > Sends:: > =20 > 12,607,22085407756,-;This is a message > - foo=3Dbar > - qux=3Dbaz > + foo=3Dbar > + qux=3Dbaz > =20 > Preview the userdata that will be appended with:: > =20 > @@ -218,7 +218,7 @@ The `qux` key is omitted since it has no value:: > =20 > echo "This is a message" > /dev/kmsg > 12,607,22085407756,-;This is a message > - foo=3Dbar > + foo=3Dbar > =20 > Delete `userdata` entries with `rmdir`:: > =20 > diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c > index 0de108a1c0c8..8cc28aec59c8 100644 > --- a/drivers/net/netconsole.c > +++ b/drivers/net/netconsole.c > @@ -42,12 +42,16 @@ MODULE_AUTHOR("Maintainer: Matt Mackall "); > MODULE_DESCRIPTION("Console driver for network interfaces"); > MODULE_LICENSE("GPL"); > =20 > -#define MAX_PARAM_LENGTH 256 > -#define MAX_USERDATA_NAME_LENGTH 54 > -#define MAX_USERDATA_VALUE_LENGTH 200 > +#define MAX_PARAM_LENGTH 256 > +/* characters used for formatting each userdata entry line (' ', '=3D', = '\n') */ > +#define USERDATA_FORMAT_CHARS 3 > #define MAX_USERDATA_ENTRY_LENGTH 256 > +#define MAX_USERDATA_VALUE_LENGTH 200 > +#define MAX_USERDATA_NAME_LENGTH MAX_USERDATA_ENTRY_LENGTH - \ > + MAX_USERDATA_VALUE_LENGTH - \ > + USERDATA_FORMAT_CHARS AFAICS this is not what Breno asked, and checkpatch complains rightfully. More importantly it's fragile: what will be the result of MAX_USERDATA_NAME_LENGTH * 2 ? At least some brackets are required: #define MAX_USERDATA_NAME_LENGTH (MAX_USERDATA_ENTRY_LENGTH - MAX_USERDATA_VALUE_LENGTH - \ USERDATA_FORMAT_CHARS) Thanks, Paolo