6 .Nd Network Interface Driver Framework
12 is a framework for network interface drivers for
14 It is designed to remove a large amount of the boilerplate that is often
15 needed for modern network interface devices, allowing driver authors to
16 focus on the specific code needed for their hardware.
17 This allows for a shared set of
19 names, rather than each driver naming them individually.
21 These variables must be set before loading the driver, either via
25 They are all prefixed by
27 where X is the driver name, and Y is the instance number.
28 .Bl -tag -width indent
30 Override the number of RX descriptors for each queue.
31 The value is a comma separated list of positive integers.
32 Some drivers only use a single value, but others may use more.
33 These numbers must be powers of two, and zero means to use the default.
34 Individual drivers may have additional restrictions on allowable values.
35 Defaults to all zeros.
37 Override the number of TX descriptors for each queue.
38 The value is a comma separated list of positive integers.
39 Some drivers only use a single value, but others may use more.
40 These numbers must be powers of two, and zero means to use the default.
41 Individual drivers may have additional restrictions on allowable values.
42 Defaults to all zeros.
43 .It Va override_qs_enable
44 When set, allows the number of transmit and receive queues to be different.
45 If not set, the lower of the number of TX or RX queues will be used for both.
47 Set the number of RX queues.
48 If zero, the number of RX queues is derived from the number of cores on the
49 socket connected to the controller.
52 Set the number of TX queues.
53 If zero, the number of TX queues is derived from the number of cores on the
54 socket connected to the controller.
56 Disables MSI-X interrupts for the device.
58 Specifies a starting core offset to assign queues to.
59 If the value is unspecified or 65535, cores are assigned sequentially across
62 Requests that RX and TX queues not be paired on the same core.
63 If this is zero or not set, an RX and TX queue pair will be assigned to each
65 When set to a non-zero value, TX queues are assigned to cores following the
71 variables can be changed at any time:
72 .Bl -tag -width indent
74 Controls how the transmit ring is serviced.
75 If set to zero, when a frame is submitted to the transmission ring, the same
76 task that is submitting it will service the ring unless there's already a
77 task servicing the TX ring.
78 This ensures that whenever there is a pending transmission,
79 the transmit ring is being serviced.
80 This results in higher transmit throughput.
81 If set to a non-zero value, task returns immediately and the transmit
82 ring is serviced by a different task.
83 This returns control to the caller faster and under high receive load,
84 may result in fewer dropped RX frames.
86 Sets the maximum number of frames to be received at a time.
87 Zero (the default) indicates the default (currently 16) should be used.
90 There are also some global sysctls which can change behaviour for all drivers,
91 and may be changed at any time.
92 .Bl -tag -width indent
93 .It Va net.iflib.min_tx_latency
94 If this is set to a non-zero value, iflib will avoid any attempt to combine
95 multiple transmits, and notify the hardware as quickly as possible of
97 This will lower the maximum throughput, but will also lower transmit latency.
98 .It Va net.iflib.no_tx_batch
99 Some NICs allow processing completed transmit descriptors in batches.
100 Doing so usually increases the transmit throughput by reducing the number of
102 Setting this to a non-zero value will disable the use of this feature.
107 variables are read-only:
108 .Bl -tag -width indent
109 .It Va driver_version
110 A string indicating the internal version of the driver.
113 There are a number of queue state
116 .Bl -tag -width indent
118 The following are repeated for each transmit queue, where Z is the transmit
119 queue instance number:
120 .Bl -tag -width indent
122 Number of consumer abdications in the MP ring for this queue.
123 An abdication occurs on every ring submission when tx_abdicate is true.
125 Number of consumer restarts in the MP ring for this queue.
126 A restart occurs when an attempt to drain a non-empty ring fails,
127 and the ring is already in the STALLED state.
129 Number of consumer stalls in the MP ring for this queue.
130 A stall occurs when an attempt to drain a non-empty ring fails.
132 Number of normal consumer starts in the MP ring for this queue.
133 A start occurs when the MP ring transitions from IDLE to BUSY.
135 Number of drops in the MP ring for this queue.
136 A drop occurs when there is an attempt to add an entry to an MP ring with
139 Number of entries which have been enqueued to the MP ring for this queue.
141 MP (soft) ring state.
142 This privides a snapshot of the current MP ring state, including the producer
143 head and tail indexes, the consumer index, and the state.
144 The state is one of "IDLE", "BUSY",
145 "STALLED", or "ABDICATED".
147 The number of transmit descriptors which have been reclaimed.
150 The number of transmit descriptors which have been processed, but may not yet
153 Descriptors which have been added to the transmit queue,
154 but have not yet been cleaned.
155 This value will include both untransmitted descriptors as well as descriptors
156 which have been processed.
157 .It Va txq_cidx_processed
158 The transmit queue consumer index of the next descriptor to process.
160 The transmit queue consumer index of the oldest descriptor to reclaim.
162 The transmit queue producer index where the next descriptor to transmit will
164 .It Va no_tx_dma_setup
165 Number of times DMA mapping a transmit mbuf failed for reasons other than
167 .It Va txd_encap_efbig
168 Number of times DMA mapping a transmit mbuf failed due to requiring too many
171 Number of times DMA mapping a transmit mbuf failed for any reason
172 (sum of no_tx_dma_setup and txd_encap_efbig)
174 Number of times a descriptor couldn't be added to the transmit ring because
175 the transmit ring was full.
176 .It Va mbuf_defrag_failed
184 result from DMA mapping a transmit mbuf.
188 was called attempting to parse a header.
195 The following are repeated for each receive queue, where Z is the
196 receive queue instance number:
197 .Bl -tag -width indent
198 .It Va rxq_fl0.credits
199 Credits currently available in the receive ring.
201 Current receive ring consumer index.
203 Current receive ring producer index.
207 Additional OIDs useful for driver and iflib development are exposed when the
208 INVARIANTS and/or WITNESS options are enabled in the kernel.
212 This framework was introduced in