From nobody Thu May 07 15:27:04 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gBGML1tpsz6cjVS for ; Thu, 07 May 2026 15:27:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gBGMK5dRwz3RKj for ; Thu, 07 May 2026 15:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778167629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5s4pvBWxC7Omf0brDShojEfI2xz8nv6etWfCAk0DG4A=; b=V3olgQ+uq5Is30qIcKHehI92oFriBa85bWaFcFhxvKKWIGz0NSgC/rSwsMq2n3KDsHsc6W 0f8dPBmm1xJUQupWXW+0KSEQYGnd9yMiK5j1sahozBjMDDusJ7oUXepItsOqqqJGDYgDho jPPHkrkFOVVt98oWxNi5YAscXJnRlGRytbSlclAgaRwGEunltXO7wY/EdMgM8Uvs0YJ8eX hufaWhHnuZk44osRhZZywHuptGSz52m1XrfpFWz/SzYWaBIZK/lq9NnVPWqppLA1fZr4ag SDE6OXM5gU7WVmaSsg6X3YdYd86+sm52ClCDZtKaPOgOp2YZxSzNAOCQfTlfPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778167629; a=rsa-sha256; cv=none; b=uxcCoeVQzN+iFbujbWGdadPNGPX0VDOxJ2nYznxeX1wPDl06b9xKWhsK6SZ7UTHw7U8cCn RKai7cGCZ4U767O2sBfndcl0pSZxDDP0Nl4s1RYqzsFwRit7eNeTYjMnpcSGmep2OIxqJv tQGv5xx1yX/gQ9MR8rTwnJ2VbQaSyP/WUVO0rCNC6X13VKQlYbOZZuqUYjHX1N96Wlx3cA xDR5ZsmRH8MVDm1ntmgqry+62lB+Hwuh/XGheYtYdyA0es4dsLcM3+oWoA3ZgQWf05cqfu LmdKYMCPHB8l8tOm10sFcKwf41GvgOtZEJK1Q/kYlRsdyC94I59DIOg9GwDOKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778167629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5s4pvBWxC7Omf0brDShojEfI2xz8nv6etWfCAk0DG4A=; b=TrLJopHCyPkBtKEKqpxfYmbSR72MFKdzg7ylRF3egVojY+qUYa1nloJI2VNbqYRUlgdcWv mdIXZHXsimToymGAUZg+Kd0yu93Na7izBmYGlKk5iePrAw5PvhrvgerAzpYtuCKnOGv/xb 7ZrWBJrDuOIYbe9KviFMJuEBFsY+dyQes0CuV95wm+FR4Eg2jLpWnIuQtf4BVy6H7Vyi3y FHhtYfvlb6tX6l8xVPbXpBw6GIEUC/2r4g7k0orbZsG6LwnLp+IVTCnH6Bb0voc9ctib7Q X2ldMjPjIypjGr1y75fkkH68Lq5rjJcO7Vfcz7tr+JvbeeRZuMiMMUvFJ4aOZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gBGMK5D5kzWgt for ; Thu, 07 May 2026 15:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3021b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 07 May 2026 15:27:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: ee2fc974e071 - stable/15 - nlsysevent: add manpage List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ee2fc974e0716040622926c7c8ca8df09284e6f9 Auto-Submitted: auto-generated Date: Thu, 07 May 2026 15:27:04 +0000 Message-Id: <69fcaf48.3021b.327c5aca@gitrepo.freebsd.org> The branch stable/15 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=ee2fc974e0716040622926c7c8ca8df09284e6f9 commit ee2fc974e0716040622926c7c8ca8df09284e6f9 Author: Baptiste Daroussin AuthorDate: 2026-04-09 08:50:41 +0000 Commit: Baptiste Daroussin CommitDate: 2026-05-07 15:26:10 +0000 nlsysevent: add manpage Reviewed by: des (cherry picked from commit 72d701eb1d83cfb3479e4c839412325ff9efc97c) --- share/man/man4/Makefile | 1 + share/man/man4/nlsysevent.4 | 132 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 62d0b8f77f0f..23057e016f7d 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -428,6 +428,7 @@ MAN= aac.4 \ ng_vjc.4 \ ng_vlan.4 \ ng_vlan_rotate.4 \ + nlsysevent.4 \ nmdm.4 \ ${_ntb.4} \ ${_ntb_hw_amd.4} \ diff --git a/share/man/man4/nlsysevent.4 b/share/man/man4/nlsysevent.4 new file mode 100644 index 000000000000..3b46ab65f568 --- /dev/null +++ b/share/man/man4/nlsysevent.4 @@ -0,0 +1,132 @@ +.\" +.\" Copyright (c) 2026 Baptiste Daroussin +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd April 9, 2026 +.Dt NLSYSEVENT 4 +.Os +.Sh NAME +.Nm nlsysevent +.Nd Netlink-based kernel event notification module +.Sh SYNOPSIS +To load the driver as a module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +nlsysevent_load="YES" +.Ed +.Pp +Alternatively, to load the module at runtime: +.Bd -literal -offset indent +kldload nlsysevent +.Ed +.Sh DESCRIPTION +The +.Nm +kernel module provides a +.Xr netlink 4 +Generic Netlink interface for receiving kernel device events. +It hooks into the +.Xr devctl 4 +notification system and re-publishes all kernel events as Generic Netlink +multicast messages under the +.Dv NETLINK_GENERIC +protocol family. +.Pp +This provides an alternative to reading events from +.Pa /dev/devctl +.Pq used by Xr devd 8 , +with the advantage that multiple consumers can subscribe to events +simultaneously, and consumers can selectively subscribe to specific +event groups. +.Ss Generic Netlink Family +The module registers a Generic Netlink family named +.Dq Li nlsysevent . +The dynamically-assigned family identifier can be resolved using the +standard +.Dv CTRL_CMD_GETFAMILY +request as described in +.Xr genetlink 4 . +.Ss Commands +The following command is defined: +.Bl -tag -width indent +.It Dv NLSE_CMD_NEWEVENT +Sent when a kernel event occurs. +This message is never solicited by userland; it is only delivered to +sockets that have subscribed to one or more multicast groups. +.El +.Ss Attributes +Each +.Dv NLSE_CMD_NEWEVENT +message contains the following TLV attributes: +.Bl -tag -width indent +.It Dv NLSE_ATTR_SYSTEM +(string) The system name that generated the event +.Pq e.g., Dq Li ACPI , Dq Li IFNET , Dq Li USB . +.It Dv NLSE_ATTR_SUBSYSTEM +(string) The subsystem name within the system. +.It Dv NLSE_ATTR_TYPE +(string) The type of the event. +.It Dv NLSE_ATTR_DATA +(string) Optional extra data associated with the event. +This attribute may be absent if no extra data was provided. +.El +.Ss Multicast Groups +The module creates one multicast group per system name. +The following groups are pre-registered when the module is loaded: +.Pp +.Bl -column "HYPERV_NIC_VF" -offset indent -compact +.It Li ACPI +.It Li AEON +.It Li CAM +.It Li CARP +.It Li coretemp +.It Li DEVFS +.It Li device +.It Li ETHERNET +.It Li GEOM +.It Li HYPERV_NIC_VF +.It Li IFNET +.It Li INFINIBAND +.It Li KERNEL +.It Li nvme +.It Li PMU +.It Li RCTL +.It Li USB +.It Li VFS +.It Li VT +.It Li ZFS +.El +.Pp +Additional groups are created dynamically as new system names appear in +kernel events, up to a maximum of 64 groups. +.Pp +The group identifier for a given system name can be resolved via +.Dv CTRL_CMD_GETFAMILY +and then subscribed to using the +.Dv NETLINK_ADD_MEMBERSHIP +socket option. +.Sh EXAMPLES +The +.Xr genl 1 +utility can be used to monitor events: +.Bd -literal -offset indent +genl monitor nlsysevent +.Ed +.Sh SEE ALSO +.Xr genl 1 , +.Xr snl 3 , +.Xr devctl 4 , +.Xr genetlink 4 , +.Xr netlink 4 , +.Xr devd 8 +.Sh HISTORY +The +.Nm +module first appeared in +.Fx 15.0 . +.Sh AUTHORS +The +.Nm +kernel module and this manual page were written by +.An Baptiste Daroussin Aq Mt bapt@FreeBSD.org .