summaryrefslogtreecommitdiff
path: root/usr/src/man
diff options
context:
space:
mode:
authorDan McDonald <danmcd@mnx.io>2022-07-05 16:54:46 -0400
committerDan McDonald <danmcd@mnx.io>2022-07-05 16:54:46 -0400
commit586824c5d718609e395e15b0a92824ba9794397d (patch)
tree7be304e8ef8a0894d5dc93f94d87df32cab92390 /usr/src/man
parent4fb2ab974a5dc6aeb68146a4f5ff4c7ccbe90667 (diff)
parent2c0ebdee8f56c8a9d9e34e30367999396b38fec9 (diff)
downloadillumos-joyent-586824c5d718609e395e15b0a92824ba9794397d.tar.gz
[illumos-gate merge]
commit 2c0ebdee8f56c8a9d9e34e30367999396b38fec9 14273 Want MAC ring manual pages commit ceb3ef192e9bccf08d1bcd0ae5ed520cecccff3d 12389 loader should consult with ACPI SPCR table for serial console commit 6446bd46ed1b4e9f69da153665f82181ccaedad5 14770 ld(1) should be 64bit only commit 7d10cd4ddf12f982d3bc7edcd01cc8b8d1dcc464 14767 retire kssl commit 33b27906b01ade9752c1935377f3fefdf49b8f95 14764 AHCI DEVSLEEP 1.3.1 problematic Conflicts: usr/src/cmd/devfsadm/misc_link.c usr/src/cmd/truss/codes.c usr/src/uts/common/Makefile.files usr/src/uts/intel/Makefile.intel usr/src/uts/sparc/Makefile.sparc
Diffstat (limited to 'usr/src/man')
-rw-r--r--usr/src/man/man8/Makefile2
-rw-r--r--usr/src/man/man8/ksslcfg.8417
-rw-r--r--usr/src/man/man9e/Makefile30
-rw-r--r--usr/src/man/man9e/mac.9e745
-rw-r--r--usr/src/man/man9e/mac_capab_rings.9e475
-rw-r--r--usr/src/man/man9e/mac_filter.9e172
-rw-r--r--usr/src/man/man9e/mc_tx.9e84
-rw-r--r--usr/src/man/man9e/mc_unicst.9e29
-rw-r--r--usr/src/man/man9e/mgi_start.9e152
-rw-r--r--usr/src/man/man9e/mi_enable.9e107
-rw-r--r--usr/src/man/man9e/mr_gget.9e132
-rw-r--r--usr/src/man/man9e/mr_rget.9e151
-rw-r--r--usr/src/man/man9e/mri_poll.9e117
-rw-r--r--usr/src/man/man9e/mri_stat.9e165
-rw-r--r--usr/src/man/man9f/Makefile6
-rw-r--r--usr/src/man/man9f/mac_rx.9f77
-rw-r--r--usr/src/man/man9f/mac_tx_update.9f48
-rw-r--r--usr/src/man/man9s/Makefile9
-rw-r--r--usr/src/man/man9s/mac_callbacks.9s161
-rw-r--r--usr/src/man/man9s/mac_group_info.9s182
-rw-r--r--usr/src/man/man9s/mac_intr.9s114
-rw-r--r--usr/src/man/man9s/mac_ring_info.9s154
22 files changed, 2732 insertions, 797 deletions
diff --git a/usr/src/man/man8/Makefile b/usr/src/man/man8/Makefile
index 3f7e3dc598..bad2e9d2d7 100644
--- a/usr/src/man/man8/Makefile
+++ b/usr/src/man/man8/Makefile
@@ -19,6 +19,7 @@
# Copyright 2020 Joyent, Inc.
# Copyright 2020 Peter Tribble
# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
+# Copryight 2022 Garrett D'Amore <garrett@damore.org>
#
include $(SRC)/Makefile.master
@@ -249,7 +250,6 @@ _MANFILES= 6to4relay.8 \
kpropd.8 \
kproplog.8 \
krb5kdc.8 \
- ksslcfg.8 \
kstat.8 \
ktkt_warnd.8 \
labelit.8 \
diff --git a/usr/src/man/man8/ksslcfg.8 b/usr/src/man/man8/ksslcfg.8
deleted file mode 100644
index 74fbf79247..0000000000
--- a/usr/src/man/man8/ksslcfg.8
+++ /dev/null
@@ -1,417 +0,0 @@
-'\" te
-.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH KSSLCFG 8 "November 22, 2021"
-.SH NAME
-ksslcfg \- enable and configure SMF instance of Kernel SSL
-.SH SYNOPSIS
-.nf
-\fBksslcfg\fR create \fB-f\fR pkcs11 \fB-T\fR \fItoken_label\fR \fB-C\fR \fIcertificate_label\fR
- [\fB-d\fR \fIsofttoken_directory\fR]
- [\fB-p\fR \fIpassword_file\fR [\fB-u\fR \fIusername\fR]]
- [\fB-h\fR \fIca_certchain_file\fR] [\fB-c\fR \fIciphersuites\fR]
- [\fB-t\fR \fIssl_session_cache_timeout\fR]
- [\fB-z\fR \fIssl_session_cache_size\fR] [\fB-v\fR] \fB-x\fR \fIproxy_port\fR [\fIhost\fR] \fIssl_port\fR
-.fi
-
-.LP
-.nf
-\fBksslcfg\fR create \fB-f\fR pkcs12 \fB-i\fR \fIcert_and_key_pk12file\fR
- [\fB-p\fR \fIpassword_file\fR [\fB-u\fR \fIusername\fR]]
- [\fB-c\fR \fIciphersuites\fR] [\fB-t\fR \fIssl_session_cache_timeout\fR]
- [\fB-z\fR \fIssl_session_cache_size\fR] [\fB-v\fR] \fB-x\fR \fIproxy_port\fR [\fIhost\fR] \fIssl_port\fR
-.fi
-
-.LP
-.nf
-\fBksslcfg\fR create \fB-f\fR pem \fB-i\fR \fIcert_and_key_pemfile\fR
- [\fB-p\fR \fIpassword_file\fR [\fB-u\fR \fIusername\fR]]
- [\fB-c\fR \fIciphersuites\fR] [\fB-t\fR \fIssl_session_cache_timeout\fR]
- [\fB-z\fR \fIssl_session_cache_size\fR] [\fB-v\fR] \fB-x\fR \fIproxy_port\fR [\fIhost\fR] \fIssl_port\fR
-.fi
-
-.LP
-.nf
-\fBksslcfg\fR delete [\fB-v\fR] [\fIhost\fR] \fIssl_port\fR
-.fi
-
-.LP
-.nf
-\fBksslcfg\fR \fB-V\fR
-.fi
-
-.LP
-.nf
-\fBksslcfg\fR \fB-?\fR
-.fi
-
-.SH DESCRIPTION
-\fBksslcfg\fR manages \fBsmf\fR(7) instances for the Kernel SSL proxy module.
-An SSL-enabled web server can use the services of its Kernel SSL proxy to
-improve the performance of the HTTPS packets processing. It does so by creating
-an instance of the Kernel SSL service, specifying the SSL proxy port and
-parameters, and by listening on the proxy port.
-.sp
-.LP
-The \fBcreate\fR subcommand creates an instance and enables the service for the
-given address and SSL port.
-.sp
-.LP
-The \fBdelete\fR subcommand disables the service for the given address and
-port, if it is enabled, and deletes the instance from the SMF repository.
-.sp
-.LP
-\fBksslcfg\fR can be run as root or by other users assigned to the Network
-Security profile. See \fBrbac\fR(7) and \fBuser_attr\fR(5). You must run
-\fBksslcfg\fR to configure your Kernel SSL proxy before you start your
-application.
-.sp
-.LP
-\fBksslcfg\fR allows you to specify an \fIssl_port\fR operand, described under
-OPERANDS, and, with the \fB-x\fR option, a \fIproxy_port\fR value. When
-specified for use with the Kernel SSL proxy, these values cannot also be
-configured for the Solaris Network Cache and Acceleration (NCA) feature. See
-\fBnca\fR(1) for a description of the NCA feature.
-.sp
-.LP
-The Fault Managed Resource Identifier (FMRI) for the kernel SSL proxy instances
-is \fBsvc://network/ssl/proxy\fR. \fBksslcfg\fR creates an instance of that
-service unique to the combination of host and SSL port. Instance FMRIs for
-particular proxy entries can be found with \fBsvcs\fR(1) and used for
-dependencies of other services.
-.SH OPTIONS
-The following options are supported:
-.sp
-.ne 2
-.na
-\fB\fB-c\fR \fIciphersuites\fR\fR
-.ad
-.sp .6
-.RS 4n
-Set of ciphers a client is allowed to negotiate in a sorted order. The
-supported SSL version3 and TLS ciphers are listed below. Note that the names
-are case-insensitive.
-.sp
-.in +2
-.nf
-rsa_rc4_128_sha
-rsa_rc4_128_md5
-rsa_aes_256_cbc_sha
-rsa_aes_128_cbc_sha
-rsa_3des_ede_cbc_sha
-rsa_des_cbc_sha
-.fi
-.in -2
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-f\fR \fIkey_format\fR\fR
-.ad
-.sp .6
-.RS 4n
-Uses the certificate/key format specified in \fIkey_format\fR. The supported
-options are \fBpkcs11\fR, \fBpkcs12\fR, and \fBpem\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-i\fR \fIkey_and_certificate_file\fR\fR
-.ad
-.sp .6
-.RS 4n
-When \fBpkcs12\fR or \fBpem\fR is specified with the \fB-f\fR option, reads a
-key and a certificate of the web server from \fIkey_and_certificate_file\fR.
-This file can also contain any intermediate CA certificates that form the
-certificate chain to the root CA for the server certificate. These certificates
-must follow the server certificate in the file and the order must be bottom up:
-lowest level CA certificate followed by the next higher level CA certificate,
-and so on.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-C\fR \fIcertificate_label\fR\fR
-.ad
-.sp .6
-.RS 4n
-PKCS#11 can store multiple certificates in single token. This option enables
-you to specify a single certificate, identified by \fIcertificate_label\fR.
-This label must match the \fBCKA_LABEL\fR on the certificate object in the
-token specified by \fB-T\fR. This option is to be used only with \fB-f\fR
-\fBpkcs11\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-d\fR \fIsofttoken_directory\fR\fR
-.ad
-.sp .6
-.RS 4n
-This option is applicable only with the \fBpkcs11\fR key format, when the token
-label is the Sun Software PKCS#11 softtoken. Use this option to override the
-default location of the PKCS#11 softtoken directory (\fB$HOME/.sunw\fR). See
-\fBpkcs11_softtoken\fR(7).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-h\fR \fIca_certchain_file\fR\fR
-.ad
-.sp .6
-.RS 4n
-When \fBpkcs11\fR is specified with the \fB-f\fR option, reads a set of
-intermediate CA certificates that form the certificate chain to the root CA for
-the server certificate (specified with the \fB-C\fR option), from
-\fIca_certchain_file\fR. The file must be in PEM format.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-p\fR \fIpassword_file\fR\fR
-.ad
-.sp .6
-.RS 4n
-Obtains the password used to encrypt the private key from \fIpassword_file\fR.
-When using the \fBpkcs11\fR option (see \fB-f\fR, above), the password is used
-to authenticate the user to the PKCS #11 token.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-t\fR \fIssl_session_cache_timeout\fR\fR
-.ad
-.sp .6
-.RS 4n
-The timeout value, in seconds, for an SSL session. It corresponds to
-\fBSSL3SessionTimeout\fR of the Sun ONE web server configuration or
-\fBSSLSessionCacheTimeout\fR of \fBmod_ssl\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-T\fR \fItoken_label\fR\fR
-.ad
-.sp .6
-.RS 4n
-When \fBpkcs11\fR is specified with \fB-f\fR, uses the PKCS#11 token specified
-in \fItoken_label\fR. Use \fBcryptoadm list\fR \fB-v\fR to display all PKCS#11
-tokens available.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-u\fR \fIusername\fR\fR
-.ad
-.sp .6
-.RS 4n
-The username of the user who owns the password file. If omitted, the system
-will try to read the password file as root.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-v\fR\fR
-.ad
-.sp .6
-.RS 4n
-Verbose mode.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-V\fR\fR
-.ad
-.sp .6
-.RS 4n
-Displays the version.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-x\fR \fIproxy_port\fR\fR
-.ad
-.sp .6
-.RS 4n
-The SSL proxy port. The port number is designated exclusively for clear-text
-HTTP communication between the web server and the kernel SSL proxy module. No
-external HTTP packets are delivered to this port.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-z\fR \fIssl_session_cache_size\fR\fR
-.ad
-.sp .6
-.RS 4n
-The maximum number of SSL sessions that can be cached. It corresponds to
-\fBSSLCacheEntries\fR of the Sun ONE web server configuration. When this option
-is not specified, the default is 5000 entries.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-?\fR \fI\fR\fR
-.ad
-.sp .6
-.RS 4n
-Displays the usage of the command.
-.RE
-
-.SH OPERANDS
-.ne 2
-.na
-\fB\fB[\fIhost\fR] [\fIssl_port\fR]\fR\fR
-.ad
-.RS 21n
-The address and the port of the web server for which the kernel SSL entry is
-created. If \fIhost\fR is omitted, the entry will be used for all requests that
-arrived at the \fIssl_port\fR, regardless of the destination address. Both a
-host name and an IP address are acceptable forms for \fIhost\fR. \fIssl_port\fR
-is required. Typically, this has a value of 443.
-.RE
-
-.SH EXAMPLES
-\fBExample 1 \fRCreate and Enable a Kernel SSL Instance
-.sp
-.LP
-The following command creates and enables a Kernel SSL instance using a
-certificate and a key in PKCS#11 format.
-
-.sp
-.in +2
-.nf
-# \fBksslcfg create -f pkcs11 -T "Sun Software PKCS#11 softtoken" \e
--C "Server-Cert" -p /some/directory/password -u webservd \e
--x 8080 www.example.com 443\fR
-
-% \fBsvcs svc:/network/ssl/proxy\fR
-STATE STIME FMRI
-online Sep_27 svc:/network/ssl/proxy:kssl-www-example-com-443
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 2 \fRCreate and Enable a Default Instance for All Addresses
-.sp
-.LP
-The following command creates and enables a default instance for all addresses
-from a certificate and key in a \fBpkcs#12\fR file.
-
-.sp
-.in +2
-.nf
-# \fBksslcfg create -x 8888 -f pkcs12 -i /some/directory/keypair.p12 \e
- -p /some/directory/password -u webservd 443\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 3 \fRCreate and Enable an Instance with Specific Cipher Suites
-.sp
-.LP
-The following command creates and enables an instance with specific cipher
-suites.
-
-.sp
-.in +2
-.nf
-# \fBksslcfg create -x 8080 -f pem \e
--i /some/directory/keypair.pem -p /some/directory/password \e
--c "rsa_rc4_128_md5,rsa_rc4_128_sha" \e
-209.249.116.195 443\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 4 \fRDisable and Delete an Instance
-.sp
-.LP
-The following command disables and deletes an instance.
-
-.sp
-.in +2
-.nf
-# \fBksslcfg delete www.example.com 443\fR
-.fi
-.in -2
-.sp
-
-.SH EXIT STATUS
-.ne 2
-.na
-\fB\fB0\fR\fR
-.ad
-.RS 6n
-Successful completion.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB>0\fR\fR
-.ad
-.RS 6n
-An error occurred.
-.RE
-
-.SH ATTRIBUTES
-See \fBattributes\fR(7) for descriptions of the following attributes:
-.sp
-
-.sp
-.TS
-box;
-c | c
-l | l .
-ATTRIBUTE TYPE ATTRIBUTE VALUE
-_
-Interface Stability See below.
-.TE
-
-.sp
-.LP
-Command line options are Evolving; command output is Unstable. The FMRI service
-name (\fBsvc://network/ssl/proxy\fR) is Unstable, as is the FMRI instance's
-name format. The utility name is Stable.
-.SH SEE ALSO
-.BR nca (1),
-.BR svcprop (1),
-.BR svcs (1),
-.BR user_attr (5),
-.BR attributes (7),
-.BR pkcs11_softtoken (7),
-.BR rbac (7),
-.BR smf (7),
-.BR cryptoadm (8),
-.BR svcadm (8),
-.BR svccfg (8)
-.SH NOTES
-\fBksslcfg\fR \fBcreate\fR without an host argument creates an \fBINADDR_ANY\fR
-\fBsmf\fR instance. \fBksslcfg\fR \fBdelete\fR without an host argument deletes
-only the \fBINADDR_ANY\fR instance. \fBksslcfg\fR \fBdelete\fR needs a host
-argument to delete any non-\fBINADDR_ANY\fR instance.
-.sp
-.LP
-On a system with \fBzones\fR(7) installed, the \fBksslcfg\fR command can be
-used only in the global zone at this time.
diff --git a/usr/src/man/man9e/Makefile b/usr/src/man/man9e/Makefile
index a67785e520..33de233a1a 100644
--- a/usr/src/man/man9e/Makefile
+++ b/usr/src/man/man9e/Makefile
@@ -45,6 +45,8 @@ MANFILES= Intro.9e \
mac.9e \
mac_capab_transceiver.9e \
mac_capab_led.9e \
+ mac_capab_rings.9e \
+ mac_filter.9e \
mc_getcapab.9e \
mc_getprop.9e \
mc_getstat.9e \
@@ -57,6 +59,12 @@ MANFILES= Intro.9e \
mc_start.9e \
mc_tx.9e \
mc_unicst.9e \
+ mgi_start.9e \
+ mi_enable.9e \
+ mr_gget.9e \
+ mr_rget.9e \
+ mri_poll.9e \
+ mri_stat.9e \
mmap.9e \
open.9e \
power.9e \
@@ -121,6 +129,15 @@ MANLINKS= ddi_ufm_op_fill_image.9e \
mcl_set.9e \
mct_info.9e \
mct_read.9e \
+ mgi_addmac.9e \
+ mgi_addvlan.9e \
+ mgi_remmac.9e \
+ mgi_remvlan.9e \
+ mgi_stop.9e \
+ mi_disable.9e \
+ mri_start.9e \
+ mri_stop.9e \
+ mri_tx.9e \
intro.9e \
tran_destroy_pkt.9e \
tran_pkt_constructor.9e \
@@ -159,6 +176,11 @@ gldm_set_promiscuous.9e := LINKSRC = gld.9e
gldm_start.9e := LINKSRC = gld.9e
gldm_stop.9e := LINKSRC = gld.9e
+mgi_addmac.9e := LINKSRC = mac_filter.9e
+mgi_remmac.9e := LINKSRC = mac_filter.9e
+mgi_addvlan.9e := LINKSRC = mac_filter.9e
+mgi_remvlan.9e := LINKSRC = mac_filter.9e
+
mc_close.9e := LINKSRC = mc_open.9e
mc_stop.9e := LINKSRC = mc_start.9e
@@ -167,6 +189,14 @@ mcl_set.9e := LINKSRC = mac_capab_led.9e
mct_info.9e := LINKSRC = mac_capab_transceiver.9e
mct_read.9e := LINKSRC = mac_capab_transceiver.9e
+mgi_stop.9e := LINKSRC = mgi_start.9e
+mri_start.9e := LINKSRC = mgi_start.9e
+mri_stop.9e := LINKSRC = mgi_start.9e
+
+mi_disable.9e := LINKSRC = mi_enable.9e
+
+mri_tx.9e := LINKSRC = mc_tx.9e
+
tran_setcap.9e := LINKSRC = tran_getcap.9e
tran_destroy_pkt.9e := LINKSRC = tran_init_pkt.9e
diff --git a/usr/src/man/man9e/mac.9e b/usr/src/man/man9e/mac.9e
index cc24da4b9b..a3a6f5c4ad 100644
--- a/usr/src/man/man9e/mac.9e
+++ b/usr/src/man/man9e/mac.9e
@@ -11,9 +11,9 @@
.\"
.\" Copyright 2019 Joyent, Inc.
.\" Copyright 2020 RackTop Systems, Inc.
-.\" Copyright 2021 Oxide Computer Company
+.\" Copyright 2022 Oxide Computer Company
.\"
-.Dd February 13, 2021
+.Dd July 2, 2022
.Dt MAC 9E
.Os
.Sh NAME
@@ -70,8 +70,58 @@ routines.
In addition, all of the work to interact with
.Xr dlpi 4P
is taken care of automatically and transparently.
+.Ss High-Level Design
+At a high-level, a device driver is chiefly concerned with three general
+operations:
+.Bl -enum -offset indent
+.It
+Sending frames
+.It
+Receiving frames
+.It
+Managing device configuration and metadata
+.El
+.Pp
+When sending frames, the MAC framework always calls functions registered
+in the
+.Xr mac_callbacks 9S
+structure to have the driver transmit frames on hardware.
+When receiving frames, the driver will generally receive an interrupt which will
+cause it to check for incoming data and deliver it to the MAC framework.
+.Pp
+Configuration of a device, such as whether auto-negotiation should be
+enabled, the speeds that the device supports, the MTU (maximum
+transmission unit), and the generation of pause frames are all driven by
+properties.
+The functions to get, set, and obtain information about properties are
+defined through callback functions specified in the
+.Xr mac_callbacks 9S
+structure.
+The full list of properties and a description of the relevant callbacks
+can be found in the
+.Sx PROPERTIES
+section.
+.Pp
+The MAC framework is designed to take advantage of various modern
+features provided by hardware, such as checksumming, segmentation
+offload, and hardware filtering.
+The MAC framework assumes none of these advanced features are present
+and allows device drivers to negotiate them through a capability system.
+Drivers can declare that they support various capabilities by
+implementing the optional
+.Xr mc_getcapab 9E
+entry point.
+Each capability has its associated entry points and structures to fill
+out.
+The capabilities are detailed in the
+.Sx CAPABILITIES
+section.
+.Pp
+The following sections describe the flow of a basic device driver.
+For advanced device drivers, the flow is generally the same.
+The primary distinction is in how frames are sent and received.
.Ss Initializing MAC Support
-For a device to be used in the framework, it must register with the
+For a device to be used by the MAC framework, it must register with the
framework and take specific actions during
.Xr _init 9E ,
.Xr attach 9E ,
@@ -98,7 +148,7 @@ entry points.
Normally, in a driver's
.Xr _init 9E
entry point, it passes its
-.Sy modlinkage
+.Xr modlinkage 9S
structure directly to
.Xr mod_install 9F .
To properly register with MAC, the driver must call
@@ -129,7 +179,7 @@ To register with MAC, a driver must allocate a
structure, fill it in, and then call
.Xr mac_register 9F .
The
-.Sy mac_register_t
+.Vt mac_register_t
structure contains information about the device and all of the required
function pointers that will be used as callbacks by the framework.
.Pp
@@ -146,11 +196,11 @@ it will start receiving callbacks from the MAC framework.
To allocate the registration structure, the driver should call
.Xr mac_alloc 9F .
Device drivers should generally always pass the symbol
-.Sy MAC_VERSION
+.Dv MAC_VERSION
as the argument to
.Xr mac_alloc 9F .
Upon successful completion, the driver will receive a
-.Sy mac_register_t
+.Vt mac_register_t
structure which it should fill in.
The structure and its members are documented in
.Xr mac_register 9S .
@@ -177,7 +227,7 @@ should enable interrupts and finish any other initialization required.
If the call to
.Xr mac_register 9F
failed, then it should unwind its initialization and should return
-.Sy DDI_FAILURE
+.Dv DDI_FAILURE
from its
.Xr attach 9E
routine.
@@ -250,13 +300,14 @@ or
.Xr mac_rx 9F .
Other routines in the DDI may be called while locks are held; however,
device driver writers should be careful about calling blocking routines
-while locks are held or in interrupt context, though it is generally
-legal to do so.
+while locks are held or in interrupt context, even when it is
+legal to do so as this may cause all other callers that need a given
+lock to back up behind such an operation.
.Ss Receiving Data
A device driver will often receive data through the means of an
-interrupt.
-When that interrupt occurs, the device driver will receive one or more frames
-with optional metadata.
+interrupt or by being asked to poll for frames.
+When this occurs, zero or more frames, each with optional metadata, may
+be ready for the device driver to consume.
Often each frame has a corresponding descriptor which has information about
whether or not there were errors or whether or not the device successfully
checksummed the packet.
@@ -267,11 +318,20 @@ See the section
.Sx RECEIVE DESCRIPTOR LAYOUT
for more information.
.Pp
-During a single interrupt, a device driver should process a fixed number
-of frames.
+During a single interrupt or poll request, a device driver should process
+a fixed number of frames.
For each frame the device driver should:
.Bl -enum -offset indent
.It
+Ensure that all of the DMA memory for the descriptor ring is synchronized with
+the
+.Xr ddi_dma_sync 9F
+function and check the handle for errors if the device driver has enabled DMA
+error reporting as part of the Fault Management Architecture (FMA).
+If the driver does not rely on DMA, then it may skip this step.
+It is recommended that this is performed once per interrupt or poll for
+the entire region and not on a per-packet basis.
+.It
First check whether or not the frame has errors.
If errors were detected, then the frame should not be sent to the operating
system.
@@ -302,7 +362,7 @@ should set the corresponding checksumming information with a call to
It should then append this new message block to the
.Em end
of the message block chain, linking it to the
-.Sy b_next
+.Fa b_next
pointer.
It is vitally important that all the frames be chained in the order that they
were received.
@@ -333,6 +393,37 @@ The rest of the networking stack will handle issues related to keeping up
appropriately and ensure that kernel memory is not exhausted by packets
that are not being processed.
.Pp
+If the device driver has negotiated the
+.Dv MAC_CAPAB_RINGS
+capability
+.Pq discussed in Xr mac_capab_rings 9E
+then it should call
+.Xr mac_rx_ring 9F
+and not
+.Xr mac_rx 9F .
+A given interrupt may correspond to more than one ring that needs to be
+checked.
+The set of rings is likely to span different groups that were registered
+with MAC through the
+.Xr mr_gget 9E
+interface.
+In those cases, the driver should follow the above procedure
+independently for each ring.
+That means it will call
+.Xr mac_rx_ring 9F
+once for each ring using the handle that it received from when MAC
+called the driver's
+.Xr mr_rget 9E
+entry point.
+When it is looking at the rings, the driver will need to make sure that
+the ring has not had interrupts disabled
+.Pq due to a pending change to polling mode .
+This is discussed in greater detail in the
+.Xr mac_capab_rings 9E
+and
+.Xr mri_poll 9E
+manual pages.
+.Pp
Finally, the device driver should make sure that any other housekeeping
activities required for the ring are taken care of such that more data
can be received.
@@ -371,6 +462,22 @@ device driver writers provide private properties for their device to control the
interrupt coalescing rate.
This will make it much easier to perform experiments and observe the impact of
different interrupt rates on the rest of the system.
+.Ss Polling
+Even with interrupt coalescing, when there is a certain incoming packet rate it
+can make more sense to just actively poll the device, asking for more packets
+rather than constantly taking an interrupt.
+When a device driver supports the
+.Xr mac_capab_rings 9E
+capability and therefore polling on receive rings, the MAC framework will ask
+the driver to disable interrupts, with its
+.Xr mi_disable 9E
+entry point, and then subsequently call its polling entry point,
+.Xr mri_poll 9E .
+.Pp
+As long as a device driver implements the needed entry points, then there is
+nothing else that it needs to do to take advantage of polling.
+A driver should not attempt to spin up its own threads, task queues, or
+creatively use timeouts, to try to simulate polling for received packets.
.Ss MAC Address Filter Management
The MAC framework will attempt to use as many MAC address filters as a
device has.
@@ -382,6 +489,27 @@ and just return the appropriate error as documented in the corresponding manual
pages for the entry points.
The framework will ensure that the device is placed in promiscuous mode
if it needs to.
+.Pp
+If the hardware supports more than one unicast filter then the device
+driver should consider implementing the
+.Dv MAC_CAPAB_RINGS
+capability, which exposes a means for multiple unicast MAC address filters to be
+used by the broader system.
+It is still useful to implement this on hardware which only has a single ring.
+See
+.Xr mac_capab_rings 9E
+for more information.
+.Ss Receive Side Scaling
+Receive side scaling is where a hardware device supports multiple,
+independent queues of frames that can be received.
+Each of these queues is generally associated with an independent
+interrupt and the hardware usually performs some form of hash across the
+queues.
+Hardware which supports this should look at implementing the
+.Dv MAC_CAPAB_RINGS
+capability and see
+.Xr mac_capab_rings 9E
+for more information.
.Ss Link Updates
It is the responsibility of the device driver to keep track of the
data link's state.
@@ -505,18 +633,9 @@ fail the call to
Administrators always interact with devices through the
.Xr dladm 8
command line interface.
-The state of devices such as whether the link is considered
-.Sy up
-or
-.Sy down ,
-various link properties such as the
-.Sy MTU ,
-.Sy auto-negotiation
-state,
-and
-.Sy flow control
-state,
-are all exposed.
+The state of devices such as whether the link is considered up or down ,
+various link properties such as the MTU, auto-negotiation state, and
+flow control state, are all exposed.
It is also the preferred way that these properties are set and configured.
.Pp
While device tunables may be presented in a
@@ -543,7 +662,7 @@ Note, the set of capabilities changes over time and there are also private
capabilities in the system.
Several of the capabilities are used in the implementation of the MAC framework.
Others, like
-.Sy MAC_CAPAB_RINGS ,
+.Dv MAC_CAPAB_RINGS ,
represent feature that have not been stabilized and thus both API and binary
compatibility for them is not guaranteed.
It is important that the device driver handles unknown capabilities correctly.
@@ -552,13 +671,13 @@ For more information, see
.Pp
The following capabilities are
stable and defined in the system:
-.Ss MAC_CAPAB_HCKSUM
+.Ss Dv MAC_CAPAB_HCKSUM
The
-.Sy MAC_CAPAB_HCKSUM
+.Dv MAC_CAPAB_HCKSUM
capability indicates to the system that the device driver supports some
amount of checksumming.
The specific data for this capability is a pointer to a
-.Sy uint32_t .
+.Vt uint32_t .
To indicate no support for any kind of checksumming, the driver should
either set this value to zero or simply return that it doesn't support
the capability.
@@ -569,7 +688,7 @@ If the driver can only verify checksums when receiving data, then it should not
indicate that it supports this capability.
The following set of flags may be combined through a bitwise inclusive OR:
.Bl -tag -width Ds
-.It Sy HCKSUM_INET_PARTIAL
+.It Dv HCKSUM_INET_PARTIAL
This indicates that the hardware can calculate a partial checksum for
both IPv4 and IPv6 UDP and TCP packets; however, it requires the pseudo-header
checksum be calculated for it.
@@ -578,22 +697,22 @@ The pseudo-header checksum will be available for the mblk_t when calling
Note this does not imply that the hardware is capable of calculating
the partial checksum for other L4 protocols or the IPv4 header checksum.
That should be indicated with the
-.Sy HCKSUM_IPHDRCKSUM flag.
-.It Sy HCKSUM_INET_FULL_V4
+.Dv HCKSUM_IPHDRCKSUM flag.
+.It Dv HCKSUM_INET_FULL_V4
This indicates that the hardware will fully calculate the L4 checksum for
outgoing IPv4 UDP or TCP packets only, and does not require a pseudo-header
checksum.
Note this does not imply that the hardware is capable of calculating the
checksum for other L4 protocols or the IPv4 header checksum.
That should be indicated with the
-.Sy HCKSUM_IPHDRCKSUM .
-.It Sy HCKSUM_INET_FULL_V6
+.Dv HCKSUM_IPHDRCKSUM .
+.It Dv HCKSUM_INET_FULL_V6
This indicates that the hardware will fully calculate the L4 checksum for
outgoing IPv6 UDP or TCP packets only, and does not require a pseudo-header
checksum.
Note this does not imply that the hardware is capable of calculating the
checksum for any other L4 protocols.
-.It Sy HCKSUM_IPHDRCKSUM
+.It Dv HCKSUM_IPHDRCKSUM
This indicates that the hardware supports calculating the checksum for
the IPv4 header itself.
.El
@@ -625,13 +744,13 @@ checksumming, then it should simply not call
Note that the checksum flags should be set on the first
mblk_t that makes up a given message.
In other words, if multiple mblk_t structures are linked together by the
-.Sy b_cont
+.Fa b_cont
member to describe a single frame, then it should only be called on the
first mblk_t of that set.
However, each distinct message should have the checksum bits set on it, if
applicable.
In other words, each mblk_t that is linked together by the
-.Sy b_next
+.Fa b_next
pointer may have checksum flags set.
.Pp
It is recommended that device drivers provide a private property or
@@ -645,9 +764,9 @@ The transmit property should be checked when determining how to reply to
.Xr mc_getcapab 9E
and the receive property should be checked in the context of the receive
function.
-.Ss MAC_CAPAB_LSO
+.Ss Dv MAC_CAPAB_LSO
The
-.Sy MAC_CAPAB_LSO
+.Dv MAC_CAPAB_LSO
capability indicates that the driver supports various forms of large
send offload (LSO).
The private data is a pointer to a
@@ -715,6 +834,88 @@ Like with checksumming, it is recommended that driver writers provide a
means for disabling the support of LSO even if it is enabled by default.
This deals with the case where issues that pop up for LSO may be worked
around without requiring additional driver work.
+.Sh EVOLVING CAPABILITIES
+The following capabilities are still evolving in the operating system.
+They are documented such that device driver writers may experiment with
+them.
+However, if such drivers are not present inside the core operating
+system repository, they may be subject to API and ABI breakage.
+.Ss Dv MAC_CAPAB_RINGS
+The
+.Dv MAC_CAPAB_RINGS
+capability is very important for implementing a high-performing device
+driver.
+Networking hardware structures the queues of packets to be sent
+and received into a ring.
+Each entry in this ring has a descriptor, which describes the address
+and options for a packet which is going to
+be transmitted or received.
+While simple networking devices only have a single ring, most high-speed
+networking devices have support for many rings.
+.Pp
+Rings are used for two important purposes.
+The first is receive side scaling (RSS), which is the ability to have
+the hardware hash the contents of a packet based on some of the protocol
+headers, and send it to one of several rings.
+These different rings may each have their own interrupt associated with
+them, allowing the card to receive traffic in parallel.
+Similar logic can be performed when sending traffic, to leverage
+multiple hardware resources, thus increasing capacity.
+.Pp
+The second use of rings is to group them together and apply filtering
+rules.
+For example, if a packet matches a specific VLAN or MAC address,
+then it can be sent to a specific ring or a specific group of rings.
+This is especially useful when there are multiple different virtual NICs
+or zones in play as the operating system will be able to use the
+hardware classificaiton features to already know where a given packet
+needs to be delivered internally rather than having to determine that
+for each packet.
+.Pp
+From the MAC framework's perspective, a driver can have one or more
+groups.
+A group consists of the following:
+.Bl -bullet -offset -indent
+.It
+One or more hardware rings.
+.It
+One or more MAC address or VLAN filters.
+.El
+.Pp
+The details around how a device driver changes when rings are employed,
+the data structures that a driver must implement, and more are available
+in
+.Xr mac_capab_rings 9E .
+.Ss Dv MAC_CAPAB_TRANSCEIVER
+Many networking devices leverage external transceivers that adhere to
+standards such as SFP, QSFP, QSFP-DD, etc., which often contain
+standardized information in a EEPROM on the device.
+The
+.Dv MAC_CAPAB_TRANSCEIVER
+capability provides a means of discovering the number of transceivers,
+their types, and reading the data from a transceiver.
+This allows administrators and users to determine if devices are
+present, if the hardware can use them, and in many cases, detailed
+information about the device ranging from its manufacturer and
+serial numbers to specific information about its health.
+Implementing this capability will lead to the operating system being
+able to discover and display transceivers as part of its fault
+management topology.
+.Pp
+See
+.Xr mac_capab_transceiver 9E
+for more details on the capability structure and the various function
+entry points that come along with it.
+.Ss Dv MAC_CAPAB_LED
+The
+.Dv MAC_CAPAB_LED
+capability provides a means to access and control the LEDs on a network
+interface card.
+This is then made available to the broader operating system and consumed
+by facilities such as the Fault Management Architecture.
+See
+.Xr mac_capab_led 9E
+for more details on the structure and requirements of the capability.
.Sh PROPERTIES
Properties in the MAC framework represent aspects of a link.
These include things like the link's current state and MTU.
@@ -752,86 +953,86 @@ and
.Xr mc_setprop 9E
for more information on how to handle them.
.Bl -hang -width Ds
-.It Sy MAC_PROP_DUPLEX
+.It Dv MAC_PROP_DUPLEX
.Bd -filled -compact
Type:
-.Sy link_duplex_t |
+.Vt link_duplex_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_DUPLEX
+.Dv MAC_PROP_DUPLEX
property is used to indicate whether or not the link is duplex.
A duplex link may have traffic flowing in both directions at the same time.
The
-.Sy link_duplex_t
+.Vt link_duplex_t
is an enumeration which may be set to any of the following values:
.Bl -tag -width Ds
-.It Sy LINK_DUPLEX_UNKNOWN
+.It Dv LINK_DUPLEX_UNKNOWN
The current state of the link is unknown.
This may be because the link has not negotiated to a specific speed or it is
down.
-.It Sy LINK_DUPLEX_HALF
+.It Dv LINK_DUPLEX_HALF
The link is running at half duplex.
Communication may travel in only one direction on the link at a given time.
-.It Sy LINK_DUPLEX_FULL
+.It Dv LINK_DUPLEX_FULL
The link is running at full duplex.
Communication may travel in both directions on the link simultaneously.
.El
-.It Sy MAC_PROP_SPEED
+.It Dv MAC_PROP_SPEED
.Bd -filled -compact
Type:
-.Sy uint64_t |
+.Vt uint64_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_SPEED
+.Dv MAC_PROP_SPEED
property stores the current link speed in bits per second.
A link that is running at 100 MBit/s would store the value 100000000ULL.
A link that is running at 40 Gbit/s would store the value 40000000000ULL.
-.It Sy MAC_PROP_STATUS
+.It Dv MAC_PROP_STATUS
.Bd -filled -compact
Type:
-.Sy link_state_t |
+.Vt link_state_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_STATUS
+.Dv MAC_PROP_STATUS
property is used to indicate the current state of the link.
It indicates whether the link is up or down.
The
-.Sy link_state_t
+.Vt link_state_t
is an enumeration which may be set to any of the following values:
.Bl -tag -width Ds
-.It Sy LINK_STATE_UNKNOWN
+.It Dv LINK_STATE_UNKNOWN
The current state of the link is unknown.
This may be because the driver's
.Xr mc_start 9E
endpoint has not been called so it has not attempted to start the link.
-.It Sy LINK_STATE_DOWN
+.It Dv LINK_STATE_DOWN
The link is down.
This may be because of a negotiation problem, a cable problem, or some other
device specific issue.
-.It Sy LINK_STATE_UP
+.It Dv LINK_STATE_UP
The link is up.
If auto-negotiation is in use, it should have completed.
Traffic should be able to flow over the link, barring other issues.
.El
-.It Sy MAC_PROP_AUTONEG
+.It Dv MAC_PROP_AUTONEG
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_AUTONEG
+.Dv MAC_PROP_AUTONEG
property indicates whether or not the device is currently configured to
perform auto-negotiation.
A value of
@@ -847,16 +1048,16 @@ state.
When setting this property, if the device supports operating in the requested
mode, then the device driver should reset the link to negotiate to the new speed
after updating any internal registers.
-.It Sy MAC_PROP_MTU
+.It Dv MAC_PROP_MTU
.Bd -filled -compact
Type:
-.Sy uint32_t |
+.Vt uint32_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_MTU
+.Dv MAC_PROP_MTU
property determines the maximum transmission unit (MTU).
This indicates the maximum size packet that the device can transmit, ignoring
its own headers.
@@ -881,35 +1082,35 @@ If the device does not support changing the MTU after the device's
.Xr mc_start 9E
entry point has been called, then driver writers should return
.Er EBUSY .
-.It Sy MAC_PROP_FLOWCTRL
+.It Dv MAC_PROP_FLOWCTRL
.Bd -filled -compact
Type:
-.Sy link_flowctrl_t |
+.Vt link_flowctrl_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_FLOWCTRL
+.Dv MAC_PROP_FLOWCTRL
property manages the configuration of pause frames as part of Ethernet
flow control.
Note, this only describes what this device will advertise.
What is actually enabled may be different and is subject to the rules of
auto-negotiation.
The
-.Sy link_flowctrl_t
+.Vt link_flowctrl_t
is an enumeration that may be set to one of the following values:
.Bl -tag -width Ds
-.It Sy LINK_FLOWCTRL_NONE
+.It Dv LINK_FLOWCTRL_NONE
Flow control is disabled.
No pause frames should be generated or honored.
-.It Sy LINK_FLOWCTRL_RX
+.It Dv LINK_FLOWCTRL_RX
The device can receive pause frames; however, it should not generate
them.
-.It Sy LINK_FLOWCTRL_TX
+.It Dv LINK_FLOWCTRL_TX
The device can generate pause frames; however, it does not support
receiving them.
-.It Sy LINK_FLOWCTRL_BI
+.It Dv LINK_FLOWCTRL_BI
The device supports both sending and receiving pause frames.
.El
.Pp
@@ -918,33 +1119,33 @@ it has configured the device, not what the device has actually
negotiated.
When setting the property, it should update the hardware and allow the link to
potentially perform auto-negotiation again.
-.It Sy MAC_PROP_EN_FEC_CAP
+.It Dv MAC_PROP_EN_FEC_CAP
.Bd -filled -compact
Type:
-.Sy link_fec_t |
+.Vt link_fec_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_EN_FEC_CAP
+.Dv MAC_PROP_EN_FEC_CAP
property indicates which Forward Error Correction (FEC) code is advertised
by the device.
.Pp
The
-.Sy link_fec_t
+.Vt link_fec_t
is an enumeration that may be a combination of the following bit values:
.Bl -tag -width Ds
-.It Sy LINK_FEC_NONE
+.It Dv LINK_FEC_NONE
No FEC over the link.
-.It Sy LINK_FEC_AUTO
+.It Dv LINK_FEC_AUTO
The FEC coding to use is auto-negotiated,
-.Sy LINK_FEC_AUTO
+.Dv LINK_FEC_AUTO
cannot be set along with any of the other values.
This is the default setting the device driver should use.
-.It Sy LINK_FEC_RS
+.It Dv LINK_FEC_RS
The link may use Reed-Solomon FEC coding.
-.It Sy LINK_FEC_BASE_R
+.It Dv LINK_FEC_BASE_R
The link may use Base-R coding, also common referred to as FireCode.
.El
.Pp
@@ -955,18 +1156,18 @@ the device driver should return
.Er EINVAL .
When retrieving this property, the device driver should return the current
value of the property.
-.It Sy MAC_PROP_ADV_FEC_CAP
+.It Dv MAC_PROP_ADV_FEC_CAP
.Bd -filled -compact
Type:
-.Sy link_fec_t |
+.Vt link_fec_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_ADV_FEC_CAP
+.Dv MAC_PROP_ADV_FEC_CAP
has the same values as
-.Sy MAC_PROP_EN_FEC_CAP .
+.Dv MAC_PROP_EN_FEC_CAP .
The property indicates which Forward Error Correction (FEC) code has been
negotiated over the link.
.El
@@ -1003,119 +1204,119 @@ section for more information.
.Pp
The properties are ordered in increasing link speed:
.Bl -hang -width Ds
-.It Sy MAC_PROP_ADV_10HDX_CAP
+.It Dv MAC_PROP_ADV_10HDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_ADV_10HDX_CAP
+.Dv MAC_PROP_ADV_10HDX_CAP
property describes whether or not 10 Mbit/s half-duplex support is
advertised.
-.It Sy MAC_PROP_EN_10HDX_CAP
+.It Dv MAC_PROP_EN_10HDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_EN_10HDX_CAP
+.Dv MAC_PROP_EN_10HDX_CAP
property describes whether or not 10 Mbit/s half-duplex support is
enabled.
-.It Sy MAC_PROP_ADV_10FDX_CAP
+.It Dv MAC_PROP_ADV_10FDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_ADV_10FDX_CAP
+.Dv MAC_PROP_ADV_10FDX_CAP
property describes whether or not 10 Mbit/s full-duplex support is
advertised.
-.It Sy MAC_PROP_EN_10FDX_CAP
+.It Dv MAC_PROP_EN_10FDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_EN_10FDX_CAP
+.Dv MAC_PROP_EN_10FDX_CAP
property describes whether or not 10 Mbit/s full-duplex support is
enabled.
-.It Sy MAC_PROP_ADV_100HDX_CAP
+.It Dv MAC_PROP_ADV_100HDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_ADV_100HDX_CAP
+.Dv MAC_PROP_ADV_100HDX_CAP
property describes whether or not 100 Mbit/s half-duplex support is
advertised.
-.It Sy MAC_PROP_EN_100HDX_CAP
+.It Dv MAC_PROP_EN_100HDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_EN_100HDX_CAP
+.Dv MAC_PROP_EN_100HDX_CAP
property describes whether or not 100 Mbit/s half-duplex support is
enabled.
-.It Sy MAC_PROP_ADV_100FDX_CAP
+.It Dv MAC_PROP_ADV_100FDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_ADV_100FDX_CAP
+.Dv MAC_PROP_ADV_100FDX_CAP
property describes whether or not 100 Mbit/s full-duplex support is
advertised.
-.It Sy MAC_PROP_EN_100FDX_CAP
+.It Dv MAC_PROP_EN_100FDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_EN_100FDX_CAP
+.Dv MAC_PROP_EN_100FDX_CAP
property describes whether or not 100 Mbit/s full-duplex support is
enabled.
-.It Sy MAC_PROP_ADV_100T4_CAP
+.It Dv MAC_PROP_ADV_100T4_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_ADV_100T4_CAP
+.Dv MAC_PROP_ADV_100T4_CAP
property describes whether or not 100 Mbit/s Ethernet using the
100BASE-T4 standard is
advertised.
-.It Sy MAC_PROP_EN_100T4_CAP
+.It Dv MAC_PROP_EN_100T4_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read/Write
.Ed
@@ -1128,169 +1329,169 @@ enabled.
.It Sy MAC_PROP_ADV_1000HDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_ADV_1000HDX_CAP
+.Dv MAC_PROP_ADV_1000HDX_CAP
property describes whether or not 1 Gbit/s half-duplex support is
advertised.
-.It Sy MAC_PROP_EN_1000HDX_CAP
+.It Dv MAC_PROP_EN_1000HDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_EN_1000HDX_CAP
+.Dv MAC_PROP_EN_1000HDX_CAP
property describes whether or not 1 Gbit/s half-duplex support is
enabled.
-.It Sy MAC_PROP_ADV_1000FDX_CAP
+.It Dv MAC_PROP_ADV_1000FDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_ADV_1000FDX_CAP
+.Dv MAC_PROP_ADV_1000FDX_CAP
property describes whether or not 1 Gbit/s full-duplex support is
advertised.
-.It Sy MAC_PROP_EN_1000FDX_CAP
+.It Dv MAC_PROP_EN_1000FDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_EN_1000FDX_CAP
+.Dv MAC_PROP_EN_1000FDX_CAP
property describes whether or not 1 Gbit/s full-duplex support is
enabled.
-.It Sy MAC_PROP_ADV_2500FDX_CAP
+.It Dv MAC_PROP_ADV_2500FDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_ADV_2500FDX_CAP
+.Dv MAC_PROP_ADV_2500FDX_CAP
property describes whether or not 2.5 Gbit/s full-duplex support is
advertised.
-.It Sy MAC_PROP_EN_2500FDX_CAP
+.It Dv MAC_PROP_EN_2500FDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_EN_2500FDX_CAP
+.Dv MAC_PROP_EN_2500FDX_CAP
property describes whether or not 2.5 Gbit/s full-duplex support is
enabled.
-.It Sy MAC_PROP_ADV_5000FDX_CAP
+.It Dv MAC_PROP_ADV_5000FDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_ADV_5000FDX_CAP
+.Dv MAC_PROP_ADV_5000FDX_CAP
property describes whether or not 5.0 Gbit/s full-duplex support is
advertised.
-.It Sy MAC_PROP_EN_5000FDX_CAP
+.It Dv MAC_PROP_EN_5000FDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_EN_5000FDX_CAP
+.Dv MAC_PROP_EN_5000FDX_CAP
property describes whether or not 5.0 Gbit/s full-duplex support is
enabled.
-.It Sy MAC_PROP_ADV_10GFDX_CAP
+.It Dv MAC_PROP_ADV_10GFDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_ADV_10GFDX_CAP
+.Dv MAC_PROP_ADV_10GFDX_CAP
property describes whether or not 10 Gbit/s full-duplex support is
advertised.
-.It Sy MAC_PROP_EN_10GFDX_CAP
+.It Dv MAC_PROP_EN_10GFDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_EN_10GFDX_CAP
+.Dv MAC_PROP_EN_10GFDX_CAP
property describes whether or not 10 Gbit/s full-duplex support is
enabled.
-.It Sy MAC_PROP_ADV_40GFDX_CAP
+.It Dv MAC_PROP_ADV_40GFDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_ADV_40GFDX_CAP
+.Dv MAC_PROP_ADV_40GFDX_CAP
property describes whether or not 40 Gbit/s full-duplex support is
advertised.
-.It Sy MAC_PROP_EN_40GFDX_CAP
+.It Dv MAC_PROP_EN_40GFDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_EN_40GFDX_CAP
+.Dv MAC_PROP_EN_40GFDX_CAP
property describes whether or not 40 Gbit/s full-duplex support is
enabled.
-.It Sy MAC_PROP_ADV_100GFDX_CAP
+.It Dv MAC_PROP_ADV_100GFDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read-Only
.Ed
.Pp
The
-.Sy MAC_PROP_ADV_100GFDX_CAP
+.Dv MAC_PROP_ADV_100GFDX_CAP
property describes whether or not 100 Gbit/s full-duplex support is
advertised.
-.It Sy MAC_PROP_EN_100GFDX_CAP
+.It Dv MAC_PROP_EN_100GFDX_CAP
.Bd -filled -compact
Type:
-.Sy uint8_t |
+.Vt uint8_t |
Permissions:
.Sy Read/Write
.Ed
.Pp
The
-.Sy MAC_PROP_EN_100GFDX_CAP
+.Dv MAC_PROP_EN_100GFDX_CAP
property describes whether or not 100 Gbit/s full-duplex support is
enabled.
.El
@@ -1299,10 +1500,10 @@ In addition to the defined properties above, drivers are allowed to
define private properties.
These private properties are device-specific properties.
All private properties share the same constant,
-.Sy MAC_PROP_PRIVATE .
+.Dv MAC_PROP_PRIVATE .
Properties are distinguished by a name, which is a character string.
The list of such private properties is defined when registering with mac in the
-.Sy m_priv_props
+.Fa m_priv_props
member of the
.Xr mac_register 9S
structure.
@@ -1316,7 +1517,7 @@ All such properties should start with a leading underscore character and then
consist of alphanumeric ASCII characters and additional underscores or hyphens.
.Pp
Properties of type
-.Sy MAC_PROP_PRIVATE
+.Dv MAC_PROP_PRIVATE
may show up in all three property related entry points:
.Xr mc_propinfo 9E ,
.Xr mc_getprop 9E ,
@@ -1341,7 +1542,7 @@ proper stat.
.Pp
In general, if the device is not keeping track of these statistics, then
it is recommended that the driver store these values as a
-.Sy uint64_t
+.Vt uint64_t
to ensure that overflow does not occur.
.Pp
If a device does not support a specific statistic, then it is fine to
@@ -1354,51 +1555,44 @@ for more information on the proper way to handle these.
The following statistics are based on MIB-II statistics from both RFC
1213 and RFC 1573.
.Bl -tag -width Ds
-.It Sy MAC_STAT_IFSPEED
+.It Dv MAC_STAT_IFSPEED
The device's current speed in bits per second.
-.It Sy MAC_STAT_MULTIRCV
+.It Dv MAC_STAT_MULTIRCV
The total number of received multicast packets.
-.It Sy MAC_STAT_BRDCSTRCV
+.It Dv MAC_STAT_BRDCSTRCV
The total number of received broadcast packets.
-.It Sy MAC_STAT_MULTIXMT
+.It Dv MAC_STAT_MULTIXMT
The total number of transmitted multicast packets.
-.It Sy MAC_STAT_BRDCSTXMT
+.It Dv MAC_STAT_BRDCSTXMT
The total number of received broadcast packets.
-.It Sy MAC_STAT_NORCVBUF
+.It Dv MAC_STAT_NORCVBUF
The total number of packets discarded by the hardware due to a lack of
receive buffers.
-.It Sy MAC_STAT_IERRORS
+.It Dv MAC_STAT_IERRORS
The total number of errors detected on input.
-.It Sy MAC_STAT_UNKNOWNS
+.It Dv MAC_STAT_UNKNOWNS
The total number of received packets that were discarded because they
were of an unknown protocol.
-.It Sy MAC_STAT_NOXMTBUF
+.It Dv MAC_STAT_NOXMTBUF
The total number of outgoing packets dropped due to a lack of transmit
buffers.
-.It Sy MAC_STAT_OERRORS
+.It Dv MAC_STAT_OERRORS
The total number of outgoing packets that resulted in errors.
-.It Sy MAC_STAT_COLLISIONS
+.It Dv MAC_STAT_COLLISIONS
Total number of collisions encountered by the transmitter.
-.It Sy MAC_STAT_RBYTES
-The total number of
-.Sy bytes
-received by the device, regardless of packet type.
-.It Sy MAC_STAT_IPACKETS
-The total number of
-.Sy packets
-received by the device, regardless of packet type.
-.It Sy MAC_STAT_OBYTES
-The total number of
-.Sy bytes
-transmitted by the device, regardless of packet type.
-.It Sy MAC_STAT_OPACKETS
-The total number of
-.Sy packets
-sent by the device, regardless of packet type.
-.It Sy MAC_STAT_UNDERFLOWS
+.It Dv MAC_STAT_RBYTES
+The total number of bytes received by the device, regardless of packet
+type.
+.It Dv MAC_STAT_IPACKETS
+The total number of packets received by the device, regardless of packet type.
+.It Dv MAC_STAT_OBYTES
+The total number of bytes transmitted by the device, regardless of packet type.
+.It Dv MAC_STAT_OPACKETS
+The total number of packets sent by the device, regardless of packet type.
+.It Dv MAC_STAT_UNDERFLOWS
The total number of packets that were smaller than the minimum sized
packet for the device and were therefore dropped.
-.It Sy MAC_STAT_OVERFLOWS
+.It Dv MAC_STAT_OVERFLOWS
The total number of packets that were larger than the maximum sized
packet for the device and were therefore dropped.
.El
@@ -1407,203 +1601,203 @@ The following statistics are specific to Ethernet devices.
They refer to values from RFC 1643 and include various MII/GMII specific stats.
Many of these are also defined in IEEE 802.3.
.Bl -tag -width Ds
-.It Sy ETHER_STAT_ADV_CAP_1000FDX
+.It Dv ETHER_STAT_ADV_CAP_1000FDX
Indicates that the device is advertising support for 1 Gbit/s
full-duplex operation.
-.It Sy ETHER_STAT_ADV_CAP_1000HDX
+.It Dv ETHER_STAT_ADV_CAP_1000HDX
Indicates that the device is advertising support for 1 Gbit/s
half-duplex operation.
-.It Sy ETHER_STAT_ADV_CAP_100FDX
+.It Dv ETHER_STAT_ADV_CAP_100FDX
Indicates that the device is advertising support for 100 Mbit/s
full-duplex operation.
-.It Sy ETHER_STAT_ADV_CAP_100GFDX
+.It Dv ETHER_STAT_ADV_CAP_100GFDX
Indicates that the device is advertising support for 100 Gbit/s
full-duplex operation.
-.It Sy ETHER_STAT_ADV_CAP_100HDX
+.It Dv ETHER_STAT_ADV_CAP_100HDX
Indicates that the device is advertising support for 100 Mbit/s
half-duplex operation.
-.It Sy ETHER_STAT_ADV_CAP_100T4
+.It Dv ETHER_STAT_ADV_CAP_100T4
Indicates that the device is advertising support for 100 Mbit/s
100BASE-T4 operation.
-.It Sy ETHER_STAT_ADV_CAP_10FDX
+.It Dv ETHER_STAT_ADV_CAP_10FDX
Indicates that the device is advertising support for 10 Mbit/s
full-duplex operation.
-.It Sy ETHER_STAT_ADV_CAP_10GFDX
+.It Dv ETHER_STAT_ADV_CAP_10GFDX
Indicates that the device is advertising support for 10 Gbit/s
full-duplex operation.
-.It Sy ETHER_STAT_ADV_CAP_10HDX
+.It Dv ETHER_STAT_ADV_CAP_10HDX
Indicates that the device is advertising support for 10 Mbit/s
half-duplex operation.
-.It Sy ETHER_STAT_ADV_CAP_2500FDX
+.It Dv ETHER_STAT_ADV_CAP_2500FDX
Indicates that the device is advertising support for 2.5 Gbit/s
full-duplex operation.
-.It Sy ETHER_STAT_ADV_CAP_40GFDX
+.It Dv ETHER_STAT_ADV_CAP_40GFDX
Indicates that the device is advertising support for 40 Gbit/s
full-duplex operation.
-.It Sy ETHER_STAT_ADV_CAP_5000FDX
+.It Dv ETHER_STAT_ADV_CAP_5000FDX
Indicates that the device is advertising support for 5.0 Gbit/s
full-duplex operation.
-.It Sy ETHER_STAT_ADV_CAP_ASMPAUSE
+.It Dv ETHER_STAT_ADV_CAP_ASMPAUSE
Indicates that the device is advertising support for receiving pause
frames.
-.It Sy ETHER_STAT_ADV_CAP_AUTONEG
+.It Dv ETHER_STAT_ADV_CAP_AUTONEG
Indicates that the device is advertising support for auto-negotiation.
-.It Sy ETHER_STAT_ADV_CAP_PAUSE
+.It Dv ETHER_STAT_ADV_CAP_PAUSE
Indicates that the device is advertising support for generating pause
frames.
-.It Sy ETHER_STAT_ADV_REMFAULT
+.It Dv ETHER_STAT_ADV_REMFAULT
Indicates that the device is advertising support for detecting faults in
the remote link peer.
-.It Sy ETHER_STAT_ALIGN_ERRORS
+.It Dv ETHER_STAT_ALIGN_ERRORS
Indicates the number of times an alignment error was generated by the
Ethernet device.
This is a count of packets that were not an integral number of octets and failed
the FCS check.
-.It Sy ETHER_STAT_CAP_1000FDX
+.It Dv ETHER_STAT_CAP_1000FDX
Indicates the device supports 1 Gbit/s full-duplex operation.
-.It Sy ETHER_STAT_CAP_1000HDX
+.It Dv ETHER_STAT_CAP_1000HDX
Indicates the device supports 1 Gbit/s half-duplex operation.
-.It Sy ETHER_STAT_CAP_100FDX
+.It Dv ETHER_STAT_CAP_100FDX
Indicates the device supports 100 Mbit/s full-duplex operation.
-.It Sy ETHER_STAT_CAP_100GFDX
+.It Dv ETHER_STAT_CAP_100GFDX
Indicates the device supports 100 Gbit/s full-duplex operation.
-.It Sy ETHER_STAT_CAP_100HDX
+.It Dv ETHER_STAT_CAP_100HDX
Indicates the device supports 100 Mbit/s half-duplex operation.
-.It Sy ETHER_STAT_CAP_100T4
+.It Dv ETHER_STAT_CAP_100T4
Indicates the device supports 100 Mbit/s 100BASE-T4 operation.
-.It Sy ETHER_STAT_CAP_10FDX
+.It Dv ETHER_STAT_CAP_10FDX
Indicates the device supports 10 Mbit/s full-duplex operation.
-.It Sy ETHER_STAT_CAP_10GFDX
+.It Dv ETHER_STAT_CAP_10GFDX
Indicates the device supports 10 Gbit/s full-duplex operation.
-.It Sy ETHER_STAT_CAP_10HDX
+.It Dv ETHER_STAT_CAP_10HDX
Indicates the device supports 10 Mbit/s half-duplex operation.
-.It Sy ETHER_STAT_CAP_2500FDX
+.It Dv ETHER_STAT_CAP_2500FDX
Indicates the device supports 2.5 Gbit/s full-duplex operation.
-.It Sy ETHER_STAT_CAP_40GFDX
+.It Dv ETHER_STAT_CAP_40GFDX
Indicates the device supports 40 Gbit/s full-duplex operation.
-.It Sy ETHER_STAT_CAP_5000FDX
+.It Dv ETHER_STAT_CAP_5000FDX
Indicates the device supports 5.0 Gbit/s full-duplex operation.
-.It Sy ETHER_STAT_CAP_ASMPAUSE
+.It Dv ETHER_STAT_CAP_ASMPAUSE
Indicates that the device supports the ability to receive pause frames.
-.It Sy ETHER_STAT_CAP_AUTONEG
+.It Dv ETHER_STAT_CAP_AUTONEG
Indicates that the device supports the ability to perform link
auto-negotiation.
-.It Sy ETHER_STAT_CAP_PAUSE
+.It Dv ETHER_STAT_CAP_PAUSE
Indicates that the device supports the ability to transmit pause frames.
-.It Sy ETHER_STAT_CAP_REMFAULT
+.It Dv ETHER_STAT_CAP_REMFAULT
Indicates that the device supports the ability of detecting a remote
fault in a link peer.
-.It Sy ETHER_STAT_CARRIER_ERRORS
+.It Dv ETHER_STAT_CARRIER_ERRORS
Indicates the number of times that the Ethernet carrier sense condition
was lost or not asserted.
-.It Sy ETHER_STAT_DEFER_XMTS
+.It Dv ETHER_STAT_DEFER_XMTS
Indicates the number of frames for which the device was unable to
transmit the frame due to being busy and had to try again.
-.It Sy ETHER_STAT_EX_COLLISIONS
+.It Dv ETHER_STAT_EX_COLLISIONS
Indicates the number of frames that failed to send due to an excessive
number of collisions.
-.It Sy ETHER_STAT_FCS_ERRORS
+.It Dv ETHER_STAT_FCS_ERRORS
Indicates the number of times that a frame check sequence failed.
-.It Sy ETHER_STAT_FIRST_COLLISIONS
+.It Dv ETHER_STAT_FIRST_COLLISIONS
Indicates the number of times that a frame was eventually transmitted
successfully, but only after a single collision.
-.It Sy ETHER_STAT_JABBER_ERRORS
+.It Dv ETHER_STAT_JABBER_ERRORS
Indicates the number of frames that were received that were both larger
than the maximum packet size and failed the frame check sequence.
-.It Sy ETHER_STAT_LINK_ASMPAUSE
+.It Dv ETHER_STAT_LINK_ASMPAUSE
Indicates whether the link is currently configured to accept pause
frames.
-.It Sy ETHER_STAT_LINK_AUTONEG
+.It Dv ETHER_STAT_LINK_AUTONEG
Indicates whether the current link state is a result of
auto-negotiation.
-.It Sy ETHER_STAT_LINK_DUPLEX
+.It Dv ETHER_STAT_LINK_DUPLEX
Indicates the current duplex state of the link.
The values used here should be the same as documented for
-.Sy MAC_PROP_DUPLEX .
-.It Sy ETHER_STAT_LINK_PAUSE
+.Dv MAC_PROP_DUPLEX .
+.It Dv ETHER_STAT_LINK_PAUSE
Indicates whether the link is currently configured to generate pause
frames.
-.It Sy ETHER_STAT_LP_CAP_1000FDX
+.It Dv ETHER_STAT_LP_CAP_1000FDX
Indicates the remote device supports 1 Gbit/s full-duplex operation.
-.It Sy ETHER_STAT_LP_CAP_1000HDX
+.It Dv ETHER_STAT_LP_CAP_1000HDX
Indicates the remote device supports 1 Gbit/s half-duplex operation.
-.It Sy ETHER_STAT_LP_CAP_100FDX
+.It Dv ETHER_STAT_LP_CAP_100FDX
Indicates the remote device supports 100 Mbit/s full-duplex operation.
-.It Sy ETHER_STAT_LP_CAP_100GFDX
+.It Dv ETHER_STAT_LP_CAP_100GFDX
Indicates the remote device supports 100 Gbit/s full-duplex operation.
-.It Sy ETHER_STAT_LP_CAP_100HDX
+.It Dv ETHER_STAT_LP_CAP_100HDX
Indicates the remote device supports 100 Mbit/s half-duplex operation.
-.It Sy ETHER_STAT_LP_CAP_100T4
+.It Dv ETHER_STAT_LP_CAP_100T4
Indicates the remote device supports 100 Mbit/s 100BASE-T4 operation.
-.It Sy ETHER_STAT_LP_CAP_10FDX
+.It Dv ETHER_STAT_LP_CAP_10FDX
Indicates the remote device supports 10 Mbit/s full-duplex operation.
-.It Sy ETHER_STAT_LP_CAP_10GFDX
+.It Dv ETHER_STAT_LP_CAP_10GFDX
Indicates the remote device supports 10 Gbit/s full-duplex operation.
-.It Sy ETHER_STAT_LP_CAP_10HDX
+.It Dv ETHER_STAT_LP_CAP_10HDX
Indicates the remote device supports 10 Mbit/s half-duplex operation.
-.It Sy ETHER_STAT_LP_CAP_2500FDX
+.It Dv ETHER_STAT_LP_CAP_2500FDX
Indicates the remote device supports 2.5 Gbit/s full-duplex operation.
-.It Sy ETHER_STAT_LP_CAP_40GFDX
+.It Dv ETHER_STAT_LP_CAP_40GFDX
Indicates the remote device supports 40 Gbit/s full-duplex operation.
-.It Sy ETHER_STAT_LP_CAP_5000FDX
+.It Dv ETHER_STAT_LP_CAP_5000FDX
Indicates the remote device supports 5.0 Gbit/s full-duplex operation.
-.It Sy ETHER_STAT_LP_CAP_ASMPAUSE
+.It Dv ETHER_STAT_LP_CAP_ASMPAUSE
Indicates that the remote device supports the ability to receive pause
frames.
-.It Sy ETHER_STAT_LP_CAP_AUTONEG
+.It Dv ETHER_STAT_LP_CAP_AUTONEG
Indicates that the remote device supports the ability to perform link
auto-negotiation.
-.It Sy ETHER_STAT_LP_CAP_PAUSE
+.It Dv ETHER_STAT_LP_CAP_PAUSE
Indicates that the remote device supports the ability to transmit pause
frames.
-.It Sy ETHER_STAT_LP_CAP_REMFAULT
+.It Dv ETHER_STAT_LP_CAP_REMFAULT
Indicates that the remote device supports the ability of detecting a
remote fault in a link peer.
-.It Sy ETHER_STAT_MACRCV_ERRORS
+.It Dv ETHER_STAT_MACRCV_ERRORS
Indicates the number of times that the internal MAC layer encountered an
error when attempting to receive and process a frame.
-.It Sy ETHER_STAT_MACXMT_ERRORS
+.It Dv ETHER_STAT_MACXMT_ERRORS
Indicates the number of times that the internal MAC layer encountered an
error when attempting to process and transmit a frame.
-.It Sy ETHER_STAT_MULTI_COLLISIONS
+.It Dv ETHER_STAT_MULTI_COLLISIONS
Indicates the number of times that a frame was eventually transmitted
successfully, but only after more than one collision.
-.It Sy ETHER_STAT_SQE_ERRORS
+.It Dv ETHER_STAT_SQE_ERRORS
Indicates the number of times that an SQE error occurred.
The specific conditions for this error are documented in IEEE 802.3.
-.It Sy ETHER_STAT_TOOLONG_ERRORS
+.It Dv ETHER_STAT_TOOLONG_ERRORS
Indicates the number of frames that were received that were longer than
the maximum frame size supported by the device.
-.It Sy ETHER_STAT_TOOSHORT_ERRORS
+.It Dv ETHER_STAT_TOOSHORT_ERRORS
Indicates the number of frames that were received that were shorter than
the minimum frame size supported by the device.
-.It Sy ETHER_STAT_TX_LATE_COLLISIONS
+.It Dv ETHER_STAT_TX_LATE_COLLISIONS
Indicates the number of times a collision was detected late on the
device.
-.It Sy ETHER_STAT_XCVR_ADDR
+.It Dv ETHER_STAT_XCVR_ADDR
Indicates the address of the MII/GMII receiver address.
-.It Sy ETHER_STAT_XCVR_ID
+.It Dv ETHER_STAT_XCVR_ID
Indicates the id of the MII/GMII receiver address.
-.It Sy ETHER_STAT_XCVR_INUSE
+.It Dv ETHER_STAT_XCVR_INUSE
Indicates what kind of receiver is in use.
The following values may be used:
.Bl -tag -width Ds
-.It Sy XCVR_UNDEFINED
+.It Dv XCVR_UNDEFINED
The receiver type is undefined by the hardware.
-.It Sy XCVR_NONE
+.It Dv XCVR_NONE
There is no receiver in use by the hardware.
-.It Sy XCVR_10
+.It Dv XCVR_10
The receiver supports 10BASE-T operation.
-.It Sy XCVR_100T4
+.It Dv XCVR_100T4
The receiver supports 100BASE-T4 operation.
-.It Sy XCVR_100X
+.It Dv XCVR_100X
The receiver supports 100BASE-TX operation.
-.It Sy XCVR_100T2
+.It Dv XCVR_100T2
The receiver supports 100BASE-T2 operation.
-.It Sy XCVR_1000X
+.It Dv XCVR_1000X
The receiver supports 1000BASE-X operation.
This is used for all fiber receivers.
-.It Sy XCVR_1000T
+.It Dv XCVR_1000T
The receiver supports 1000BASE-T operation.
This is used for all copper receivers.
.El
@@ -1714,7 +1908,7 @@ While a device driver does not need to indicate that it is capable of all such
capabilities described in
.Xr ddi_fm_init 9F ,
we suggest that device drivers at least register the
-.Sy DDI_FM_EREPORT_CAPABLE
+.Dv DDI_FM_EREPORT_CAPABLE
so as to allow the driver to report issues that it detects.
.Pp
If the driver registers with the fault management framework during its
@@ -1815,7 +2009,7 @@ The device driver should indicate that the device's service was lost
with a call to
.Xr ddi_fm_service_impact 9F
using the symbol
-.Sy DDI_SERVICE_LOST .
+.Dv DDI_SERVICE_LOST .
.It
At this point the device driver should issue a device reset through some
device-specific means.
@@ -1828,14 +2022,14 @@ MAC address filters, and more.
Finally, when service has been restored, the device driver should call
.Xr ddi_fm_service_impact 9F
using the symbol
-.Sy DDI_SERVICE_RESTORED .
+.Dv DDI_SERVICE_RESTORED .
.El
.Pp
When a non-fatal error occurs, then the device driver should submit an
ereport and should optionally mark the device degraded using
.Xr ddi_fm_service_impact 9F
with the
-.Sy DDI_SERVICE_DEGRADED
+.Dv DDI_SERVICE_DEGRADED
value depending on the nature of the problem that has occurred.
.Pp
Device drivers should never make the decision to remove a device from
@@ -1876,11 +2070,11 @@ The networking stack manages framed data through the use of the
structure.
The mblk allows for a single message to be made up of individual blocks.
Each part is linked together through its
-.Sy b_cont
+.Fa b_cont
member.
However, it also allows for multiple messages to be chained together through the
use of the
-.Sy b_next
+.Fa b_next
member.
While the networking stack works with these structures, device drivers generally
work with DMA regions.
@@ -1903,7 +2097,7 @@ When receiving memory, it will allocate a mblk_t through the
routine, copy the memory across with
.Xr bcopy 9F ,
and then increment the mblk_t's
-.Sy w_ptr
+.Fa b_wptr
structure.
.Pp
If, when receiving, memory is not available for a new message block,
@@ -1986,6 +2180,9 @@ a given platform.
.Xr attach 9E ,
.Xr close 9E ,
.Xr detach 9E ,
+.Xr mac_capab_led 9E ,
+.Xr mac_capab_rings 9E ,
+.Xr mac_capab_transceiver 9E ,
.Xr mc_close 9E ,
.Xr mc_getcapab 9E ,
.Xr mc_getprop 9E ,
diff --git a/usr/src/man/man9e/mac_capab_rings.9e b/usr/src/man/man9e/mac_capab_rings.9e
new file mode 100644
index 0000000000..29d4521a6a
--- /dev/null
+++ b/usr/src/man/man9e/mac_capab_rings.9e
@@ -0,0 +1,475 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Computer Company
+.\"
+.Dd July 2, 2022
+.Dt MAC_CAPAB_RINGS 9E
+.Os
+.Sh NAME
+.Nm mac_capab_rings
+.Nd MAC ring capability
+.Sh SYNOPSIS
+.In sys/mac_provider.h
+.Vt typedef struct mac_capab_rings_s mac_capab_rings_t;
+.Sh INTERFACE LEVEL
+.Sy Uncommitted -
+This interface is still evolving.
+API and ABI stability is not guaranteed.
+.Sh DESCRIPTION
+The
+.Sy MAC_CAPAB_RINGS
+capability provides a means for device drivers to take advantage of
+the additional resources offered by hardware beyond the basic operations
+to transmit and receive.
+There are two primary concepts that this MAC capability relies on: rings
+and groups.
+.Pp
+The
+.Em ring
+is a abstract concept which must be mapped to some hardware construct by
+the driver.
+It typically takes the form of a DMA memory region which is divided
+into many smaller units, called descriptors or entries.
+Each entry in the ring describes a location in memory of a packet, which the
+hardware is to read from
+.Pq to transmit it
+or write to
+.Pq upon reception .
+Entries also typically contain metadata and attributes about the packet.
+These entries are typically arranged in a fixed-size circular buffer
+.Po hence the
+.Dq ring
+name
+.Pc
+which is shared between the operating system and the
+hardware via the DMA-backed memory.
+Most NICs, regardless of their support for this capability, use something
+resembling a descriptor ring under the hood.
+Some vendors may also refer to rings as
+.Em queues .
+The ring concept is intentionally general, so that more unusual underlying
+hardware constructs can also be used to implement it.
+.Pp
+A collection of one or more rings is called a
+.Em group .
+Each group usually has a collection of filters that can be associated
+with them.
+These filters are usually defined in terms of matching something like a
+MAC address, VLAN, or Ethertype, though more complex filters may exist
+in hardware.
+When a packet matches a filter, it will then be directed to the group
+and eventually delivered to one of the rings in the group.
+.Pp
+In the MAC framework, rings and groups are separated into categories
+based on their purpose: transmitting and receiving.
+While the MAC framework thinks of transmit and receive rings as
+different physical constructs, they may map to the same underlying
+resources in the hardware.
+The device driver may implement the
+.Dv MAC_CAPAB_RINGS
+capability for one of transmitting, receiving, or both.
+.Ss Mapping Hardware to Rings and Groups
+There are many different ways that hardware resources may map to this
+capability.
+Consider the following examples:
+.Bl -enum
+.It
+Hardware may support a feature commonly known as receive side scaling
+.Pq RSS .
+With RSS, the hardware has multiple rings and uses a hash function
+calculated over packet headers to choose which ring receives a
+particular packet.
+Rings are associated with different interrupts, allowing multiple rings
+to be processed in parallel.
+Supporting RSS in isolation would result in a device which has a single
+group, and multiple rings within that group.
+.It
+Some hardware may have a single ring, but still support multiple receive
+filters.
+This is commonly seen with some 1 GbE devices.
+While the hardware only has one ring, it has support for multiple
+independent MAC address filters, each of which can be programmed to
+receive traffic for a single MAC address.
+The driver should map this situation to a single group with a single
+ring.
+However, it would implement the ability to program several filters.
+While this may not seem useful at first, when virtual NICs are created
+on top of a physical NIC, the additional hardware filters will be used
+to avoid putting the device in promiscuous mode.
+.It
+Finally, some hardware has many rings, which can be placed in many
+different groups.
+Each group has its own filtering capabilities.
+For such hardware, the device driver would declare support for multiple
+groups, each of which has its own independent set of rings.
+.El
+.Pp
+When choosing hardware constructs to implement rings and groups, it is
+also important to consider interrupts.
+In order to support polling, each receive ring must be able to
+independently toggle whether that ring will generate an interrupt on
+packet reception, even when many rings share the same hardware level
+interrupt
+.Pq e.g. the same MSI or MSI-X interrupt number and handler .
+.Ss Filters
+The
+.Xr mac_group_info 9S
+structure is used to define several different kinds of filters that the
+group might implement.
+There are three different classes of filters that exist:
+.Bl -tag -width Ds
+.It Sy MAC Address
+A given frame matches a MAC Address filter if the receive address in
+the Ethernet Header matches the specified MAC address.
+.It Sy VLAN
+A given frame matches a VLAN filter if it both has an 802.1Q VLAN tag
+and that tag matches the VALN number specified in the filter.
+If the frame's outer ethertype is not 0x8100, then the filter will not
+match.
+.It Sy MAC Address and VLAN
+A given frame matches a MAC Address and VLAN filter if it matches both
+the specified MAC address and the specified VLAN.
+This is constructed as a logical AND of the previous two filters.
+If only one of the two matches, then the frame does not match this
+filter.
+.Pp
+Note: this filter type is still under development and has not been
+plumbed through our APIs yet.
+.El
+.Pp
+Devices may support many different filter types.
+If the hardware resources required for a combined filter type
+.Pq e.g. MAC Address and VLAN
+are similar to the resources required for each in isolation, drivers
+should prefer to implement just the combined type and should not
+implement the individual types.
+.Pp
+The MAC framework assumes that the following rules hold regarding
+filters:
+.Bl -enum
+.It
+When there are multiple filters of the same kind with different
+addresses, then the hardware will accept a frame if it matches
+.Em ANY
+of the specified filters.
+In other words, if there are two VLAN filters defined, one for VLAN 23
+and one for VLAN 42, then if a frame has either VLAN 23 or VLAN 42,
+it will be accepted for the group.
+.It
+If multiple different classes of filters are defined, then the hardware
+should only accept a frame if it passes
+.Em ALL
+of the filter classes.
+For example, if there is a MAC address filter and a separate VLAN
+filter, the hardware will only accept the frame if it passes both sets
+of filters.
+.It
+If there are multiple different classes of filters and there are
+multiple filters present in each class, then the driver will accept a
+packet as long as it matches
+.Em ALL
+filter classes.
+However, within a given filter class, it may match
+.Em ANY
+of the filters.
+See the following boolean logic as an alternative way to phrase this
+case:
+.Bd -literal -offset indent
+match = MAC && VLAN
+MAC = 00:11:22:33:44:55 OR 00:66:77:88:99:aa OR ...
+VLAN = 11 OR 12 OR ...
+.Ed
+.El
+.Pp
+The following psuedocode summarizes the behavior for a device that
+supports independent MAC and VLAN filters.
+If the hardware only supports a single family of filters, then simply
+treat that in the psuedocode as though it is always true:
+.Bd -literal -offset indent
+for each packet p:
+ for each MAC filter m:
+ if m matches p's mac:
+ for each VLAN filter v:
+ if v matches p's vlan:
+ accept p for group
+ proceed to next packet
+ reject packet p
+ proceed to next packet
+.Ed
+.Pp
+The following psuedocode summarizes the behavior for a device that
+supports a combined MAC address and VLAN filter:
+.Bd -literal -offset indent
+for each packet p:
+ for each filter f:
+ if f.mac matches p's mac and f.vlan matches p's vlan:
+ accept p for group
+ proceed to next packet
+ reject packet p
+ proceed to next packet
+.Ed
+.Ss MAC Capability Structure
+When the device driver's
+.Xr mc_getcapab 9E
+function entry point is called with the capability requested set to
+.Dv MAC_CAPAB_RINGS ,
+then the value of the capability structure is a pointer to a
+.Vt mac_capab_rings_t
+structure with the following members:
+.Bd -literal -offset indent
+mac_ring_type_t mr_type;
+mac_groupt_type_t mr_group_type;
+uint_t mr_rnum;
+uint_t mr_gnum;
+mac_get_ring_t mr_rget;
+mac_get_group_t mr_gget;
+.Ed
+.Pp
+If the driver supports the
+.Dv MAC_CAPAB_RINGS
+capability, then it should first check the
+.Fa mr_type
+member of the structure.
+This member has the following possible values:
+.Bl -tag -width Dv
+.It Dv MAC_RING_TYPE_RX
+Indicates that this group is for receive rings.
+.It Dv MAC_RING_TYPE_TX
+Indicates that this group is for transmit rings.
+.El
+.Pp
+The driver will be asked to fill in this capability structure separately
+for receive and transmit groups and rings.
+This allows a driver to have different entry points for each type.
+If neither of these values is specified, then the device driver must
+return
+.Dv B_FALSE
+from its
+.Xr mc_getcapab 9E
+entry point.
+Once it has identified the type, it should fill in the capability
+structure based on the following rules:
+.Bl -tag -width Fa
+.It Fa mr_type
+The
+.Fa mr_type
+member is used to indicate whether this group is for transmit or receive
+rings.
+The
+.Fa mr_type
+member should not be modified by the device driver.
+It is set by the MAC framework when the driver's
+.Xr mc_getcapab 9E
+entry point is called.
+As indicated above, the driver must check the value to determine which
+group this
+.Xr mc_getcapab 9E
+call is referring to.
+.It Fa mr_group_type
+This member is used to indicate the group type.
+This should be set to
+.Dv MAC_GROUP_TYPE_STATIC ,
+which indicates that the assignment of rings to groups is fixed, and
+each ring can only ever belong to one specific group.
+The number of rings per group may vary on the group and can be set by
+the driver.
+.It Fa mr_rnum
+This indicates the total number of rings that are available.
+The number exposed may be less than the number supported in hardware.
+This is often due to receiving fewer resources such as interrupts.
+.It Fa mr_gnum
+This indicates the total number of groups that are available from
+hardware.
+The number exposed may be less than the number supported in hardware.
+This is often due to receiving fewer resources such as interrupts.
+.Pp
+When working with transmit rings, this value may be zero.
+In this case, each ring is treated independently and separate groups for
+each transmit ring are not required.
+.It Fa mr_rget
+This member is a function pointer that will be called to provide
+information about a ring inside of a specific group.
+See
+.Xr mr_rget 9E
+for information on the function, its signature, and responsibilities.
+.It Fa mr_gget
+This member is a function pointer that will be called to provide
+information about a group.
+See
+.Xr mr_gget 9E
+for information on the function, its signature, and responsibilities.
+.El
+.Sh DRIVER IMPLICATIONS
+.Ss MAC Callback Entry Points
+When a driver implements the
+.Dv MAC_CAPAB_RINGS
+capability, then it must not implement some of the traditional MAC
+callbacks.
+If the driver supports
+.Dv MAC_CAPAB_RINGS
+for receiving, then it must not implement the
+.Xr mc_unicst 9E
+entry point.
+This is instead handled through the filters that were described earlier.
+The filter entry points are defined as part of the
+.Xr mac_group_info 9S
+structure.
+.Pp
+If the driver supports
+.Dv MAC_CAPAB_RINGS
+for transmitting, then it should not implement the
+.Xr mc_tx 9E
+entry point, it will not be used.
+The MAC framework will instead use the
+.Xr mri_tx 9E
+entry point that is provided by the driver in the
+.Xr mac_ring_info 9S
+structure.
+.Ss Locking and Concurrency
+One of the main points of the
+.Dv MAC_CAPAB_RINGS
+capability is to increase the parallelism and concurrency that is
+actively going on in the driver.
+This means that a driver may be asked to transmit, poll, or receiver
+interrupts on all of its rings in parallel.
+This usually calls for fine-grained locking in a driver's own data
+structures to ensure that the various rings can be populated and used
+without having to block on one another.
+In general, most drivers have their own independent set of locks for
+each transmit and receive ring.
+They also usually have separate locks for each group.
+.Pp
+Just because one driver performs locking in one way, does not mean that
+one has to mimic it.
+The design of a driver and its locking is often tightly coupled to how
+the underlying hardware works and its complexity.
+.Ss Polling on rings
+When the
+.Dv MAC_CAPAB_RINGS
+capability is implemented, then additional functionality for receiving
+becomes available.
+A receive ring has the ability to be polled.
+When the operating system desires to begin polling the ring, it will
+make a function call into the driver, asking it to receive packets from
+this ring.
+When receiving packets while polling, the process is generally identical
+to that described in the
+.Sy Receiving Data
+section of
+.Xr mac 9E .
+For more details, see
+.Xr mri_poll 9E .
+.Pp
+When the MAC framework wants to enable polling, it will first turn off
+interrupts through the
+.Xr mi_disable 9E
+entry point on the driver.
+The driver must ensure that there is proper serialization between the
+interrupt enablement, interrupt disablement, the interrupt handler for
+that ring, and the
+.Xr mri_poll 9E
+entry point.
+For more information on the locking requirements related to polling, see
+the discussions in
+.Xr mri_poll 9E
+and
+.Xr mi_disable 9E .
+.Ss Updated callback functions
+When using rings, two of the primary functions that were used change.
+First, the
+.Xr mac_rx 9F
+function should be replaced with the
+.Xr mac_ring_rx 9F
+function.
+Secondly,
+the
+.Xr mac_tx_update 9F
+function should be replaced with the
+.Xr mac_tx_ring_update 9F
+function.
+.Ss Interrupt and Ring Mapping
+Drivers often vary the number of rings that they expose based on the
+number of interrupts that exist.
+When a driver only supports a single group, there is often no reason to
+have more rings than interrupts.
+However, most hardware supports a means of having multiple rings tie to
+the same interrupt.
+Drivers then tie the rings in different groups to the same interrupts
+and therefore when an interrupt is triggered, iterate over all of the
+rings.
+.Pp
+Tying multiple rings together into a single interrupt should only be done
+if hardware has the ability to control whether or not each ring
+contributes to the interrupt.
+For the
+.Xr mi_disable 9E
+entry point to work, each ring must be able to independently control
+whether or not receipt of a packet generates the shared interrupt.
+.Ss Filter Management
+As part of general operation, the device driver will be asked to add
+various filters to groups.
+The MAC framework does not keep track of the assigned filters in such a
+way that after a device reset that they'll be given to the driver again.
+Therefore, it is recommended that the driver keep track of all filters
+it has assigned such that they can be reinstated after a driver or
+system initiated device reset of some kind.
+There is no need to persist anything across a call to
+.Xr detach 9E
+or similar.
+.Pp
+For more information, see the
+.Sy TX STALL DETECTION, DEVICE RESETS, AND FAULT MANAGEMENT
+section of
+.Xr mac 9E .
+.Ss Broadcast, Multicast, and Promiscuous Mode
+Rings and groups are currently designed to emphasize and enhance the
+receipt of filtered, unicast frames.
+This means that special handling is required when working with broadcast
+traffic, multicast traffic, and enabling promiscuous mode.
+This only applies to receive groups and rings.
+.Pp
+By default, only the first group with index zero, sometimes called the
+default group, should ever be
+programmed to receive broadcast traffic.
+This group should always be programmed to receive broadcast traffic, the
+same way that the broader device is programmed to always receive
+broadcast traffic when the
+.Dv MAC_CAPAB_RINGS
+capability has not been negotiated.
+.Pp
+When multicast addresses are assigned to the device through the
+.Xr mc_multicst 9E
+entry point, those should also be assigned to the first group.
+.Pp
+Similarly, when enabling promiscuous mode, the driver should only enable
+promiscuous traffic to be received by the first group.
+.Pp
+No other groups or rings should ever receive broadcast, multicast, or
+promiscuous mode traffic.
+.Sh SEE ALSO
+.Xr mac 9E ,
+.Xr mc_getcapab 9E ,
+.Xr mc_multicst 9E ,
+.Xr mc_tx 9E ,
+.Xr mc_unicst 9E ,
+.Xr mi_disable 9E ,
+.Xr mr_gaddring 9E ,
+.Xr mr_gget 9E ,
+.Xr mr_gremring 9E ,
+.Xr mr_rget 9E ,
+.Xr mri_poll 9E ,
+.Xr mac_ring_rx 9F ,
+.Xr mac_rx 9F ,
+.Xr mac_tx_ring_update 9F ,
+.Xr mac_tx_update 9F ,
+.Xr mac_group_info 9S
diff --git a/usr/src/man/man9e/mac_filter.9e b/usr/src/man/man9e/mac_filter.9e
new file mode 100644
index 0000000000..bd4283efe0
--- /dev/null
+++ b/usr/src/man/man9e/mac_filter.9e
@@ -0,0 +1,172 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Computer Company
+.\"
+.Dd July 2, 2022
+.Dt MAC_FILTER 9E
+.Os
+.Sh NAME
+.Nm mac_filter ,
+.Nm mgi_addmac ,
+.Nm mgi_remmac ,
+.Nm mgi_addvlan ,
+.Nm mgi_remvlan
+.Nd add and remove filters from MAC groups
+.Sh SYNOPSIS
+.In sys/mac_provider.h
+.Ft int
+.Fo prefix_ring_add_mac
+.Fa "mac_group_driver_t driver"
+.Fa "const uint8_t *mac"
+.Fc
+.Ft int
+.Fo prefix_ring_rem_mac
+.Fa "mac_group_driver_t driver"
+.Fa "const uint8_t *mac"
+.Fc
+.Ft int
+.Fo prefix_ring_add_vlan
+.Fa "mac_group_driver_t driver"
+.Fa "uint16_t vlan"
+.Fc
+.Ft int
+.Fo prefix_ring_rem_vlan
+.Fa "mac_group_driver_t driver"
+.Fa "uint16_t vlan"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Uncommitted -
+This interface is still evolving.
+API and ABI stability is not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa driver
+A pointer to the ring's private data that was passed in via the
+.Vt mgi_driver
+member of the
+.Xr mac_group_info 9S
+structure as part of the
+.Xr mr_gget 9E
+entry point.
+.It Fa mac
+A pointer to an array of bytes that contains the unicast address to add
+or remove from a filter.
+It is guaranteed to be at least as long, in bytes, as the MAC plugin's
+address length.
+For Ethernet devices that length is six bytes,
+.Dv ETHERADDRL .
+.It Fa vlan
+The numeric value of the VLAN that should be added or removed from a
+filter.
+.El
+.Sh DESCRIPTION
+The
+.Fn mac_filter
+family of entry points are used to add and remove various classes of
+filters from a device.
+For more information on the filters, see the
+.Sy Filters
+section of
+.Xr mac_capab_rings 9S
+and the discussion around setting these members in
+.Xr mac_group_info 9S .
+.Pp
+The
+.Fa driver
+argument indicates which group the request to add or remove a filter is
+being requested on.
+.Pp
+The filter addition operations,
+.Fn mgi_addmac ,
+.Fn mgi_addvlan ,
+and
+.Fn mgi_addmvf ,
+all instruct the system to add a filter to the specified group.
+The filter should not target any specific ring in the group.
+If multiple rings are present, then the driver should ensure that the
+hardware balances incoming traffic amongst all of the rings through a
+consistent hashing mechanism such as receive side scaling.
+.Pp
+The
+.Fn mgi_addmac
+entry point instructs the driver to add the MAC address specified in
+.Fa mac
+to the filter list for the group.
+The MAC address should always be a unicast MAC address; however, the
+driver is encouraged to verify that before adding it.
+.Pp
+The
+.Fn mgi_remmac
+should remove the MAC address specified in
+.Fa mac
+from the filter list for the group.
+.Pp
+The
+.Fn mgi_addvlan
+entry point instructs the driver to add the VLAN specified in
+.Fa vlan
+to the filter list for the group.
+The
+.Fn mgi_remvlan
+entry point instructs the driver to remove the VLAN specified in
+.Fa vlan
+from the filter list for the group.
+.Ss Stacking Filters
+Multiple filters of the same class should always be treated as a
+logical-OR.
+The frame may match any of the filters in a given class to be accepted.
+Filters of different classes should always be treated as a logical-AND.
+The frame must match a filter in all programmed classes to be accepted.
+For more information, see the
+.Sy Filters
+section of
+.Xr mac_capab_rings 9S .
+.Sh RETURN VALUES
+Upon successful completion, the driver should ensure that the filter has
+been added or removed and return
+.Sy 0 .
+Otherwise, it should return the appropriate error number.
+.Sh ERRORS
+The device driver may return one of the following errors.
+While this list is not intended to be exhaustive, it is recommended to use one
+of these if possible.
+.Bl -tag -width Er
+.It Er EEXIST
+The requested filter has already been programmed into the device.
+.It Er EINVAL
+The address
+.Fa mac
+is not a valid unicast address.
+The VLAN
+.Fa vlan
+is not a valid VLAN identifier.
+.It Er EIO
+The driver encountered a device or transport error while trying to
+update the device's state.
+.It Er ENOENT
+The driver was asked to remove a filter which was not currently
+programmed.
+.It Er ENOTSUP
+The driver does not support this specific function.
+This should only be used on specific hardware
+.Pq generally devices from cloud providers
+where neither promiscuous mode nor filters will allow
+the filter to operate.
+.It Er ENOSPC
+The driver has run out of available hardware filters.
+.El
+.Sh SEE ALSO
+.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
+.Xr mr_gget 9E ,
+.Xr mac_group_info 9S
diff --git a/usr/src/man/man9e/mc_tx.9e b/usr/src/man/man9e/mc_tx.9e
index 48efd44661..dc214ba104 100644
--- a/usr/src/man/man9e/mc_tx.9e
+++ b/usr/src/man/man9e/mc_tx.9e
@@ -9,13 +9,15 @@
.\" http://www.illumos.org/license/CDDL.
.\"
.\"
-.\" Copyright 2016 Joyent, Inc.
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Computer Company
.\"
-.Dd Nov 26, 2017
+.Dd July 2, 2022
.Dt MC_TX 9E
.Os
.Sh NAME
-.Nm mc_tx
+.Nm mc_tx ,
+.Nm mri_tx
.Nd transmit a message block chain
.Sh SYNOPSIS
.In sys/mac_provider.h
@@ -24,24 +26,45 @@
.Fa "void *driver"
.Fa "mblk_t *mp_chain"
.Fc
+.Ft "mblk_t *"
+.Fo prefix_ring_tx
+.Fa "void *driver_rh"
+.Fa "mblk_t *mp_chain"
+.Fc
.Sh INTERFACE LEVEL
illumos DDI specific
+.Pp
+The
+.Fn mri_tx
+entry point is
+.Sy Uncommitted -
+API and ABI stability is not guaranteed.
.Sh PARAMETERS
.Bl -tag -width Fa
.It Fa driver
A pointer to the driver's private data that was passed in via the
-.Sy m_pdata
+.Fa m_pdata
member of the
.Xr mac_register 9S
structure to the
.Xr mac_register 9F
function.
+.It Fa driver_rh
+A pointer to the driver's private data for the ring that was passed in
+via the
+.Fa mri_driver
+member of the
+.Xr mac_ring_info 9S
+structure.
+This is initialized by the driver when its
+.Xr mr_rget 9E
+is called by MAC.
.It Fa mp_chain
A series of
.Xr mblk 9S
structures that may have multiple independent packets linked together on
their
-.Sy b_next
+.Fa b_next
member.
.El
.Sh DESCRIPTION
@@ -56,10 +79,10 @@ argument represents the first frame.
The frame may be spread out across one or more
.Xr mblk 9S
structures that are linked together by the
-.Sy b_cont
+.Fa b_cont
member.
There may be multiple frames, linked together by the
-.Sy b_next
+.Fa b_next
pointer of the
.Xr mblk 9S .
.Pp
@@ -73,9 +96,9 @@ section of
.Pp
As it processes each frame in the chain, if the device driver has
advertised either of the
-.Sy MAC_CAPAB_HCKSUM
+.Dv MAC_CAPAB_HCKSUM
or
-.Sy MAC_CAPAB_LSO
+.Dv MAC_CAPAB_LSO
flags, it must check whether either apply for the given frame using the
.Xr mac_hcksum_get 9F
and
@@ -99,8 +122,8 @@ Return the frames to indicate that resources are not available.
.Pp
The device driver is in charge of the memory associated with
.Fa mp_chain .
-If the device driver does not return the message blocks to the GLDv3,
-then it must call
+If the device driver does not return the message blocks to the MAC
+framework, then it must call
.Xr freemsg 9F
on the frames.
If it does not, the memory associated with them will be leaked.
@@ -133,9 +156,9 @@ Once a device driver has returned unprocessed frames from its
entry point, then the device driver will not receive any additional
calls to its
.Fn mc_tx
-entry point until it calls
+entry point until it calls the
.Xr mac_tx_update 9F
-to indicate that resources are available again.
+function to indicate that resources are available again.
Note that because it is the device driver that is calling this function to
indicate resources are available, it is very important that it only return
frames in cases where the device driver itself will be notified that resources
@@ -153,6 +176,32 @@ related data structures.
Note that the device driver should expect that it may have its transmit
endpoints called into from other threads while it's servicing device interrupts
related to them.
+.Pp
+The
+.Fn mri_tx
+entry point is similar to the
+.Fn mc_tx
+entry point, except that it is used by device drivers that have
+negotiated the
+.Dv MAC_CAPAB_RINGS
+capability with transmit rings.
+The driver should follow all of the same rules described earlier, except
+that it will access a ring-specific data structure through
+.Fa driver_rh
+and when it needs to update that there is additional space available, it
+must use
+.Xr mac_tx_update_ring 9F
+and not
+.Xr mac_tx_update 9F .
+.Pp
+When the
+.Fn mri_tx
+entry point is called, the ring that should be used has been specified.
+The driver must not attempt to use any other ring than the one specified
+by
+.Fa driver_rh
+for any reason, including a lack of resources or an attempt to perform
+its own hashing.
.Sh CONTEXT
The
.Fn mc_tx
@@ -165,14 +214,21 @@ context.
Upon successful completion, the device driver should return
.Dv NULL .
Otherwise, it should return all unprocessed message blocks and ensure
-that it calls
+that it calls either
.Xr mac_tx_update 9F
+or
+.Xr mac_tx_ring_update 9F
some time in the future.
.Sh SEE ALSO
.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
+.Xr mr_rget 9E ,
.Xr freemsg 9F ,
+.Xr mac_hcksum_get 9F ,
.Xr mac_lso_get 9F ,
.Xr mac_register 9F ,
+.Xr mac_tx_ring_update 9F ,
.Xr mac_tx_update 9F ,
.Xr mac_register 9S ,
+.Xr mac_ring_info 9S ,
.Xr mblk 9S
diff --git a/usr/src/man/man9e/mc_unicst.9e b/usr/src/man/man9e/mc_unicst.9e
index 9886dc22af..193a542423 100644
--- a/usr/src/man/man9e/mc_unicst.9e
+++ b/usr/src/man/man9e/mc_unicst.9e
@@ -9,9 +9,10 @@
.\" http://www.illumos.org/license/CDDL.
.\"
.\"
-.\" Copyright 2016 Joyent, Inc.
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Computer Company
.\"
-.Dd May 31, 2016
+.Dd July 2, 2022
.Dt MC_UNICST 9E
.Os
.Sh NAME
@@ -30,7 +31,7 @@ illumos DDI specific
.Bl -tag -width Fa
.It Fa driver
A pointer to the driver's private data that was passed in via the
-.Sy m_pdata
+.Fa m_pdata
member of the
.Xr mac_register 9S
structure to the
@@ -42,12 +43,12 @@ the device.
It is guaranteed to be at least a number of bytes long equal to the length of
the MAC plugin's address length.
For Ethernet devices that length is six bytes,
-.Sy ETHERADDRL .
+.Dv ETHERADDRL .
.El
.Sh DESCRIPTION
The
.Fn mc_unicst
-entry point is used by the GLDv3 to indicate that the device driver
+entry point is used by the MAC framework to indicate that the device driver
should update the primary MAC address of the device.
In the basic mode of operation, this entry point is required and the device has
a single primary MAC address.
@@ -56,8 +57,14 @@ promiscuous mode.
This call should overwrite the existing MAC address that is programmed into the
device.
.Pp
+Device drivers that implement the
+.Dv MAC_CAPAB_RINGS
+capability
+.Em must not
+implement this interface.
+.Pp
As noted in the
-.Sx PARAMETERS
+.Sy PARAMETERS
section, the
.Fa mac
array is guaranteed to be at least as many bytes as is required to
@@ -83,8 +90,13 @@ The
entry point only supports a single MAC address.
In this case, devices should only use a single MAC address and replace that MAC
address.
-Support for using more than a single MAC address filter will be provided
-by future interfaces.
+To enable the operating system to take advantage of multiple unicast MAC
+address filters, the driver should implement the
+.Dv MAC_CAPAB_RINGS
+capability.
+See
+.Xr mac_capab_rings 9E
+for more information.
.Sh RETURN VALUES
Upon successful completion, the device driver should have updated its
unicast filter and return
@@ -106,5 +118,6 @@ update the device's state.
.El
.Sh SEE ALSO
.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
.Xr mac_register 9F ,
.Xr mac_register 9S
diff --git a/usr/src/man/man9e/mgi_start.9e b/usr/src/man/man9e/mgi_start.9e
new file mode 100644
index 0000000000..adae22a3bf
--- /dev/null
+++ b/usr/src/man/man9e/mgi_start.9e
@@ -0,0 +1,152 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide computer Company
+.\"
+.Dd July 2, 2022
+.Dt MGI_START 9E
+.Os
+.Sh NAME
+.Nm mgi_start ,
+.Nm mgi_stop ,
+.Nm mri_start ,
+.Nm mri_stop
+.Nd MAC group and ring start and stop entry points
+.Sh SYNOPSIS
+.In sys/mac_provider.h
+.Ft int
+.Fo prefix_group_start
+.Fa "mac_group_driver_t gh"
+.Fc
+.Ft void
+.Fo prefix_group_stop
+.Fa "mac_group_driver_t gh"
+.Fc
+.Ft int
+.Fo prefix_ring_start
+.Fa "mac_ring_driver_t rh"
+.Fa "uint64_t mr_gen"
+.Fc
+.Ft void
+.Fo prefix_ring_stop
+.Fa "mac_ring_driver_t rh"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Uncommitted -
+This interface is still evolving.
+API and ABI stability is not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa driver
+A pointer to the ring's private data that was passed in via the
+.Vt mgi_driver
+member of the
+.Xr mac_group_info 9S
+structure as part of the
+.Xr mr_gget 9E
+entry point.
+.It Fa rh
+A pointer to the ring's private data that was passed in via the
+.Vt mri_driver
+member of the
+.Xr mac_ring_info 9S
+structure as part of the
+.Xr mr_rget 9E
+entry point.
+.It Fa mr_gen
+A 64-bit generation number.
+.El
+.Sh DESCRIPTION
+The
+.Fn mgi_start ,
+.Fn mgi_stop ,
+.Fn mri_start ,
+and
+.Fn mri_stop
+entry points are used to start and stop MAC rings and groups.
+The group entry points are optional, while the ring entry points are
+required.
+The group start entry point will be called before any rings and
+similarly, the ring stop entry point will be called for all rings before
+the group stop entry point.
+In the group case, the group is identified by
+.Fa gh ,
+while the ring entry points use
+.Fa rh
+to identify the specific ring.
+These are opaque pointers to data that was set in the
+.Xr mac_group_info 9S
+and
+.Xr mac_ring_info 9S
+structures during the
+.Xr mr_gget 9E
+and
+.Xr mr_rget 9E
+entry points respectively.
+.Pp
+These entry points give the driver a chance to take action prior to
+actually transmitting or receiving any data.
+The amount of work that is required will vary based on the driver and
+its design.
+At a minimum, during the
+.Fn mri_start
+entry point, a driver is required to save the value of
+.Fa mr_gen
+for later use, in particular when calling
+.Xr mac_rx_ring 9E .
+This is used by the system to discriminate between generations of the
+device's configuration and its operation.
+The operating system will check that all received packets are called
+with the value of
+.Fa mr_gen
+that it expects.
+If they do not match, then they received packets will be dropped.
+.Pp
+In general, it is recommended that descriptor rings are allocated during
+the driver's initial
+.Xr attach 9E .
+In contrast, allocating and freeing the actual memory associated with
+the descriptor entries during ring start and stop can be a reasonable
+way to try and reduce memory overhead of the driver.
+For example, a receive ring generally needs to allocate one DMA buffer
+for each entry in its receive ring that covers the maximum frame size
+that the device can receive.
+This is something that could be deferred to the
+.Fn mri_start
+entry point and then freed in the
+.Fn mri_stop
+entry point.
+.Pp
+It's worth noting that the
+.Fn mrg_stop
+and
+.Fn mrg_stop
+entry points purposefully return
+.Ft void .
+In particular, this means that the driver must be careful about doing
+things which might fail, such as asynchronous communication to a device.
+If that is necessary and such communication fails, the device should be
+marked as faulted and attempt to recover via a reset or similar
+mechanism in another context.
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn mgi_start
+and
+.Fn mri_start
+entry points should return
+.Sy 0 .
+Otherwise, they should return the appropriate error number.
+.Sh SEE ALSO
+.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
+.Xr mr_gget 9E ,
+.Xr mac_group_info 9S
diff --git a/usr/src/man/man9e/mi_enable.9e b/usr/src/man/man9e/mi_enable.9e
new file mode 100644
index 0000000000..c5958db42d
--- /dev/null
+++ b/usr/src/man/man9e/mi_enable.9e
@@ -0,0 +1,107 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Computer Company
+.\"
+.Dd July 2, 2022
+.Dt MI_ENABLE 9E
+.Os
+.Sh NAME
+.Nm mi_enable ,
+.Nm mi_disable
+.Nd MAC interrupt enable and disable entry points
+.Sh SYNOPSIS
+.In sys/mac_provider.h
+.Ft int
+.Fo prefix_intr_enable
+.Fa "mac_intr_handle_t driver"
+.Fc
+.Ft int
+.Fo prefix_intr_disable
+.Fa "mac_intr_handle_t driver"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Uncommitted -
+This interface is still evolving.
+API and ABI stability is not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa driver
+A pointer to the mac interrupt's private data that was passed in via the
+.Vt mi_handle
+member of the
+.Xr mac_intr 9S
+structure.
+.El
+.Sh DESCRIPTION
+The
+.Fn mi_enable
+and
+.Fn mi_disable
+entry points are used by the MAC framework when it wishes to disable the
+generation of interrupts for the ring and poll on the it through the
+.Xr mri_poll 9E
+entry point.
+.Pp
+These entry points should enable and disable the generation of the
+interrupt for the ring that is represented by
+.Fa driver .
+The
+.Fa driver
+argument corresponds to what the driver set in the
+.Fa mri_intr
+member while filling out the
+.Xr mac_ring_info 9S
+structure and generally is used to point to a specific ring.
+.Pp
+Importantly, this entry point is not asking to enable and disable the
+underlying device-level interrupt such as a PCIe MSI or MSI-X, which may
+be being used by multiple rings.
+Drivers must not implement this in terms of the DDI interrupt functions
+such as
+.Xr ddi_intr_enable 9F
+and
+.Xr ddi_intr_disable 9F .
+.Pp
+Instead this should be implemented through device specific means such as
+writing to registers or sending control messages to enable or disable
+the generation of interrupts for the specified ring.
+.Pp
+When manipulating the device's control of interrupts, the driver should
+be careful to serialize these changes with the ongoing processing of
+interrupts through the interrupt handler and the
+.Xr mri_poll 9E
+entry point.
+These should all be protected by the same mutex which is scoped to the
+ring itself when the ability to turn on and off interrupt generation may
+be manipulated on a per-ring basis.
+Failure to properly synchronize this may lead to the driver mistakenly
+delivering the same packet twice through both its interrupt handler and
+its
+.Xr mri_poll 9E
+entry point.
+.Sh RETURN VALUES
+Upon successful completion, the
+.Fn mi_enable
+and
+.Fn mi_disable
+entry points should return
+.Sy 0 .
+Otherwise the appropriate error number should be returned.
+.Sh SEE ALSO
+.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
+.Xr mri_poll 9E ,
+.Xr ddi_intr_disable 9F ,
+.Xr ddi_intr_enable 9F ,
+.Xr mac_intr 9S ,
+.Xr mac_ring_info 9S
diff --git a/usr/src/man/man9e/mr_gget.9e b/usr/src/man/man9e/mr_gget.9e
new file mode 100644
index 0000000000..991c518c97
--- /dev/null
+++ b/usr/src/man/man9e/mr_gget.9e
@@ -0,0 +1,132 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Computer Company
+.\"
+.Dd July 2, 2022
+.Dt MR_GGET 9E
+.Os
+.Sh NAME
+.Nm mr_gget
+.Nd fill MAC group information
+.Sh SYNOPSIS
+.In sys/mac_provider.h
+.Ft void
+.Fo prefix_fill_group_info
+.Fa "void *driver"
+.Fa "mac_ring_type_t rtype"
+.Fa "const int group_index"
+.Fa "mac_group_info_t *infop"
+.Fa "mac_group_handle_t gh"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Uncommitted -
+This interface is still evolving.
+API and ABI stability is not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa driver
+A pointer to the driver's private data that was passed in via the
+.Fa m_pdata
+member of the
+.Xr mac_register 9S
+structure to the
+.Xr mac_register 9F
+function.
+.It Fa rtype
+A value indicating the type of ring that makes up the groups.
+Valid values include:
+.Bl -tag -width Dv
+.It Dv MAC_RING_TYPE_RX
+The group is intended for use with receive rings.
+.It Dv MAC_RING_TYPE_TX
+The group is intended for use with transmit rings.
+.El
+.It Fa group_index
+An integer value that uniquely identifying the group.
+Groups are numbered starting from zero.
+.It Fa infop
+A pointer to an instance of a
+.Xr mac_group_info 9S
+structure.
+.It Fa gh
+An opaque pointer to a group handle that can be used to identify this
+group.
+.El
+.Sh DESCRIPTION
+The
+.Fn mr_gget
+entry point provides a means for the device driver to fill in
+information about a group.
+The driver returns information about the group to the MAC framework via
+the
+.Fa infop
+argument.
+For the list of fields and an explanation of how to fill them in, please
+see
+.Xr mac_group_info 9S .
+.Pp
+The
+.Fa rtype
+argument describes whether this is a group of receive rings or a group
+of transmit rings.
+This is identified by the value in
+.Fa rtype
+which will be
+.Dv MAC_RING_TYPE_RX
+for a receive group
+and
+.Dv MAC_RING_TYPE_TX
+for a transmit group.
+It is recommended that a driver doule check that the
+.Fa rtype
+matches what it expects if it uses separate entry points for receive and
+transmit groups.
+The group information that is filled in varies between transmit and
+receive groups.
+If separate entry points were not specified in the
+.Xr mac_capab_rings 9E
+structure, then the driver must ensure that it checks this value and
+acts appropriately.
+.Pp
+The
+.Fa group_index
+argument is used to uniquely identify a group.
+Groups are numbered starting at zero and end at one less then the number
+of groups specified in
+.Fa mr_gnum
+member of the
+.Vt mac_capbab_rings_t
+structure which is described in
+.Xr mac_capab_rings 9E .
+Group IDs can be represented as the mathematical range [0, mr_gnum).
+.Pp
+After filling in the group information in
+.Fa infop ,
+the driver should make sure to store the group handle
+.Fa gh
+for future use, mapping it to the index
+.Fa group_index .
+.Sh CONTEXT
+The
+.Fn mr_gget
+entry point will be called in response to a driver calling the
+.Xr mac_register 9F
+function and the driver has acknowledged that it supports the
+.Dv MAC_CAPAB_RINGS
+capability.
+.Sh SEE ALSO
+.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
+.Xr mac_register 9F ,
+.Xr mac_group_info 9S ,
+.Xr mac_register 9S
diff --git a/usr/src/man/man9e/mr_rget.9e b/usr/src/man/man9e/mr_rget.9e
new file mode 100644
index 0000000000..31a79edba8
--- /dev/null
+++ b/usr/src/man/man9e/mr_rget.9e
@@ -0,0 +1,151 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Compuer Company
+.\"
+.Dd July 2, 2022
+.Dt MR_RGET 9E
+.Os
+.Sh NAME
+.Nm mr_rget
+.Nd fill in ring information
+.Sh SYNOPSIS
+.In sys/mac_provider.h
+.Ft void
+.Fo prefix_fill_ring_info
+.Fa "void *driver"
+.Fa "mac_ring_type_t rtype"
+.Fa "const int group_index"
+.Fa "const int ring_index"
+.Fa "mac_ring_info_t *infop"
+.Fa "mac_ring_handle_t rh"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Uncommitted -
+This interface is still evolving.
+API and ABI stability is not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa driver
+A pointer to the driver's private data that was passed in via the
+.Fa m_pdata
+member of the
+.Xr mac_register 9S
+structure to the
+.Xr mac_register 9F
+function.
+.It Fa group_index
+An integer value indicating the group that this ring belongs to.
+Groups are numbered starting from zero.
+.It Fa rtype
+A value indicating the type of ring.
+Valid values include:
+.Bl -tag -width Dv
+.It Dv MAC_RING_TYPE_RX
+The ring is a receive ring.
+.It Dv MAC_RING_TYPE_TX
+The ring is a transmit ring.
+.El
+.It Fa ring_index
+An integer indicating the index of the ring inside of the group.
+Ring indexes are numbered starting from zero.
+Each group has its own set of ring indexes.
+.It Fa infop
+A pointer to an instance of a
+.Xr mac_ring_info 9S
+structure.
+.It Fa rh
+An opaque pointer to a ring handle that can be used to identify this
+ring.
+.El
+.Sh DESCRIPTION
+The
+.Fn mr_rget
+entry point provides a means for the device driver to fill in
+information about a ring.
+The driver must fill in information into the
+.Fa infop
+argument.
+For the list of fields and an explanation of how to fill them in, please
+see
+.Xr mac_ring_info 9S .
+.Pp
+The
+.Fa rtype
+argument describes whether this is a receive ring or transmit ring
+identified by a value of
+.Dv MAC_RING_TYPE_RX
+or
+.Dv MAC_RING_TYPE_TX
+respectively.
+The ring information that is filled in varies between transmit and
+receive rings.
+If separate entry points were not specified in the
+.Xr mac_capab_rings 9E
+structure, then the driver
+must ensure that it checks this value.
+.Pp
+The
+.Fa group_index
+and
+.Fa ring_index
+arguments are used to uniquely identify a ring.
+The number of groups that a driver supports is based on the values
+present in the
+.Fa mr_gnum
+member of the
+.Vt mac_capbab_rings_t
+structure which is described in
+.Xr mac_capab_rings 9E .
+The group index ranges from zero to the specified number of groups minus
+one.
+The number of rings in the group is determined based on the values
+specified in
+.Xr mac_group_info 9S
+structure that is filled in during the
+.Xr mr_gget 9E
+entry point.
+The ring numbering for each group is independent and always starts at
+zero.
+Based on the combination of group and ring index, the driver should be
+able to map that to a unique ring.
+.Pp
+After filling out the ring structure in
+.Fa infop ,
+the driver should make sure to store the ring handle in
+.Fa rh
+for future use.
+This is required for callbacks such as
+.Xr mac_rx_ring 9F
+or
+.Xr mac_tx_ring_update 9F .
+.Sh CONTEXT
+The
+.Fn mr_rget
+entry point will be called in response to a driver calling the
+.Xr mac_register 9F
+function and the driver has acknowledged that it supports the
+.Dv MAC_CAPAB_RINGS
+capability.
+This will be called after a call to the driver's
+.Xr mr_gget 9E
+entry point.
+.Sh SEE ALSO
+.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
+.Xr mr_gget 9E ,
+.Xr mac_register 9F ,
+.Xr mac_rx_ring 9F ,
+.Xr mac_tx_ring_update 9F ,
+.Xr mac_group_info 9S ,
+.Xr mac_register 9S ,
+.Xr mac_ring_info 9S
diff --git a/usr/src/man/man9e/mri_poll.9e b/usr/src/man/man9e/mri_poll.9e
new file mode 100644
index 0000000000..779ecae3b6
--- /dev/null
+++ b/usr/src/man/man9e/mri_poll.9e
@@ -0,0 +1,117 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Computer Company
+.\"
+.Dd July 2, 2022
+.Dt MRI_POLL 9E
+.Os
+.Sh NAME
+.Nm mri_poll
+.Nd Poll a ring for received network data
+.Sh SYNOPSIS
+.In sys/mac_provider.h
+.Ft mblk_t *
+.Fo prefix_ring_poll
+.Fa "void *driver"
+.Fa "int poll_bytes"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Uncommitted -
+This interface is still evolving.
+API and ABI stability is not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa driver
+A pointer to the ring's private data that was passed in via the
+.Fa mri_driver
+member of the
+.Xr mac_ring_info 9S
+structure as part of the
+.Xr mr_rget 9E
+entry point.
+.It Fa poll_bytes
+The maximum number of bytes that the driver should poll in a given call.
+.El
+.Sh DESCRIPTION
+The
+.Fn mri_poll
+entry point is called by the MAC framework when it wishes to have the
+driver check the ring specified by
+.Fa driver
+for available data.
+.Pp
+The device driver should perform the same logic that it would when it's
+procesing an interrupt and as described in the
+.Sx Receiving Data
+section of
+.Xr mac 9E .
+The main difference is that instead of calling
+.Xr mac_ring_rx 9E ,
+it should instead return that data as a
+.Vt mblk_t
+chain.
+Also, while an interrupt may map to more than one ring in some drivers,
+the driver should only process the ring indicated by
+.Fa driver .
+The MAC framework can be polling some rings that are receiving a lot of
+traffic while still relying on interrupts for others.
+.Pp
+Drivers should exercise caution with the locking between the polling,
+interrupt disabling routines, and the interrupt handler.
+This mutex is generally scoped to a receive ring and is used to
+synchronize the act of transitioning between polling and handling
+interrupts.
+That means that in addition to the
+.Fn mri_poll
+entry point, the
+.Xr mi_enable 9E
+and
+.Xr mi_disable 9E
+entry points should synchronize on the same mutex when transitioning the
+device.
+This is the same mutex that would be used when processing this ring
+during an interrupt handler, though that mutex should only be used while
+processing a specific ring and not held for the duration of the entire
+interrupt handler.
+.Pp
+The driver should limit the number of frames it collects based on the
+size value present in the
+.Fa poll_bytes
+argument.
+The driver should sum up the total size of each processed frame and
+compare that running total to
+.Fa poll_bytes .
+If there are fewer frames than,
+.Fa poll_bytes ,
+the driver should not wait and can instead return right away.
+Similarly, if the driver has iterated around its entire descriptor ring
+and still does not have enough enough, it is OK to return early.
+Importantly, the framework is
+.Em not
+asking the driver to block until it has
+.Fa poll_bytes
+available .
+.Sh RETURN VALUES
+Upon successful completion, the device driver should return a message
+block chain of collected frames.
+If no frames are available or it encountered an error while procesing
+data, then it should return
+.Dv NULL .
+.Sh SEE ALSO
+.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
+.Xr mac_ring_rx 9E ,
+.Xr mi_disable 9E ,
+.Xr mi_enable 9E ,
+.Xr mr_rget 9E ,
+.Xr mac_ring_info 9S
diff --git a/usr/src/man/man9e/mri_stat.9e b/usr/src/man/man9e/mri_stat.9e
new file mode 100644
index 0000000000..cfd4b3595b
--- /dev/null
+++ b/usr/src/man/man9e/mri_stat.9e
@@ -0,0 +1,165 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Computer Company
+.\"
+.Dd July 2, 2022
+.Dt MRI_STAT 9E
+.Os
+.Sh NAME
+.Nm mri_stat
+.Nd xtatistics collection entry point for rings
+.Sh SYNOPSIS
+.In sys/mac_provider.h
+.Ft int
+.Fo prefix_ring_stat
+.Fa "mac_ring_driver_t rh"
+.Fa "uint_t stat"
+.Fa "uint64_t *val"
+.Fc
+.Sh INTERFACE LEVEL
+.Sy Uncommitted -
+This interface is still evolving.
+API and ABI stability is not guaranteed.
+.Sh PARAMETERS
+.Bl -tag -width Fa
+.It Fa rh
+A pointer to the ring's private data that was passed in via the
+.Vt mri_driver
+member of the
+.Xr mac_ring_info 9S
+structure as part of the
+.Xr mr_rget 9E
+entry point.
+.It Fa stat
+The numeric identifier of a statistic.
+.It Fa val
+A pointer to a 64-bit unsigned value into which the device driver should
+place statistic.
+.El
+.Sh DESCRIPTION
+The
+.Fn mri_stat
+entry point is called by the MAC framework to get statistics that have
+been scoped to the ring, indicated by
+.Fa rh .
+.Pp
+The set of statistics that the driver should check depends on the kind
+of ring that is in use.
+If the driver encounters an unknown statistic it should return
+.Er ENOTSUP .
+All the statistics should be values that are scoped to the ring itself.
+This is in contrast to the normal
+.Xr mc_getstat 9E
+entry point, which has statistics for the entire device.
+Other than the scoping, the statistics listed below have the same
+meaning as they do in the
+.Sx STATISTICS
+section of
+.Xr mac 9E .
+See
+.Xr mac 9E
+for more details of those statistics.
+.Pp
+Receive rings should support the following statistics:
+.Bl -bullet
+.It
+.Dv MAC_STAT_IPACKETS
+.It
+.Dv MAC_STAT_RBYTES
+.El
+.Pp
+Transmit rings should support the following statitics:
+.Bl -bullet
+.It
+.Dv MAC_STAT_OBYTES
+.It
+.Dv MAC_STAT_OPACKETS
+.El
+.Sh EXAMPLES
+The following example shows how a driver might structure its
+.Fn mri_stat
+entry point.
+.Bd -literal
+#include <sys/mac_provider.h>
+
+/*
+ * Note, this example merely shows the structure of the function. For
+ * the purpose of this example, we assume that we have a per-ring
+ * structure which has members that indicate its stats and that it has a
+ * lock which is used to serialize access to this data.
+ */
+
+static int
+example_tx_ring_stat(mac_ring_driver_t rh, uint_t stat, uint64_t *val)
+{
+ example_tx_ring_t *etrp = arg;
+
+ mutex_enter(&etrp->etrp_lock);
+ switch (stat) {
+ case MAC_STAT_OBYTES:
+ *val = etrp->etrp_stats.eps_obytes;
+ break;
+ case MAC_STAT_OPACKETS:
+ *val = etrp->etrp_stats.eps_opackets;
+ break;
+ default:
+ mutex_exit(&etrp->etrp_lock);
+ return (ENOTSUP);
+ }
+ mutex_exit(&etrp->etrp_lock);
+
+ return (0);
+}
+
+static int
+example_rx_ring_stat(mac_ring_driver_t rh, uint_t stat, uint64_t *val)
+{
+ example_rx_ring_t *errp = arg;
+
+ mutex_enter(&errp->errp_lock);
+ switch (stat) {
+ case MAC_STAT_RBYTES:
+ *val = errp->errp_stats.eps_ibytes;
+ break;
+ case MAC_STAT_IPACKETS:
+ *val = errp->errp_stats.eps_ipackets;
+ break;
+ default:
+ mutex_exit(&errp->errp_lock);
+ return (ENOTSUP);
+ }
+ mutex_exit(&errp->errp_lock);
+
+ return (0);
+}
+.Ed
+.Sh ERRORS
+The device driver may return one of the following errors.
+While this list is not intended to be exhaustive, it is recommend to use
+one of these if possible.
+.Bl -tag -width Er
+.It Er ENOTSUP
+The specified statistic is unknown, unsupported, or unimplemented.
+.It Er EIO
+A transport or DMA FM related error occurred while trying to sync data
+from the device.
+.It Er ECANCELLED
+The device is not currently in a state where it can currently service
+the request.
+.El
+.Sh SEE ALSO
+.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
+.Xr mc_getstat 9E ,
+.Xr mr_rget 9E ,
+.Xr mac_ring_info 9S
diff --git a/usr/src/man/man9f/Makefile b/usr/src/man/man9f/Makefile
index f928da60fe..bcefcfe990 100644
--- a/usr/src/man/man9f/Makefile
+++ b/usr/src/man/man9f/Makefile
@@ -986,8 +986,10 @@ MANLINKS= AVL_NEXT.9f \
mac_prop_info_set_default_uint8.9f \
mac_prop_info_set_perm.9f \
mac_prop_info_set_range_uint32.9f \
+ mac_ring_rx.9f \
mac_transceiver_info_set_present.9f \
mac_transceiver_info_set_usable.9f \
+ mac_tx_ring_update.9f \
mac_unregister.9f \
makecom_g0.9f \
makecom_g0_s.9f \
@@ -1806,9 +1808,13 @@ mac_prop_info_set_default_uint64.9f := LINKSRC = mac_prop_info.9f
mac_prop_info_set_perm.9f := LINKSRC = mac_prop_info.9f
mac_prop_info_set_range_uint32.9f := LINKSRC = mac_prop_info.9f
+mac_ring_rx.9f := LINKSRC = mac_rx.9f
+
mac_transceiver_info_set_present.9f := LINKSRC = mac_transceiver_info.9f
mac_transceiver_info_set_usable.9f := LINKSRC = mac_transceiver_info.9f
+mac_tx_ring_update.9f := LINKSRC = mac_tx_update.9f
+
mac_unregister.9f := LINKSRC = mac_register.9f
makecom_g0.9f := LINKSRC = makecom.9f
diff --git a/usr/src/man/man9f/mac_rx.9f b/usr/src/man/man9f/mac_rx.9f
index 19067c1838..efd7b2c0b9 100644
--- a/usr/src/man/man9f/mac_rx.9f
+++ b/usr/src/man/man9f/mac_rx.9f
@@ -9,13 +9,15 @@
.\" http://www.illumos.org/license/CDDL.
.\"
.\"
-.\" Copyright 2016 Joyent, Inc.
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Compuer Company
.\"
-.Dd June 02, 2016
+.Dd July 2, 2022
.Dt MAC_RX 9F
.Os
.Sh NAME
-.Nm mac_rx
+.Nm mac_rx ,
+.Nm mac_ring_rx
.Nd deliver frames from a driver to the system
.Sh SYNOPSIS
.In sys/mac_provider.h
@@ -25,8 +27,21 @@
.Fa "mac_resource_handle_t mrh"
.Fa "mblk_t *mp_chain"
.Fc
+.Ft void
+.Fo mac_rx_ring
+.Fa "mac_handle_t mh"
+.Fa "mac_ring_handle_t mring"
+.Fa "mblk_t *mp_chain"
+.Fa "uint64_t mr_gen"
+.Fc
.Sh INTERFACE LEVEL
illumos DDI specific
+.Pp
+The
+.Fn mac_rx_ring
+function point is
+.Sy Uncommitted -
+API and ABI stability is not guaranteed.
.Sh PARAMETERS
.Bl -tag -width Fa
.It Fa mh
@@ -35,12 +50,21 @@ The MAC handle obtained from a call to
.It Fa mrh
A reserved parameter that should be passed as
.Dv NULL .
+.It Fa mring
+A pointer to the ring handle that was passed to the driver in the
+.Xr mr_rget 9E
+entry point.
.It Fa mp_chain
A series of one or more
.Xr mblk 9S
structures chained together by their
.Sy b_next
member.
+.It Fa mr_gen
+The generation number for the current ring.
+The generation comes from the
+.Xr mri_start 9E
+entry point.
.El
.Sh DESCRIPTION
The
@@ -66,7 +90,48 @@ Device drivers should not call the
.Fn mac_rx
function after each individual mblk_t is assembled.
Rather, the device driver should batch up as many frames as it is willing to
-process in a given interrupt or otherwise.
+process in a given interrupt or are available.
+.Pp
+The
+.Fn mac_rx_ring
+function is similar to the
+.Fa mac_rx
+function; however, it should be called by device drivers that have
+negotiated the
+.Dv MAC_CAPAB_RINGS
+capability and indicated that it supports receive groups.
+Device drivers that have negotiated this capability must not call the
+.Fn mac_rx
+function, but use the
+.Fn mac_rx_ring
+function instead.
+The driver should pass the ring handle in
+.Fa mring
+for the ring in question that it processed.
+If more than one ring was processed during an interrupt, then the driver
+must call
+.Fn mac_ring_rx
+once for each ring and ensure that the
+.Fa mr_gen
+argument matches what was passed to the driver during the
+.Xr mri_start 9E
+entry point for each ring.
+If the value of
+.Fa mr_gen
+does not match what the operating system expects, all of the packets
+will be dropped.
+This is used to make sure that the system is receiving what it considers
+valid data from the device driver.
+.Pp
+When a driver supporting the
+.Dv MAC_CAPAB_RINGS
+capability is asked to poll via their
+.Xr mri_poll 9E
+entry point, then the driver should not call the
+.Fn mac_ring_rx
+function to deliver packets and instead returns them during the
+.Xr mri_poll 9E
+call.
.Sh CONTEXT
The
.Fn mac_rx
@@ -78,5 +143,9 @@ or
context.
.Sh SEE ALSO
.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
+.Xr mr_rget 9E ,
+.Xr mri_poll 9E ,
+.Xr mri_start 9E ,
.Xr mac_register 9F ,
.Xr mblk 9S
diff --git a/usr/src/man/man9f/mac_tx_update.9f b/usr/src/man/man9f/mac_tx_update.9f
index 95e1a79271..36badcb688 100644
--- a/usr/src/man/man9f/mac_tx_update.9f
+++ b/usr/src/man/man9f/mac_tx_update.9f
@@ -9,13 +9,15 @@
.\" http://www.illumos.org/license/CDDL.
.\"
.\"
-.\" Copyright 2016 Joyent, Inc.
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Computer Company
.\"
-.Dd June 02, 2016
+.Dd July 2, 2022
.Dt MAC_TX_UPDATE 9F
.Os
.Sh NAME
-.Nm mac_tx_update
+.Nm mac_tx_update ,
+.Nm mac_tx_ring_update
.Nd indicate that a device can transmit again
.Sh SYNOPSIS
.In sys/mac_provider.h
@@ -23,13 +25,28 @@
.Fo mac_tx_update
.Fa "mac_handle_t mh"
.Fc
+.Ft void
+.Fo mac_tx_ring_update
+.Fa "mac_handle_t mh"
+.Fa "mac_ring_handle_t mrh"
+.Fc
.Sh INTERFACE LEVEL
illumos DDI specific
+.Pp
+The
+.Fn mac_tx_ring_update
+function point is
+.Sy Uncommitted -
+API and ABI stability is not guaranteed.
.Sh PARAMETERS
.Bl -tag -width Fa
.It Fa mh
The MAC handle obtained from a call to
.Xr mac_register 9F .
+.It Fa mrh
+The MAC ring handle obtained when the driver's ring entry point
+.Xr mr_rget 9E
+was called.
.El
.Sh DESCRIPTION
The
@@ -55,6 +72,28 @@ See the
section of
.Xr mac 9E
for more information.
+.Pp
+When a driver has negotiated the
+.Dv MAC_CAPAB_RINGS
+capability and indicated that it supports transmit groups, it must not
+use the
+.Fn mac_tx_update
+function and should instead call the
+.Fn mac_tx_ring_update
+function targeting a specific ring instead.
+The ring that is being updated is specified by the ring handle passed in
+the
+.Fa mrh
+argument.
+The ring should have previously returned frames from its
+.Xr mri_tx 9E
+entry point to indicate that it was blocked.
+.Pp
+In all other respects, the
+.Fn mac_tx_ring_update
+function is similar to the
+.Fn mac_tx_update
+function.
.Sh CONTEXT
The
.Fn mac_tx_update
@@ -66,5 +105,8 @@ or
context.
.Sh SEE ALSO
.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
.Xr mc_tx 9E ,
+.Xr mr_rget 9E ,
+.Xr mri_tx 9E ,
.Xr mac_register 9F
diff --git a/usr/src/man/man9s/Makefile b/usr/src/man/man9s/Makefile
index d70a69691b..9cb917a5ff 100644
--- a/usr/src/man/man9s/Makefile
+++ b/usr/src/man/man9s/Makefile
@@ -50,7 +50,10 @@ MANFILES= Intro.9s \
kstat_named.9s \
linkblk.9s \
mac_callbacks.9s \
+ mac_group_info.9s \
+ mac_intr.9s \
mac_register.9s \
+ mac_ring_info.9s \
modldrv.9s \
modlinkage.9s \
modlmisc.9s \
@@ -102,7 +105,10 @@ MANFILES= Intro.9s \
MANLINKS= dblk.9s \
intro.9s \
mac_callbacks_t.9s \
+ mac_group_info_t.9s \
+ mac_intr_t.9s \
mac_register_t.9s \
+ mac_ring_info_t.9s \
mblk.9s \
usb_ep_ss_comp_descr_t.9s \
usb_ep_xdescr_t.9s \
@@ -125,7 +131,10 @@ intro.9s := LINKSRC = Intro.9s
dblk.9s := LINKSRC = datab.9s
mac_callbacks_t.9s := LINKSRC = mac_callbacks.9s
+mac_group_info_t.9s := LINKSRC = mac_group_info.9s
+mac_intr_t.9s := LINKSRC = mac_intr.9s
mac_register_t.9s := LINKSRC = mac_register.9s
+mac_ring_info_t.9s := LINKSRC = mac_ring_info.9s
mblk.9s := LINKSRC = msgb.9s
diff --git a/usr/src/man/man9s/mac_callbacks.9s b/usr/src/man/man9s/mac_callbacks.9s
index ba2d27f309..9dd4c4e547 100644
--- a/usr/src/man/man9s/mac_callbacks.9s
+++ b/usr/src/man/man9s/mac_callbacks.9s
@@ -9,9 +9,10 @@
.\" http://www.illumos.org/license/CDDL.
.\"
.\"
-.\" Copyright 2016 Joyent, Inc.
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Computer Company
.\"
-.Dd May 12, 2016
+.Dd July 2, 2022
.Dt MAC_CALLBACKS 9S
.Os
.Sh NAME
@@ -25,20 +26,21 @@ illumos DDI specific
.Sh DESCRIPTION
The
.Sy mac_callbacks
-structure is used by GLDv3 networking device drivers implementing the
+structure is used by GLDv3 networking device drivers implementing and
+using the
.Xr mac 9E
-interface.
+framework and interfaces.
.Pp
The structure is normally allocated statically by drivers as a single
global entry.
A pointer to it is passed as the
-.Sy m_callbacks
+.Fa m_callbacks
member of the
-.Sy mac_register_t
+.Vt mac_register_t
structure.
.Sh TYPES
The following types define the function pointers in use in the
-.Sy mac_register_t .
+.Vt mac_register_t .
.Bd -literal -offset indent
typedef int (*mac_getstat_t)(void *, uint_t, uint64_t *);
typedef int (*mac_start_t)(void *);
@@ -80,59 +82,59 @@ mac_prop_info_t mc_propinfo; /* Get property information */
.Ed
.Pp
The
-.Sy mc_callbacks
+.Fa mc_callbacks
member is used to denote which of a series of optional callbacks are
present.
This method allows additional members to be added to the
-.Sy mac_callbacks_t
+.Vt mac_callbacks_t
structure while maintaining ABI compatibility with existing modules.
If a member is not mentioned below, then it is a part of the base version
of the structure and device drivers do not need to set anything to
indicate that it is present.
The
-.Sy mc_callbacks
+.Fa mc_callbacks
member should be set to the bitwise inclusive OR of the following
pre-processor values:
.Bl -tag -width Dv -offset indent
-.It Sy MC_IOCTL
+.It Dv MC_IOCTL
Indicates that the
-.Sy mc_ioctl
+.Fa mc_ioctl
structure member has been set.
-.It Sy MC_GETCAPAB
+.It Dv MC_GETCAPAB
Indicates that the
-.Sy mc_getcapab
+.Fa mc_getcapab
structure member has been set.
-.It Sy MC_OPEN
+.It Dv MC_OPEN
Indicates that the
-.Sy mc_open
+.Fa mc_open
structure member has been set.
-.It Sy MC_CLOSE
+.It Dv MC_CLOSE
Indicates that the
-.Sy mc_close
+.Fa mc_close
structure member has been set.
-.It Sy MC_SETPROP
+.It Dv MC_SETPROP
Indicates that the
-.Sy mc_setprop
+.Fa mc_setprop
structure member has been set.
-.It Sy MC_GETPROP
+.It Dv MC_GETPROP
Indicates that the
-.Sy mc_getprop
+.Fa mc_getprop
structure member has been set.
-.It Sy MC_PROPINFO
+.It Dv MC_PROPINFO
Indicates that the
-.Sy mc_propinfo
+.Fa mc_propinfo
structure member has been set.
-.It Sy MC_PROPERTIES
+.It Dv MC_PROPERTIES
Indicates that the
-.Sy mc_getprop ,
-.Sy mc_propinfo ,
+.Fa mc_getprop ,
+.Fa mc_propinfo ,
and
-.Sy mc_setprop
+.Fa mc_setprop
structure members have been set.
.El
.Pp
The
-.Sy mc_getstat
+.Fa mc_getstat
function defines an entry point used to receive statistics about the
device.
A list of statistics that it is required to support is available in
@@ -141,76 +143,76 @@ For more information on the requirements of the function, see
.Xr mc_getstat 9E .
.Pp
The
-.Sy mc_start
+.Fa mc_start
member defines an entry point that is used to start the device.
For more information on the requirements of the function, see
.Xr mc_start 9E .
.Pp
The
-.Sy mc_stop
+.Fa mc_stop
member defines an entry point that is used to stop the device.
It is the opposite of the
-.Sy mc_start
+.Fa mc_start
member.
For more information on the requirements of the function, see
.Xr mc_stop 9E .
.Pp
The
-.Sy mc_setpromisc
+.Fa mc_setpromisc
member is used to enable and disable promiscuous mode on the device.
For more information on the requirements of the function, see
.Xr mc_setpromisc 9E .
.Pp
The
-.Sy mc_multicst
+.Fa mc_multicst
member is used to enable or disable multicast addresses in the device's
filters.
For more information on the requirements of the function, see
.Xr mc_multicst 9E .
.Pp
The
-.Sy mc_unicst
+.Fa mc_unicst
member is used to set the primary unicast MAC address of the device.
For more information on the requirements of the function, see
.Xr mc_unicst 9E .
.Pp
The
-.Sy mc_tx
+.Fa mc_tx
member is used to transmit a single message on the wire.
For more information on the requirements of the function, see
.Xr mc_tx 9E .
.Pp
The
-.Sy mc_ioctl
+.Fa mc_ioctl
member is used to process device specific ioctls.
-The GLDv3 does not define any ioctls that devices should handle; however, there
-may be private ioctls for this device.
+The MAC framework does not define any ioctls that devices should handle;
+however, there may be private ioctls for this device.
This entry point is optional.
For it to be considered, the
-.Sy MC_IOCTL
+.Dv MC_IOCTL
value must be present in the
-.Sy mc_callbacks
+.Fa mc_callbacks
member.
For more information on the requirements of the function, see
.Xr mc_ioctl 9E .
.Pp
The
-.Sy mc_getcapab
+.Fa mc_getcapab
member is used to determine device capabilities.
Each capability has its own data and semantics associated with it.
A list of capabilities is provided in
.Xr mac 9E .
This entry point is optional.
For it to be used, the
-.Sy MC_GETCAPAB
+.Dv MC_GETCAPAB
value must be present in the
-.Sy mc_callbacks
+.Fa mc_callbacks
member.
For more information on the requirements of the function, see
.Xr mc_getcapab 9E .
.Pp
The
-.Sy mc_open
+.Fa mc_open
member is used to provide specific actions to take when the device is
opened.
Note that most device drivers will not have a need to implement this.
@@ -219,15 +221,15 @@ used with
.Xr dlpi 4P .
This entry point is optional.
For it to be used, the
-.Sy MC_OPEN
+.Dv MC_OPEN
value must be present in the
-.Sy mc_callbacks
+.Fa mc_callbacks
member.
For more information on the requirements of the function, see
.Xr mc_open 9E .
.Pp
The
-.Sy mc_close
+.Fa mc_close
member is used to provide specific actions to take when the device is
closed.
Note that most device drivers will not have a need to implement this.
@@ -236,52 +238,52 @@ used with
.Xr dlpi 4P .
This entry point is optional.
For it to be used, the
-.Sy MC_CLOSE
+.Dv MC_CLOSE
value must be present in the
-.Sy mc_callbacks
+.Fa mc_callbacks
member.
For more information on the requirements of the function, see
.Xr mc_close 9E .
.Pp
The
-.Sy mc_getprop
+.Fa mc_getprop
member is used to get the current value of a property from the device.
A list of properties, their sizes, and their interpretation is available in
.Xr mac 9E .
This entry point is optional.
For it to be used, the
-.Sy MC_GETPROP
+.Dv MC_GETPROP
value must be present in the
-.Sy mc_callbacks
+.Fa mc_callbacks
member.
For more information on the requirements of the function, see
.Xr mc_getprop 9E .
.Pp
The
-.Sy mc_setprop
+.Fa mc_setprop
member is used to set the value of a device property.
A list of properties, their sizes, and their interpretation is available in
.Xr mac 9E .
This entry point is optional.
For it to be used, the
-.Sy MC_SETPROP
+.Dv MC_SETPROP
value must be present in the
-.Sy mc_callbacks
+.Fa mc_callbacks
member.
For more information on the requirements of the function, see
.Xr mc_setprop 9E .
.Pp
The
-.Sy mc_propinfo
+.Fa mc_propinfo
member is used to obtain metadata about a property such as its default
value, whether or not it is writable, and more.
A list of properties, their sizes, and their interpretation is available in
.Xr mac 9E .
This entry point is optional.
For it to be used, the
-.Sy MC_PROPINFO
+.Dv MC_PROPINFO
value must be present in the
-.Sy mc_callbacks
+.Fa mc_callbacks
member.
For more information on the requirements of the function, see
.Xr mc_propinfo 9E .
@@ -292,34 +294,39 @@ members must be set or a call to
will fail.
.Bl -bullet -offset indent
.It
-.Sy mc_getstat
+.Fa mc_getstat
.It
-.Sy mc_start
+.Fa mc_start
.It
-.Sy mc_stop
+.Fa mc_stop
.It
-.Sy mc_setpromisc
+.Fa mc_setpromisc
.It
-.Sy mc_multicst
+.Fa mc_multicst
.It
-.Sy mc_tx
+.Fa mc_tx
.It
-.Sy mc_unicst
+.Fa mc_unicst
.El
.Pp
-Note, that devices which implement the GLDv3 ring capabilities must not
-implement the
-.Sy mc_unicst
-and
-.Sy mc_tx
-functions.
-However, the ring capabilities are still private and evolving at this time.
+Devices which implement the
+.Dv MAC_CAPAB_RINGS
+capability for receive rings must not implement the
+.Fa mc_unicst
+entry point.
+Devices which implement the
+.Dv MAC_CAPAB_RINGS
+capability for transmit rings must not implement the
+.Fa mc_tx
+entry points.
+For more information about the capability, please see
+.Xr mac_capab_rings 9E .
.Pp
Generally, a device that implements one of
-.Sy mc_getprop ,
-.Sy mc_setprop ,
+.Fa mc_getprop ,
+.Fa mc_setprop ,
or
-.Sy mc_propinfo
+.Fa mc_propinfo
will want to implement all three endpoints to ensure that the property
is fully integrated into user land utilities such as
.Xr dladm 8 .
@@ -327,6 +334,7 @@ is fully integrated into user land utilities such as
.Xr dlpi 4P ,
.Xr dladm 8 ,
.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
.Xr mc_close 9E ,
.Xr mc_getcapab 9E ,
.Xr mc_getprop 9E ,
@@ -341,4 +349,5 @@ is fully integrated into user land utilities such as
.Xr mc_stop 9E ,
.Xr mc_tx 9E ,
.Xr mc_unicst 9E ,
+.Xr mac_register 9F ,
.Xr mac_register 9S
diff --git a/usr/src/man/man9s/mac_group_info.9s b/usr/src/man/man9s/mac_group_info.9s
new file mode 100644
index 0000000000..85c2f37aee
--- /dev/null
+++ b/usr/src/man/man9s/mac_group_info.9s
@@ -0,0 +1,182 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Computer Company
+.\"
+.Dd July 2, 2022
+.Dt MAC_GROUP_INFO 9S
+.Os
+.Sh NAME
+.Nm mac_group_info ,
+.Nm mac_group_info_t
+.Nd MAC group information structure
+.Sh SYNOPSIS
+.In sys/mac_provider.h
+.Sh INTERFACE LEVEL
+.Sy Uncommitted -
+This interface is still evolving.
+API and ABI stability is not guaranteed.
+.Sh DESCRIPTION
+The
+.Vt mac_group_info_t
+structure is used by the MAC framework as part of the
+.Dv MAC_CAPAB_RINGS
+capability.
+For background on the MAC framework, please see
+.Xr mac 9E
+and for an introduction to the
+.Dv MAC_CAPAB_RINGS
+capability,
+.Xr mac_capab_rings 9E .
+.Pp
+When a device driver declares that it supports the
+.Dv MAC_CAPAB_RINGS
+capability and fills out the capability structure as described in
+.Xr mac_capab_rings 9E ,
+it indicates that it supports a number of transmit and receive groups.
+For each group that it indicates, its
+.Xr mr_gget 9E
+entry point will be called, during which it will have to fill out the
+.Vt mac_group_info_t
+structure described here.
+.Sh TYPES
+The following types define the function pointers in use in the
+.Vt mac_group_info_t
+structure.
+.Bd -literal -offset indent
+typedef int (*mac_group_start_t)(mac_group_driver_t);
+typedef void (*mac_group_stop_t)(mac_group_driver_t);
+typedef int (*mac_add_mac_addr_t)(mac_group_driver_t, const uint8_t *mac,
+ uint_t flags)
+typedef int (*mac_rem_mac_addr_t)(mac_group_driver_t, const uint8_t *mac,
+ uint_t flags)
+typedef int (*mac_add_vlan_t)(mac_group_driver_t, uint16_t vlan, uint_t flags)
+typedef int (*mac_rem_vlan_t)(mac_group_driver_t, uint16_t vlan, uint_t flags)
+.Ed
+.Sh STRUCTURE MEMBERS
+.Bd -literal -offset indent
+mac_group_driver_t mgi_driver;
+mac_group_start_t mgi_start;
+mac_group_start_t mgi_stop;
+uint_t mgi_count;
+mac_add_mac_addr_t mgi_addmac;
+mac_rem_mac_addr_t mgi_remmac;
+mac_add_vlan_t mgi_addvlan;
+mac_rem_vlan_t mgi_remvlan;
+.Ed
+.Pp
+The
+.Fa mgi_driver
+member should be set by the driver to a driver-specific value that
+represents the data structure that corresponds to this group.
+The driver will receive this value in all of the callback functions that
+are defined in this structure and listed below.
+.Pp
+The
+.Fa mgi_start
+member is an optional entry point.
+If the driver needs to take a specific action before it the group is
+used, then it should set this to a function.
+For more information, see
+.Xr mgi_start 9E .
+.Pp
+The
+.Fa mgi_stop
+member is an optional entry point.
+If the driver needs to take a specific action when the group is being
+stopped, then it should set this to a function.
+For more information, see
+.Xr mgi_stop 9E .
+.Pp
+The
+.Fa mgi_count
+member should be set to a count of the number of rings that are present
+in this group.
+When the group type is
+.Dv MAC_GROUP_TYPE_STATIC ,
+then the value in
+.Fa mgi_count
+represents the fixed number of rings available to the group.
+.Pp
+The
+.Fa mgi_addmac
+member is an optional entry point and should be set to a function that
+can add a MAC address filter to the group in hardware.
+For more information, see
+.Xr mgi_addmac 9E .
+This member only has meaning for a receive group, transmit groups should
+set this to
+.Dv NULL .
+.Pp
+The
+.Fa mgi_remmac
+member is an optional entry point and should be set to a function that
+can remove a MAC address filter from a group in hardware.
+If the
+.Fa mgi_addmac
+member is a valid pointer, then this entry point must be as well.
+For more information, see
+.Xr mgi_remmac 9E .
+This member only has meaning for a receive group, transmit groups should
+set this to
+.Dv NULL .
+.Pp
+The
+.Fa mgi_addvlan
+member is an optional entry point and should be set to a function that
+can add a VLAN filter to the group in hardware.
+For more information, see
+.Xr mgi_addvlan 9E .
+This member only has meaning for a receive group, transmit groups should
+set this to
+.Dv NULL .
+.Pp
+The
+.Fa mgi_remvlan
+member is an optional entry point and should be set to a function that
+can remove a VLAN filter from a group in hardware.
+If the
+.Fa mgi_addvlan
+member is a valid pointer, then this entry point must be as well.
+For more information, see
+.Xr mgi_remvlan 9E .
+This member only has meaning for a receive group, transmit groups should
+set this to
+.Dv NULL .
+.Ss Required Members
+All of the non-function pointers described in this manual are required
+members for both transmit and receive groups.
+The
+.Fa mgi_start
+and
+.Fa mgi_stop
+members are optional for both transmit and receive groups.
+.Pp
+For transmit groups, all of the filter entry points must be set to
+.Dv NULL .
+.Pp
+Receive groups must have some way to set a MAC address filter.
+This means that one of the MAC address related functions must be set.
+Currently, the driver must implement either
+.Fa mgi_addmac
+and
+.Fa mgi_remmac .
+.Sh SEE ALSO
+.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
+.Xr mgi_addmac 9E ,
+.Xr mgi_addvlan 9E ,
+.Xr mgi_remmac 9E ,
+.Xr mgi_remvlan 9E ,
+.Xr mgi_start 9E ,
+.Xr mgi_stop 9E ,
+.Xr mr_gget 9E
diff --git a/usr/src/man/man9s/mac_intr.9s b/usr/src/man/man9s/mac_intr.9s
new file mode 100644
index 0000000000..29fb93d803
--- /dev/null
+++ b/usr/src/man/man9s/mac_intr.9s
@@ -0,0 +1,114 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Compuer Company
+.\"
+.Dd July 2, 2022
+.Dt MAC_INTR 9S
+.Os
+.Sh NAME
+.Nm mac_intr ,
+.Nm mac_intr_t
+.Nd MAC interrupt information
+.Sh SYNOPSIS
+.In sys/mac_provider.h
+.Sh INTERFACE STABILITY
+.Sy Uncommitted -
+This interface is still evolving.
+API and ABI stability is not guaranteed.
+.Sh DESCRIPTION
+The
+.Vt mac_intr_t
+structure is used by the MAC framework as part of the
+.Dv MAC_CAPAB_RINGS
+capability.
+For more background on the MAC framework, please see
+.Xr mac 9E
+and for more information on the
+.Dv MAC_CAPAB_RINGS
+capability,
+.Xr mac_capab_rings 9E .
+.Pp
+The
+.Vt mac_intr_t
+structure is used to describe an interrupt and additional capabilities
+around it.
+The structure is usually used as part of another
+.Xr mac 9E
+related structure such as the
+.Fa mri_intr
+member of the
+.Xr mac_ring_info 9S
+structure.
+The MAC framework uses the functions described here to enable and
+disable interrupt generation for a specific ring, which is used as part
+of switching between polling and interrupt-driven receiving.
+.Pp
+While the structure does embed a
+.Vt ddi_intr_handle_t
+that corresponds to the ring's unerlying MSI-X, MSI, INTx, or other
+interrupt type, the
+.Vt mac_intr_t
+still represents and is scoped to a single ring itself.
+.Sh TYPES
+Tye following types define the function pointers in use in the
+.Vt mac_intr_t
+structure.
+.Bd -literal -offset indent
+typedef int (*mac_intr_enable_t)(mac_intr_handle_t);
+typedef int (*mac_intr_disable_t)(mac_intr_handle_t);
+.Ed
+.Sh STRUCTURE MEMBERS
+.Bd -literal -offset indent
+mac_intr_handle_t mi_handle;
+mac_intr_enable_t mi_enable;
+mac_intr_disable_t mi_disable;
+ddi_intr_handle_t mi_ddi_handle;
+.Ed
+.Pp
+The
+.Fa mi_handle
+member should be set to a driver-specific value that will be passed back
+to the driver in the various callback functions that are setin the
+structure and described below.
+.Pp
+The
+.Fa mi_enable
+member is a required entry point for receive rings and optional for
+transmit rings.
+It should be set to a function which enables interrupts for the ring.
+For more information, see
+.Xr mi_enable 9E .
+.Pp
+The
+.Fa mi_disable
+member is a required entry point for receive rings and an optional entry
+point for transmit rings.
+It should be set to a function which disables interrupts for the ring.
+For more information, see
+.Xr mi_disable 9E .
+.Pp
+The
+.Fa mi_ddi_handle
+member should be set to the interrupt handle that corresponds to the
+ring.
+the interrupt handle will have come from
+.Xr ddi_intr_alloc 9F .
+This member should only be set if the interrupt is a MSI or MSI-X
+interrupt.
+.Sh SEE ALSO
+.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
+.Xr mi_disable 9E ,
+.Xr mi_enable 9E ,
+.Xr ddi_intr_alloc 9F ,
+.Xr mac_ring_inf 9S
diff --git a/usr/src/man/man9s/mac_ring_info.9s b/usr/src/man/man9s/mac_ring_info.9s
new file mode 100644
index 0000000000..7432faea69
--- /dev/null
+++ b/usr/src/man/man9s/mac_ring_info.9s
@@ -0,0 +1,154 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright (c) 2017, Joyent, Inc.
+.\" Copyright 2022 Oxide Computer Company
+.\"
+.Dd July 2, 2022
+.Dt MAC_RING_INFO 9S
+.Os
+.Sh NAME
+.Nm mac_ring_info ,
+.Nm mac_ring_info_t
+.Nd MAC ring information structure
+.Sh SYNOPSIS
+.In sys/mac_provider.h
+.Sh INTERFACE STABILITY
+.Sy Uncommitted -
+This interface is still evolving.
+API and ABI stability is not guaranteed.
+.Sh DESCRIPTION
+The
+.Vt mac_ring_info_t
+structure is used by the MAC framework as part of the
+.Dv MAC_CAPAB_RINGS
+capability.
+For more background on the MAC framework, please see
+.Xr mac 9E
+and for an introduction to the
+.Dv MAC_CAPAB_RINGS
+capability,
+.Xr mac_capab_rings 9E .
+.Pp
+When a device driver declares that it supports the
+.Dv MAC_CAPAB_RINGS
+capability and fills out the structure as described in
+.Xr mac_capab_rings 9E ,
+it indicates that it supports a number of rings for transmitting and
+receiving.
+For each ring that it supports, the driver's
+.Xr mr_rget 9E
+entry point will be called, during which it will have to fill out the
+.Vt mac_ring_info_t
+structure defined here.
+.Sh TYPES
+The following types define the function pointers in use in the
+.Vt mac_ring_info_t
+structure.
+.Bd -literal -offset indent
+typedef int (*mac_ring_start_t)(mac_ring_driver_t, uint64_t);
+typedef void (*mac_ring_stop_t)(mac_ring_driver_t);
+
+typedef mblk_t *(*mac_ring_send_t)(mac_ring_driver_t, mblk_t *);
+typedef mblk_t *(*mac_ring_poll_t)(mac_ring_driver_t, int);
+
+typedef int (*mac_ring_stat_t)(mac_ring_driver_t, uint_t, uint64_t *);
+.Ed
+.Sh STRUCTURE MEMBERS
+.Bd -literal -offset indent
+mac_ring_driver_t mri_driver;
+mac_ring_start_t mri_start;
+mac_ring_stop_t mri_stop;
+mac_intr_t mri_intr;
+mac_ring_send_t mri_tx;
+mac_ring_poll_t mri_poll;
+mac_ring_stat_t mri_stat;
+.Ed
+.Pp
+The
+.Fa mri_driver
+member should be set to a driver-specific value that represents the data
+structure that corresponds to the ring.
+The driver will receive this value in all of the callback functions that
+are defined in this structure and discussed below.
+.Pp
+The
+.Fa mri_start
+member is a required entry point that is used to start the ring.
+While the device driver may not need to do any work with hardware to
+start the use of the ring, it must record the ring's generation number.
+For more information, see
+.Xr mri_start 9E .
+.Pp
+The
+.Fa mri_stop
+member is an optional entry point that will be called when the ring is
+being stopped.
+For more information, see
+.Xr mri_stop 9E .
+.Pp
+The
+.Fa mri_intr
+member contains information about the interrupt associated with the
+ring.
+For more information on filling it out, see
+.Xr mac_intr 9S .
+.Pp
+The
+.Fa mri_tx
+member should only be set on transmit rings.
+It must not be set on receive rings.
+The
+.Fa mri_tx
+member should be set to a function that will transmit a given frame on
+the specified ring.
+For more information, see
+.Xr mri_tx 9E .
+.Pp
+The
+.Fa mri_poll
+member should only be set on receive rings.
+It must not be set on transmit rings.
+The
+.Fa mri_poll
+member should be set to a function which will poll the specified ring.
+For more information, see
+.Xr mri_poll 9E .
+.Pp
+The
+.Fa mri_stat
+member should be set to a function which will retrieve statistics about
+the specified ring.
+For more information, see
+.Xr mri_stat 9E .
+.Ss Required Members
+All non-function members are required.
+The
+.Fa mri_intr
+member must be a properly filled out as per
+.Xr mac_intr 9S .
+.Pp
+For transmit rings, the
+.Fa mri_tx
+member is required.
+.Pp
+For receive rings, the
+.Fa mri_poll
+member is required.
+.Sh SEE ALSO
+.Xr mac 9E ,
+.Xr mac_capab_rings 9E ,
+.Xr mri_poll 9E ,
+.Xr mri_start 9E ,
+.Xr mri_stat 9E ,
+.Xr mri_stop 9E ,
+.Xr mri_tx 9E ,
+.Xr mac_intr 9S