xref: /dragonfly/share/man/man4/bnx.4 (revision cfd1aba3)
1.\"
2.\" Copyright (c) 2012 The DragonFly Project.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\"
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in
12.\"    the documentation and/or other materials provided with the
13.\"    distribution.
14.\" 3. Neither the name of The DragonFly Project nor the names of its
15.\"    contributors may be used to endorse or promote products derived
16.\"    from this software without specific, prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
22.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
24.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
28.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.Dd June 16, 2013
32.Dt BNX 4
33.Os
34.Sh NAME
35.Nm bnx
36.Nd "Broadcom BCM57785/BCM5718 families 10/100/Gigabit Ethernet device"
37.Sh SYNOPSIS
38.Cd "device miibus"
39.Cd "device bnx"
40.Pp
41Alternatively, to load the driver as a module at boot time, place the
42following line in
43.Pa /boot/loader.conf :
44.Bd -literal -offset indent
45if_bnx_load="YES"
46.Ed
47.Sh DESCRIPTION
48The
49.Nm
50driver supports the PCIe Ethernet adapters based on
51Broadcom BCM57785/BCM5718 families chips.
52.Pp
53The following features are supported in the
54.Nm
55driver:
56.Pp
57.Bl -item -offset indent -compact
58.It
59IP/TCP/UDP checksum offloading
60.It
61TCP segmentation offloading (TSO)
62.It
63VLAN tag stripping and inserting
64.It
65Interrupt coalescing
66.It
67Receive Side Scaling (RSS),
68up to 4 reception queues
69.It
70Multiple vector MSI-X
71.It
72Multiple transmission queues
73(BCM5717C,
74BCM5719 and BCM5720 only),
75up to 4 transmission queues
76.El
77.Pp
78By default,
79the
80.Nm
81driver will try enabling as many reception queues as are allowed
82by the number of CPUs in the system.
83For BCM5717C,
84BCM5719 and BCM5720,
85in addition to the reception queues,
86by default,
87the
88.Nm
89driver will try enabling as many transmission queues as are allowed
90by the number of CPUs in the system
91and the number of enabled reception queues.
92If multiple transmission queues are enabled,
93the round-robin arbitration is performed among the transmission queues.
94It should be noted that
95if both TSO and multiple transmission queues are enabled,
96the round-robin arbitration between transmission queues is done
97at the TSO packet boundary.
98.Pp
99The
100.Nm
101driver supports the following
102.Ar media
103types:
104.Pp
105.Bl -tag -width 10baseT/UTP -compact
106.It Cm autoselect
107Enable autoselection of the media types and options
108.Pp
109.It Cm 10baseT/UTP
110Set 10Mbps operation.
111The
112.Ar mediaopt
113option can also be used to select either
114.Ar full-duplex
115or
116.Ar half-duplex
117modes.
118.Pp
119.It Cm 100baseTX
120Set 100Mbps (Fast Ethernet) operation.
121The
122.Ar mediaopt
123option can also be used to select either
124.Ar full-duplex
125or
126.Ar half-duplex
127modes.
128.Pp
129.It Cm 1000baseT
130Set 1000Mbps (Gigabit Ethernet) operation.
131The
132.Ar mediaopt
133option can only be set
134.Ar full-duplex
135mode.
136.El
137.Pp
138The
139.Nm
140driver supports the following
141.Ar media
142options:
143.Pp
144.Bl -tag -width full-duplex -compact
145.It Cm full-duplex
146Force full duplex operation.
147.Pp
148.It Cm half-duplex
149Force half duplex operation.
150.El
151.Pp
152Note that the 1000baseT media type is only available
153if it is supported by the adapter.
154For more information on configuring this device,
155see
156.Xr ifconfig 8 .
157The
158.Nm
159driver supports
160.Xr polling 4 .
161.Sh HARDWARE
162The
163.Nm
164driver supports Gigabit Ethernet adapters and Fast Ethernet adapters based on
165the Broadcom BCM57785/BCM5718 families chips:
166.Pp
167.Bl -bullet -compact
168.It
169Broadcom BCM5717 Gigabit Ethernet
170.It
171Broadcom BCM5717C Gigabit Ethernet
172.It
173Broadcom BCM5718 Gigabit Ethernet
174.It
175Broadcom BCM5719 Gigabit Ethernet
176.It
177Broadcom BCM5720 Gigabit Ethernet
178.It
179Broadcom BCM5725 Gigabit Ethernet
180.It
181Broadcom BCM5727 Gigabit Ethernet
182.It
183Broadcom BCM5762 Gigabit Ethernet
184.It
185Broadcom BCM57761 Gigabit Ethernet
186.It
187Broadcom BCM57762 Gigabit Ethernet
188.It
189Broadcom BCM57765 Gigabit Ethernet
190.It
191Broadcom BCM57766 Gigabit Ethernet
192.It
193Broadcom BCM57781 Gigabit Ethernet
194.It
195Broadcom BCM57782 Gigabit Ethernet
196.It
197Broadcom BCM57785 Gigabit Ethernet
198.It
199Broadcom BCM57786 Gigabit Ethernet
200.It
201Broadcom BCM57791 Fast Ethernet
202.It
203Broadcom BCM57795 Fast Ethernet
204.El
205.Sh TUNABLES
206.Em X
207is the device unit number.
208.Bl -tag -width ".Va hw.bnxX.npoll.offset"
209.It Va hw.bnx.rx_rings Va hw.bnxX.rx_rings
210If MSI-X is used,
211this tunable specifies the number of reception queues to be enabled.
212Maximum allowed value for these tunables is 4 and
213it must be power of 2 aligned.
214Setting these tunables to 0 allows the driver to enable as many reception queues
215as allowed by the number of CPUs.
216.It Va hw.bnx.tx_rings Va hw.bnxX.tx_rings
217For BCM5717C,
218BCM5719 and BCM5720,
219if MSI-X is used,
220this tunable specifies the number of transmission queues to be enabled.
221Maximum allowed value for these tunables is 4,
222it must be power of 2 aligned
223and it must be less than or equal to the number of reception queues enabled.
224Setting these tunables to 0 allows the driver to enable as many transmission queues
225as allowed by the number of CPUs and number reception queues enabled.
226.It Va hw.bnx.msix.enable Va hw.bnxX.msix.enable
227By default,
228the driver will use MSI-X
229if it is supported.
230This behaviour can be turned off by setting this tunable to 0.
231.It Va hw.bnxX.msix.offset
232For BCM5717C,
233BCM5719 and BCM5720,
234if more than 1 reception queues
235and more than 1 transmission queues are enabled,
236this tunable specifies the leading target CPU for transmission
237and reception queues processing.
238The value specificed must be aligned to the number of reception queues
239enabled and must be less than the power of 2 number of CPUs.
240.It Va hw.bnxX.msix.txoff
241If more than 1 reception queues are enabled
242and only 1 transmission queue is enabled,
243this tunable specifies the target CPU for transmission queue processing.
244The value specificed must be less than the power of 2 number of CPUs.
245.It Va hw.bnxX.msix.rxoff
246If more than 1 reception queues are enabled
247and only 1 transmission queue is enabled,
248this tunable specifies the leading target CPU for reception queues processing.
249The value specificed must be aligned to the number of reception queues
250enabled and must be less than the power of 2 number of CPUs.
251.It Va hw.bnx.msi.enable Va hw.bnxX.msi.enable
252If MSI-X is disabled and MSI is supported,
253the driver will use MSI.
254This behavior can be turned off by setting this tunable to 0.
255.It Va hw.bnxX.msi.cpu
256If MSI is used, it specifies the MSI's target CPU.
257.It Va hw.bnxX.npoll.offset
258If only 1 reception queue and only 1 transmission queue are enabled
259or more than 1 reception queues and more than 1 transmission queues are enabled,
260this tunable specifies the leading target CPU for transmission and reception
261queues
262.Xr polling 4
263processing.
264The value specificed must be aligned to the number of reception queues
265enabled and must be less than the power of 2 number of CPUs.
266.It Va hw.bnxX.npoll.txoff
267If more than 1 reception queues are enabled
268and only 1 transmission queue is enabled,
269this tunable specifies the target CPU for transmission queue
270.Xr polling 4
271processing.
272The value specificed must be less than the power of 2 number of CPUs.
273.It Va hw.bnxX.npoll.rxoff
274If more than 1 reception queues are enabled
275and only 1 transmission queue is enabled,
276this tunable specifies the leading target CPU for reception queue
277.Xr polling 4
278processing.
279The value specificed must be aligned to the number of reception queues
280enabled and must be less than the power of 2 number of CPUs.
281.El
282.Sh MIB Variables
283A number of per-interface variables are implemented in the
284.Va hw.bnx Ns Em X
285branch of the
286.Xr sysctl 3
287MIB.
288.Bl -tag -width "rx_coal_bds_poll"
289.It Va rx_rings
290Number of reception queues enabled (read-only).
291Use the tunable
292.Va hw.bnx.rx_rings
293or
294.Va hw.bnxX.rx_rings
295to configure it.
296.It Va tx_rings
297Number of transmission queues enabled (read-only).
298Use the tunable
299.Va hw.bnx.tx_rings
300or
301.Va hw.bnxX.tx_rings
302to configure it.
303.It Va rx_coal_ticks
304How often status block should be updated and interrupt should be generated
305by the device,
306due to receiving packets.
307It is used together with
308.Va rx_coal_bds
309to achieve RX interrupt moderation.
310Default value is 150 (microseconds).
311.It Va tx_coal_ticks
312How often status block should be updated and interrupt should be generated
313by the device,
314due to sending packets.
315It is used together with
316.Va tx_coal_bds
317to achieve TX interrupt moderation.
318Default value is 1023 (microseconds).
319.It Va rx_coal_bds
320Maximum number of BDs which must be received by the device
321before the device updates the status block and generates interrupt.
322It is used together with
323.Va rx_coal_ticks
324to achieve RX interrupt moderation.
325Default value is 0 (disabled).
326.It Va rx_coal_bds_poll
327Maximum number of BDs which must be received by the device
328before the device updates the status block during
329.Xr polling 4 .
330It is used together with
331.Va rx_coal_ticks
332to reduce the frequency of status block updating due to RX.
333Default value is 32.
334.It Va tx_coal_bds
335Maximum number of sending BDs which must be processed by the device
336before the device updates the status block and generates interrupt.
337It is used together with
338.Va tx_coal_ticks
339to achieve TX interrupt moderation.
340Default value is 128.
341.It Va tx_coal_bds_poll
342Maximum number of sending BDs which must be processed by the device
343before the device updates the status block during
344.Xr polling 4 .
345It is used together with
346.Va tx_coal_ticks
347to reduce the frequency of status block updating due to TX.
348Default value is 64.
349.It Va force_defrag
350Force defragment the sending mbuf chains,
351if the mbuf chain is not a TSO segment and contains more than 1 mbufs.
352This improves transmission performance on certain low end chips,
353however,
354this also increases CPU load.
355Default value is 0 (disabled).
356.It Va tx_wreg
357The number of transmission descriptors should be setup before the hardware
358register is written.
359Setting this value too high will have negative effect
360on transmission timeliness.
361Setting this value too low will hurt overall transmission performance
362due to the frequent hardware register writing.
363Default value is 8.
364.It Va std_refill
365Number of packets should be received
366before the standard reception producer ring is refilled.
367Setting this value too low will cause extra thread scheduling cost.
368Setting this value too high will make chip drop incoming packets.
369Default value is 128 / number of reception queues.
370.It Va rx_coal_bds_int
371Maximum number of BDs which must be received by the device
372before the device updates the status block
373during host interrupt processing.
374Default value is 80.
375.It Va tx_coal_bds_int
376Maximum number of sending BDs which must be processed by the device
377before the device updates the status block
378during host interrupt processing.
379Default value is 64.
380.It Va npoll_offset
381See the tunable
382.Va hw.bnxX.npoll.offset .
383The set value will take effect the next time
384.Xr polling 4
385is enabled on the device.
386.It Va npoll_txoff
387See the tunable
388.Va hw.bnxX.npoll.txoff .
389The set value will take effect the next time
390.Xr polling 4
391is enabled on the device.
392.It Va npoll_rxoff
393See the tunable
394.Va hw.bnxX.npoll.rxoff .
395The set value will take effect the next time
396.Xr polling 4
397is enabled on the device.
398.It Va norxbds
399Number of times the standard reception producer ring is short
400of reception BDs.
401If this value grows fast,
402it is usually an indication that
403.Va std_refill
404is set too high.
405.It Va errors
406Number of errors, both critical and non-critical, happened.
407.El
408.Sh SEE ALSO
409.Xr arp 4 ,
410.Xr bge 4 ,
411.Xr ifmedia 4 ,
412.Xr miibus 4 ,
413.Xr netintro 4 ,
414.Xr ng_ether 4 ,
415.Xr polling 4 ,
416.Xr vlan 4 ,
417.Xr ifconfig 8
418.Sh HISTORY
419The
420.Nm
421device driver first appeared in
422.Dx 3.1 .
423.Sh AUTHORS
424.An -nosplit
425The
426.Nm
427driver was based on
428.Xr bge 4
429written by
430.An Bill Paul Aq Mt wpaul@windriver.com .
431.An Sepherosa Ziehau
432added receive side scaling,
433multiple transmission queues
434and multiple MSI-X support to
435.Dx .
436