aboutsummaryrefslogtreecommitdiff
path: root/share/man/man4/bxe.4
blob: be9ba2551f967f64e87bce2c031f604c674834e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
.\" Copyright (c) 2013 Broadcom Corporation. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of Broadcom Corporation nor the name of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written consent.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
.\" THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd April 29, 2012
.Dt BXE 4
.Os
.Sh NAME
.Nm bxe
.Nd Broadcom NetXtreme II Ethernet 10Gb PCIe adapter driver
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device bxe"
.Ed
.Pp
Alternatively, to load the driver as a module at boot time, place the
following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
if_bxe_load="YES"
.Ed
.Sh DESCRIPTION
The
.Nm
driver provides support for PCIe 10Gb Ethernet adapters based on the Broadcom
NetXtreme II family of 10Gb chips.
The driver supports Jumbo Frames, VLAN
tagging, checksum offload (IPv4, TCP, UDP, IPv6-TCP, IPv6-UDP), MSI-X
interrupts, TCP Segmentation Offload (TSO), Large Receive Offload (LRO), and
Receive Side Scaling (RSS).
.Sh HARDWARE
The
.Nm
driver provides support for various NICs based on the Broadcom NetXtreme II
family of 10Gb Ethernet controller chips, including the following:
.Pp
.Bl -bullet -compact
.It
Broadcom NetXtreme II BCM57710 10Gb
.It
Broadcom NetXtreme II BCM57711 10Gb
.It
Broadcom NetXtreme II BCM57711E 10Gb
.It
Broadcom NetXtreme II BCM57712 10Gb
.It
Broadcom NetXtreme II BCM57712-MF 10Gb
.It
Broadcom NetXtreme II BCM57800 10Gb
.It
Broadcom NetXtreme II BCM57800-MF 10Gb
.It
Broadcom NetXtreme II BCM57810 10Gb
.It
Broadcom NetXtreme II BCM57810-MF 10Gb
.It
Broadcom NetXtreme II BCM57840 10Gb / 20Gb
.It
Broadcom NetXtreme II BCM57840-MF 10Gb
.El
.Sh CONFIGURATION
There a number of configuration parameters that can be set to tweak the
driver's behavior.
These parameters can be set via the
.Xr loader.conf 5
file to take affect during the next system boot.
The following parameters affect
ALL instances of the driver.
.Bl -tag -width indent
.It Va hw.bxe.debug
DEFAULT = 0
.br
Sets the default logging level of the driver.
See the Diagnostics and Debugging
section below for more details.
.It Va hw.bxe.interrupt_mode
DEFAULT = 2
.br
Sets the default interrupt mode: 0=IRQ, 1=MSI, 2=MSIX.
If set to MSIX and
allocation fails, the driver will roll back and attempt MSI allocation.
If MSI
allocation fails, the driver will roll back and attempt fixed level IRQ
allocation.
If IRQ allocation fails, then the driver load fails.
With MSI/MSIX,
the driver attempts to allocate a vector for each queue in addition to one more
for default processing.
.It Va hw.bxe.queue_count
DEFAULT = 4
.br
Sets the default number of fast path packet processing queues.
Note that one
MSI/MSIX interrupt vector is allocated per-queue.
.It Va hw.bxe.max_rx_bufs
DEFAULT = 0
.br
Sets the maximum number of receive buffers to allocate per-queue.
Zero(0) means
to allocate a receive buffer for every buffer descriptor.
By default this
equates to 4080 buffers per-queue which is the maximum value for this config
parameter.
.It Va hw.bxe.hc_rx_ticks
DEFAULT = 25
.br
Sets the number of ticks for host interrupt coalescing in the receive path.
.It Va hw.bxe.hc_tx_ticks
DEFAULT = 50
.br
Sets the number of ticks for host interrupt coalescing in the transmit path.
.It Va hw.bxe.rx_budget
DEFAULT = 0xffffffff
.br
Sets the maximum number of receive packets to process in an interrupt.
If the
budget is reached then the remaining/pending packets will be processed in a
scheduled taskqueue.
.It Va hw.bxe.max_aggregation_size
DEFAULT = 32768
.br
Sets the maximum LRO aggregration byte size.
The higher the value the more
packets the hardware will aggregate.
Maximum is 65K.
.It Va hw.bxe.mrrs
DEFAULT = -1
.br
Sets the PCI MRRS: -1=Auto, 0=128B, 1=256B, 2=512B, 3=1KB
.It Va hw.bxe.autogreeen
DEFAULT = 0
.br
Set AutoGrEEEN: 0=HW_DEFAULT, 1=FORCE_ON, 2=FORCE_OFF
.It Va hw.bxe.udp_rss
DEFAULT = 0
.br
Enable/Disable 4-tuple RSS for UDP: 0=DISABLED, 1=ENABLED
.El
.Pp
Special care must be taken when modifying the number of queues and receive
buffers.
FreeBSD imposes a limit on the maximum number of
.Xr mbuf 9
allocations.
If buffer allocations fail, the interface initialization will fail
and the interface will not be usable.
The driver does not make a best effort
for buffer allocations.
It is an all or nothing effort.
.Pp
You can tweak the
.Xr mbuf 9
allocation limit using
.Xr sysctl 8
and view the current usage with
.Xr netstat 1
as follows:
.Bd -literal -offset indent
# netstat -m
# sysctl kern.ipc.nmbclusters
# sysctl kern.ipc.nmbclusters=<#>
.Ed
.Pp
There are additional configuration parameters that can be set on a per-instance
basis to dynamically override the default configuration.
The '#' below must be
replaced with the driver instance / interface unit number:
.Bl -tag -width indent
.It Va dev.bxe.#.debug
DEFAULT = 0
.br
Sets the default logging level of the driver instance.
See
.Va hw.bxe.debug
above and
the Diagnostics and Debugging section below for more details.
.It Va dev.bxe.#.rx_budget
DEFAULT = 0xffffffff
.br
Sets the maximum number of receive packets to process in an interrupt for the
driver instance.
See
.Va hw.bxe.rx_budget
above for more details.
.El
.Pp
Additional items can be configured using
.Xr ifconfig 8 :
.Bl -tag -width indent
.It Va MTU - Maximum Transmission Unit
DEFAULT = 1500
.br
RANGE = 46-9184
.br
# ifconfig bxe# mtu <n>
.It Va Promiscuous Mode
DEFAULT = OFF
.br
# ifconfig bxe# [ promisc | -promisc ]
.It Va Rx/Tx Checksum Offload
DEFAULT = RX/TX CSUM ON
.br
Note that the Rx and Tx settings are not independent.
.br
# ifconfig bxe# [ rxcsum | -rxcsum | txcsum | -txcsum ]
.It Va TSO - TCP Segmentation Offload
DEFAULT = ON
.br
# ifconfig bxe# [ tso | -tso | tso6 | -tso6 ]
.It Va LRO - TCP Large Receive Offload
DEFAULT = ON
.br
# ifconfig bxe# [ lro | -lro ]
.El
.Sh DIAGNOSTICS AND DEBUGGING
There are many statistics exposed by
.Nm
via
.Xr sysctl 8 .
.Pp
To dump the default driver configuration:
.Bd -literal -offset indent
# sysctl -a | grep hw.bxe
.Ed
.Pp
To dump every instance's configuration and detailed statistics:
.Bd -literal -offset indent
# sysctl -a | grep dev.bxe
.Ed
.Pp
To dump information for a single instance (replace the '#' with the driver
instance / interface unit number):
.Bd -literal -offset indent
# sysctl -a | grep dev.bxe.#
.Ed
.Pp
To dump information for all the queues of a single instance:
.Bd -literal -offset indent
# sysctl -a | grep dev.bxe.#.queue
.Ed
.Pp
To dump information for a single queue of a single instance (replace the
additional '#' with the queue number):
.Bd -literal -offset indent
# sysctl -a | grep dev.bxe.#.queue.#
.Ed
.Pp
The
.Nm
driver has the ability to dump a ton of debug messages to the system
log.
The default level of logging can be set with the
.Va hw.bxe.debug
.Xr sysctl 8 .
Take care with this setting as it can result in too
many logs being dumped.
Since this parameter is the default one, it affects
every instance and will dramatically change the timing in the driver.
A better
alternative to aid in debugging is to dynamically change the debug level of a
specific instance with the
.Va dev.bxe.#.debug
.Xr sysctl 8 .
This allows
you to turn on/off logging of various debug groups on-the-fly.
.Pp
The different debug groups that can be toggled are:
.Bd -literal -offset indent
DBG_LOAD   0x00000001 /* load and unload    */
DBG_INTR   0x00000002 /* interrupt handling */
DBG_SP     0x00000004 /* slowpath handling  */
DBG_STATS  0x00000008 /* stats updates      */
DBG_TX     0x00000010 /* packet transmit    */
DBG_RX     0x00000020 /* packet receive     */
DBG_PHY    0x00000040 /* phy/link handling  */
DBG_IOCTL  0x00000080 /* ioctl handling     */
DBG_MBUF   0x00000100 /* dumping mbuf info  */
DBG_REGS   0x00000200 /* register access    */
DBG_LRO    0x00000400 /* lro processing     */
DBG_ASSERT 0x80000000 /* debug assert       */
DBG_ALL    0xFFFFFFFF /* flying monkeys     */
.Ed
.Pp
For example, to debug an issue in the receive path on bxe0:
.Bd -literal -offset indent
# sysctl dev.bxe.0.debug=0x22
.Ed
.Pp
When finished turn the logging back off:
.Bd -literal -offset indent
# sysctl dev.bxe.0.debug=0
.Ed
.Sh SEE ALSO
.Xr netstat 1 ,
.Xr altq 4 ,
.Xr arp 4 ,
.Xr netintro 4 ,
.Xr ng_ether 4 ,
.Xr vlan 4 ,
.Xr ifconfig 8
.Sh HISTORY
The
.Nm
device driver first appeared in
.Fx 9.0 .
.Sh AUTHORS
The
.Nm
driver was written by
.An Eric Davis Aq edavis@broadcom.com ,
.An David Christensen Aq davidch@broadcom.com ,
and
.An Gary Zambrano Aq zambrano@broadcom.com .