From nobody Fri Jan 03 15:52:06 2025 X-Original-To: dev-commits-src-main@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 4YPp3q05Jlz5k7yd; Fri, 03 Jan 2025 15:52:07 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YPp3p6YFPz4YYJ; Fri, 3 Jan 2025 15:52:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735919526; 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=xG0+HWaw7VX3sUaeWnhWkN5FVGdpPIDSD+GSI7cuxNU=; b=gR3B42AdELmrIQ3MYpQpCHbDkZuyEEx9dxREzOX+f7llE5SB26TPb9sQT7GD/4Wm76SOsj Jf8QlX44+XBzpfxR6jebkp2dN9hnYyasGnSg/Tywa8BE7UP6kk1Hb/YE/1B7RvWEhexrFr cxgSLkUQrAn9Vil/n+o2MTnH8NWxvAB1maCi727A2hCOHEqMmi2r+oLPJoVm0oEbu+cs5O //B+b6yx+Z2XmZm6z9qB5cThB0xYI5mCIA2+JQp/SWIHNvEF0tiM21hzpxDvCQ5Qx3VWgJ eL8NjMeG2udASlewyfTxEMBIe9Py6b/rZiyai9Ia6NwliJp9SyJ4+D+xGsJ/tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735919526; 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=xG0+HWaw7VX3sUaeWnhWkN5FVGdpPIDSD+GSI7cuxNU=; b=a4WCiOF/hIvdEPhpFamWUvdpSLZ5fDtxP2+agxeOCWZ0Gks5KdX7FU2mkw4E199GNa/S7K AbuGpC3RW3Oi4wkpMBWYvodlfxMdH/7Rm/CfL0yrVOfOZo7ZvILvpIlTD8PzJpMuD+h9KN mHh8jc3H3Ls6a3y5cFFheXFtenUoN2f3dKXdZhas7DoNFEDqws1pSL+N1MdNDF1cKDDewi NpHmwW+ZYvHCMpoLVBRKR4v3kwlzHQ17qL81OYnXDpoGq8iioDiOPyoNFzryu4qrrDQxrQ rVbPUssg9H1zPlhvMSLopT/k8f6sGgFgjNHqgkR7cxeGXb/jZsXkgLfwl7vjMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735919526; a=rsa-sha256; cv=none; b=iYwoPJe5radzPhDWlsog8owh9mfpEdOaHxLR+Y9vbU7+LIAgI2Z+cO78iwv7Y4h3vzclXX erqNlNYZ4syz8cBuUjmfiXbJapjQq/xyJtV1qQjio8HYbTcUmGvvRPzrVggLIpsDFhJiNs FJRRFfkycobXOMJXO+a1fPr4gZfMv0IfrTxFjwYXHcS10VJH1dzmjxPLOeKBfRAva7NPWw ydPwOIeNDCYCMZtpTbnGZg62QNB9QL3auLngrZsCgSKCUQGHGAdytUpwk1GgWseme2CfwC xl8FQuL1DxX7QexFhdR32sRM6I68+a936MXjjvTM4ASOxS7gwVRrzzVFenVh7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YPp3p64V0z1RlZ; Fri, 03 Jan 2025 15:52:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 503Fq6sM076320; Fri, 3 Jan 2025 15:52:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 503Fq6PV076317; Fri, 3 Jan 2025 15:52:06 GMT (envelope-from git) Date: Fri, 3 Jan 2025 15:52:06 GMT Message-Id: <202501031552.503Fq6PV076317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: ecb5fe3c5e48 - main - nv.9: Add a new subsection documenting kernel-specific behavior List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecb5fe3c5e483e09544645ba84281b4a8cba4edf Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ecb5fe3c5e483e09544645ba84281b4a8cba4edf commit ecb5fe3c5e483e09544645ba84281b4a8cba4edf Author: John Baldwin AuthorDate: 2025-01-03 15:51:51 +0000 Commit: John Baldwin CommitDate: 2025-01-03 15:51:51 +0000 nv.9: Add a new subsection documenting kernel-specific behavior Reviewed by: emaste Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48257 --- share/man/man9/nv.9 | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/share/man/man9/nv.9 b/share/man/man9/nv.9 index 4e4542c146ef..8c99f1d12200 100644 --- a/share/man/man9/nv.9 +++ b/share/man/man9/nv.9 @@ -859,7 +859,7 @@ If no element named .Fa name with the appropriate type exists, the program aborts. The nvlist must not be in the error state. -.Sh NOTES +.Ss Notes The .Fn nvlist_pack and @@ -873,6 +873,36 @@ The and .Fn nvlist_xfer functions can transfer nvlists between hosts with different endianness. +.Ss Kernel Considerations +The +.Nm nv , +.Nm cnv , +and +.Nm dnv +APIs can be used in the kernel with the following differences: +.Bl -bullet +.It +File descriptor and file descriptor array value types are not supported. +.It +.Fn nvlist_recv , +.Fn nvlist_send , +and +.Fn nvlist_xfer +are not supported. +.It +All memory allocations use the +.Dv M_NVLIST +memory type with +.Xr malloc 9 +and +.Xr free 9 . +As a result, any allocated buffers moved into an nvlist must be allocated with +.Dv M_NVLIST , +and buffers returned by functions such as +.Fn nvlist_pack +must be freed with +.Dv M_NVLIST . +.El .Sh EXAMPLES The following example demonstrates how to prepare an nvlist and send it over a .Xr unix 4