]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/cgem.4
ena: Implement full RSS reconfiguration
[FreeBSD/FreeBSD.git] / share / man / man4 / cgem.4
1 .\"
2 .\" Copyright (c) 2014 Thomas Skibo <thomasskibo@yahoo.com>
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. The name of the author may not be used to endorse or promote products
11 .\"    derived from this software without specific prior written permission.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd January 10, 2021
28 .Dt CGEM 4
29 .Os
30 .Sh NAME
31 .Nm cgem
32 .Nd "Cadence GEM Gigabit Ethernet driver"
33 .Sh SYNOPSIS
34 To compile this driver into the kernel,
35 place the following lines in your
36 kernel configuration file:
37 .Bd -ragged -offset indent
38 .Cd "device ether"
39 .Cd "device miibus"
40 .Cd "device cgem"
41 .Ed
42 .Sh DESCRIPTION
43 The
44 .Nm
45 driver provides support for the Cadence GEM (Gigabit Ethernet MAC).
46 The Cadence GEM is used in some SoC (System on a Chip) devices such as
47 the Xilinx Zynq-7000, the Xilinx Zynq UltraScale+, and the SiFive
48 HiFive Unleashed.
49 .Pp
50 The
51 .Nm
52 driver supports the following media types:
53 .Bl -tag -width ".Cm 10baseT/UTP"
54 .It Cm autoselect
55 Enable autoselection of the media type and options.
56 The user can manually override
57 the autoselected mode using
58 .Xr ifconfig 8
59 or by adding media options to
60 .Xr rc.conf 5 .
61 .It Cm 10baseT/UTP
62 Set 10Mbps operation.
63 The
64 .Xr ifconfig 8
65 .Cm mediaopt
66 option can also be used to select either
67 .Cm full-duplex
68 or
69 .Cm half-duplex
70 modes.
71 .It Cm 100baseTX
72 Set 100Mbps (Fast Ethernet) operation.
73 The
74 .Xr ifconfig 8
75 .Cm mediaopt
76 option can also be used to select either
77 .Cm full-duplex
78 or
79 .Cm half-duplex
80 modes.
81 .It Cm 1000baseT
82 Set 1000Mbps (Gigabit Ethernet) operation over twisted pair.
83 The GEM supports 1000Mbps in
84 .Cm full-duplex
85 mode only.
86 .El
87 .Pp
88 The
89 .Nm
90 driver supports the following media options:
91 .Bl -tag -width ".Cm full-duplex"
92 .It Cm full-duplex
93 Force full-duplex operation.
94 .It Cm half-duplex
95 Force half-duplex operation.
96 .El
97 .Pp
98 The driver provides support for TCP/UDP/IP checksum offloading (although
99 disabled by default).
100 The device and driver also support 1536-byte frames for VLANs (vlanmtu).
101 .Sh SYSCTL VARIABLES
102 The following variables are available as both
103 .Xr sysctl 8
104 variables and
105 .Xr loader 8
106 tunables:
107 .Bl -tag -width "xxxxxxxx"
108 .It Va dev.cgem.%d.rxbufs
109 The number of receive buffers allocated to the hardware.
110 The default value is 256.
111 The maximum value is 511.
112 If this number is increased while the interface is UP, it will not
113 take effect until the next packet is received.
114 If this number is decreased while the interface is UP, buffers will
115 not be immediately removed from the receive buffer ring but the
116 number of buffers will decrease as packets are received until it
117 reaches the new value.
118 .It Va dev.cgem.%d.rxhangwar
119 This tunable enables a work-around to recover from receive hangs.
120 The default value is 1.
121 Set to 0 to disable the work-around.
122 .El
123 .Pp
124 The following read-only variables are available as
125 .Xr sysctl 8
126 variables:
127 .Bl -tag -width "xxxxxxxx"
128 .It Va dev.cgem.%d._rxoverruns
129 This variable counts the number of receive packet buffer overrun interrupts.
130 .It Va dev.cgem.%d._rxnobufs
131 This variable counts the number of interrupts due to the GEM buffer ring
132 going empty.
133 .It Va dev.cgem.%d._rxdmamapfails
134 This variable is the number of times bus_dmamap_load_mbuf_sg(9) failed in
135 the receive path.
136 .It Va dev.cgem.%d._txfull
137 The number of times the GEM's transmit ring was full.
138 .It Va dev.cgem.%d._txdmamapfails
139 This variable is the number of times bus_dmamap_load_mbuf_sg(9) failed in
140 the transmit path.
141 .It Va dev.cgem.%d._txdefrags
142 This variable is the number of times the driver needed to call m_defrag(9)
143 because a packet queued for transmit had too many DMA segments.
144 .It Va dev.cgem.%d._txdefragfails
145 This variable is the number of times
146 .Xr m_defrag 9
147 failed.
148 .It Va dev.cgem.%d.stats.*
149 The following variables are useful MAC counters supplied by the hardware:
150 .It Va dev.cgem.%d.stats.tx_bytes
151 A 64-bit counter of the number of bytes transmitted in frames without error.
152 .It Va dev.cgem.%d.stats.tx_frames
153 Counter of frames transmitted without error excluding pause frames.
154 .It Va dev.cgem.%d.stats.tx_frames_bcast
155 Counter of broadcast frames transmitted without error excluding
156 pause frames.
157 .It Va dev.cgem.%d.stats.tx_frames_multi
158 Counter of multicast frames transmitted without error excluding
159 pause frames.
160 .It Va dev.cgem.%d.stats.tx_frames_pause
161 Counter of pause frames transmitted without error.
162 .It Va dev.cgem.%d.stats.tx_frames_64b
163 Counter of 64 byte frames transmitted without error.
164 .It Va dev.cgem.%d.stats.tx_frames_65to127b
165 Counter of 65 to 127 byte frames transmitted without error.
166 .It Va dev.cgem.%d.stats.tx_frames_128to255b
167 Counter of 128 to 255 byte frames transmitted without error.
168 .It Va dev.cgem.%d.stats.tx_frames_256to511b
169 Counter of 256 to 511 byte frames transmitted without error.
170 .It Va dev.cgem.%d.stats.tx_frames_512to1023b
171 Counter of 512 to 1023 byte frames transmitted without error.
172 .It Va dev.cgem.%d.stats.tx_frames_1024to1536b
173 Counter of 1024 to 1536 byte frames transmitted without error.
174 .It Va dev.cgem.%d.stats.tx_under_runs
175 Counter of frames not transmitted due to a transmit underrun.
176 .It Va dev.cgem.%d.stats.tx_single_collisn
177 Counter of frames experiencing a single collision before being successfully
178 transmitted.
179 .It Va dev.cgem.%d.stats.tx_multi_collisn
180 Counter of frames experiencing between 2 and 15 collisions before
181 being successfully transmitted.
182 .It Va dev.cgem.%d.stats.tx_excsv_collisn
183 Counter of frames that failed to transmit because they experienced 16
184 collisions.
185 .It Va dev.cgem.%d.stats.tx_late_collisn
186 Counter of frames that experienced a late collision.
187 .It Va dev.cgem.%d.stats.tx_deferred_frames
188 Counter of frames experiencing deferral due to carrier sense being
189 active on their first attempt at transmission.
190 .It Va dev.cgem.%d.stats.tx_carrier_sense_errs
191 Counter of frames transmitted where carrier sense was not seen during
192 transmission or where carrier sense was deasserted after being asserted
193 in a transmit frame without collision.
194 .It Va dev.cgem.%d.stats.rx_bytes
195 A 64-bit counter of bytes received without error excluding pause
196 frames.
197 .It Va dev.cgem.%d.stats.rx_frames
198 Counter of frames received without error excluding pause frames.
199 .It Va dev.cgem.%d.stats.rx_frames_bcast
200 Counter of broadcast frames receive without error excluding pause frames.
201 .It Va dev.cgem.%d.stats.rx_frames_multi
202 Counter of multicast frames receive without error excluding pause frames.
203 .It Va dev.cgem.%d.stats.rx_frames_pause
204 Counter of pause frames recevied without error.
205 .It Va dev.cgem.%d.stats.rx_frames_64b
206 Counter of 64-byte frames received without error.
207 .It Va dev.cgem.%d.stats.rx_frames_65to127b
208 Counter of 65 to 127 byte frames received without error.
209 .It Va dev.cgem.%d.stats.rx_frames_128to255b
210 Counter of 128 to 255 byte frames received without error.
211 .It Va dev.cgem.%d.stats.rx_frames_256to511b
212 Counter of 256 to 511 byte frames received without error.
213 .It Va dev.cgem.%d.stats.rx_frames_512to1023b
214 Counter of 512 to 1023 byte frames received without error.
215 .It Va dev.cgem.%d.stats.rx_frames_1024to1536b
216 Counter of 1024 to 1536 byte frames received without error.
217 .It Va dev.cgem.%d.stats.rx_frames_undersize
218 Counter of frames received less than 64 bytes in length that
219 do not also have either a CRC error or an alignment error.
220 .It Va dev.cgem.%d.stats.rx_frames_oversize
221 Counter of frames received exceeding 1536 bytes and do not also have either
222 a CRC error or an alignment error.
223 .It Va dev.cgem.%d.stats.rx_frames_jabber
224 Counter of frames received exceeding 1536 bytes and also have either a CRC
225 error, an alignment error, or a receive symbol error.
226 .It Va dev.cgem.%d.stats.rx_frames_fcs_errs
227 Counter of frames received with a bad CRC and are between 64
228 and 1536 bytes.
229 .It Va dev.cgem.%d.stats.rx_frames_length_errs
230 Counter of frames received that are shorter than that extracted
231 from the length field.
232 .It Va dev.cgem.%d.stats.rx_symbol_errs
233 Counter of receive symbol errors.
234 .It Va dev.cgem.%d.stats.rx_align_errs
235 Counter of received frames that are not an integral number of bytes.
236 .It Va dev.cgem.%d.stats.rx_resource_errs
237 Counter of frames successfully receive by the MAC but could not be
238 copied to memory because no receive buffer was available.
239 .It Va dev.cgem.%d.stats.rx_overrun_errs
240 Counter of frames that are address recognized but were not copied
241 to memory due to a receive overrun.
242 .It Va dev.cgem.%d.stats.rx_frames_ip_hdr_csum_errs
243 Counter of frames discarded due to an incorrect IP header checksum when
244 checksum offloading is enabled.
245 .It Va dev.cgem.%d.stats.rx_frames_tcp_csum_errs
246 Counter of frames discarded due to an incorrect TCP checksum when
247 checksum offloading is enabled.
248 .It Va dev.cgem.%d.stats.rx_frames_udp_csum_errs
249 Counter of frames discarded due to an incorrect UDP checksum when
250 checksum offloading is enabled.
251 .El
252 .Sh SEE ALSO
253 .Xr miibus 4 ,
254 .Xr ifconfig 8
255 .Rs
256 .%T "Zynq-7000 SoC Technical Reference Manual (Xilinx doc UG585)"
257 .%U http://www.xilinx.com/support/documentation/user_guides/\:ug585-Zynq-7000-TRM.pdf
258 .Re
259 .Sh HISTORY
260 The
261 .Nm
262 device driver first appeared in
263 .Fx 10.0 .
264 .Sh AUTHORS
265 The
266 .Nm
267 driver and this manual page was written by
268 .An Thomas Skibo Aq Mt thomasskibo@yahoo.com .
269 .Sh BUGS
270 The GEM can perform TCP/UDP/IP checksum offloading.
271 However, when transmit checksum offloading is enabled, the GEM generates and
272 replaces checksums for all packets it transmits.
273 In a system that is forwarding packets, the device could potentially correct
274 the checksum of packet that was corrupted in transit.
275 For this reason, checksum offloading is disabled by default but can be
276 enabled using ifconfig(8).
277 .Pp
278 When receive checksum offloading is enabled, the device will discard packets
279 with bad TCP/UDP/IP checksums.
280 The bad packets will not be counted in any
281 .Xr netstat 1
282 statistics.
283 There are
284 .Xr sysctl 8
285 variables that count
286 packets discarded by the hardware (see below).
287 .Pp
288 The GEM used in the Zynq-7000 has a bug such that the receiver can
289 potentially freeze up under a high load.
290 The issue is described in sec. 16.7
291 "Known Issues" of the Zynq-7000 SoC Technical Reference Manual (Xilinx
292 UG585 v1.7).
293 The
294 .Nm
295 driver implements the work-around suggested in the manual.
296 It is believed that the bug does not exist in the Zynq UltraScale+ and
297 SiFive SoCs so the work-around is disabled in those instances and enabled
298 in all others.
299 The work-around can be disabled by setting the
300 .Va dev.cgem.%d.rxhangwar
301 .Xr sysctl 8
302 variable to 0.