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