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