]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
netconsole: introduce 'msgid' as a new sysdata field
authorGustavo Luiz Duarte <gustavold@gmail.com>
Mon, 16 Jun 2025 17:08:35 +0000 (10:08 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Jun 2025 09:46:10 +0000 (10:46 +0100)
This adds a new sysdata field to enable assigning a per-target unique id
to each message sent to that target. This id can later be appended as
part of sysdata, allowing targets to detect dropped netconsole messages.
Update count_extradata_entries() to take the new field into account.

Reviewed-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Gustavo Luiz Duarte <gustavold@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netconsole.c

index 89afe127b46c97e2760e31eedffd824a36c59341..2a273b29e276e5c8a8e2d2550ecdd3780ff82d21 100644 (file)
@@ -113,6 +113,8 @@ enum sysdata_feature {
        SYSDATA_TASKNAME = BIT(1),
        /* Kernel release/version as part of sysdata */
        SYSDATA_RELEASE = BIT(2),
+       /* Include a per-target message ID as part of sysdata */
+       SYSDATA_MSGID = BIT(3),
 };
 
 /**
@@ -799,6 +801,8 @@ static size_t count_extradata_entries(struct netconsole_target *nt)
                entries += 1;
        if (nt->sysdata_fields & SYSDATA_RELEASE)
                entries += 1;
+       if (nt->sysdata_fields & SYSDATA_MSGID)
+               entries += 1;
 
        return entries;
 }