From nobody Tue May 24 20:59:44 2022 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 1B55D1B4F40D; Tue, 24 May 2022 20:59:45 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L765X4PWBz4jd7; Tue, 24 May 2022 20:59:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653425984; 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=Djrdc1Qrxk9TM5fgwL4IhgpShptj7bO4zAk2wgw9CzM=; b=jlNGcJcgVOWbR9IlxX1OwfuTBlHLrtj1uQaAVV2v8DeIJIp+hWQiVHxx3v7j9ybsF9vvPe 6dmR1Olz3Jj4IehYN2USlCGn+Ul13H492IcRx2kA17IOeYzkK9qrcgBQGWbqhNm835U0f0 Ohef3PvxGZaa3yjTJ2xf7J+HbuWKriiTqR+o0UxkMRUmfiN/itSaXROvb3mFrTE6rW0lDP QiRD1AVPSswvsEB84PtHOW5YUyFrJmkeUUfdhVA5njYs1Y9zZ0l7FM4vc/2fcrMs0OphSp Cc1JcAFOhkzWg8djEOgFO2rnR+qLi2WuQDfVp72MoUxeYGU6L1x7i1fPH6Lc1g== 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 51D323F10; Tue, 24 May 2022 20:59:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24OKxiq3036554; Tue, 24 May 2022 20:59:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24OKxirP036553; Tue, 24 May 2022 20:59:44 GMT (envelope-from git) Date: Tue, 24 May 2022 20:59:44 GMT Message-Id: <202205242059.24OKxirP036553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 883c726a39b6 - main - Document nvlist-based set/get ifcaps 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 883c726a39b6bdd403e0ea55856e056b670b43e9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653425984; 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=Djrdc1Qrxk9TM5fgwL4IhgpShptj7bO4zAk2wgw9CzM=; b=Bk8Im0AOLaFkTJlqvgQDwVdGCR5S2bTwSiw7DJ34awhqvWuCGquXtZBX0U7MXAeeItSkWX ufdxuSwFAvQi9rUrubtS80ClSfDwafFjUbU/pTI2R1sECM+dyOzFUizNnHW1T5sieEvjJF x4F9MNEKoz9hnoJ4vyWgYKh8qZ1XHH/dVirPFX0LRpxVgpt6qhx9AS09vb5fOXZzzibM17 pmlPy6w1EKHndoVKUJWjvkutny+HlT4RBXYAu06WwrKV+4qjzjoBoGVNwDGHj7nAAL+CD9 EZK6U965QoTAjeg3M78WDmzeQ65iaEvo99QSFsCKhmgQCDsGsi0j/o2qpHeZJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653425984; a=rsa-sha256; cv=none; b=FHpFFt4edV2h3yLrFW8+wPHrRnfHoM6dLxibcyEwKlqy2ePW4529jp4Jw3V/UVic245oCs 560bBH5hJTCBoWeFP08H/ToekaHv3QCFTjcDXUj6vWovxDTfnHzorEf86XkD1wLDp7ttot AUvSZqZ4VECm0+VegWsvXyHnnz3879+s5fK5sl/gs7AUBzByG3nKqtYdi0xR7RSXKCamhN BWUKPoAnZ5BSblcZCK5XRAmwkofzHTTMYYkCV6eUyG4d4z+2nb9i3Axw60a7FfeTNDu5vC msJDO5mbvznWhPvydNR7J32aIyJy79ROWgzNrjXs6SVUDGeacJ97pTTHGwSjSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=883c726a39b6bdd403e0ea55856e056b670b43e9 commit 883c726a39b6bdd403e0ea55856e056b670b43e9 Author: Konstantin Belousov AuthorDate: 2022-05-08 23:10:10 +0000 Commit: Konstantin Belousov CommitDate: 2022-05-24 20:59:32 +0000 Document nvlist-based set/get ifcaps Reviewed by: debdrup, hselasky, jhb, kp (previous version) Sponsored by: NVIDIA Networking MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D32551 --- share/man/man9/ifnet.9 | 70 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/share/man/man9/ifnet.9 b/share/man/man9/ifnet.9 index d604a2092e19..dd203cb5580b 100644 --- a/share/man/man9/ifnet.9 +++ b/share/man/man9/ifnet.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 28, 2020 +.Dd May 24, 2022 .Dt IFNET 9 .Os .Sh NAME @@ -1334,6 +1334,74 @@ and .Va if_data.ifi_hwassist appropriately. .Pp +.It Dv SIOCGIFCAPNV +.Xr NV 9 +version of the +.Dv SIOCGIFCAP +ioctl. +Caller must provide a pointer to +.Vt struct ifreq_cap_nv +as +.Fa data , +where the member +.Dv buffer +points to some buffer containing +.Dv buf_length +bytes. +The serialized nvlist with description of the device capabilities +is written to the buffer. +If buffer is too short, the structure is updated with +.Dv buffer +member set to +.Dv NULL , +.Dv length +set to the minimal required length, and error +.Er EFBIG +is returned. +.Pp +Elements of the returned nvlist for simple capabilities are boolean, +identified by names. +Presence of the boolean element means that corresponding capability is +supported by the interface. +Element's value describes the current configured state: +.Dv true +means that the capability is enabled, and +.Dv false +that it is disabled. +.Pp +Driver indicates support for both +.Dv SIOCGIFCAPNV +and +.Dv SIOCSIFCAPNV +requests by setting +.Dv IFCAP_NV +non-modifiable capability bit in +.Dv if_capabilities . +.Pp +.It Dv SIOCSIFCAPNV +.Xr NV 9 +version of the +.Dv SIOCSIFCAP +ioctl. +Caller must provide the pointer to +.Vt struct ifreq_cap_nv +as +.Fa data , +where the member +.Dv buffer +points to serialized nvlist of +.Dv length +bytes. +Each element of nvlist describes a requested update of one capability, +identified by the element name. +For simple capabilities, the element must be boolean. +Its +.Dv true +value means that the caller asks to enable the capability, and +.Dv false +value to disable. +Only capabilities listed in the nvlist are affected by the call. +.Pp .It Dv SIOCSIFFIB Sets interface FIB. Caller must have appropriate privilege.