1.\" Copyright (c) 2006 Broadcom Corporation 2.\" David Christensen <davidch@broadcom.com>. 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 the 12.\" documentation and/or other materials provided with the distribution. 13.\" 3. Neither the name of Broadcom Corporation nor the name of its contributors 14.\" may be used to endorse or promote products derived from this software 15.\" without specific prior written consent. 16.\" 17.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' 18.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27.\" THE POSSIBILITY OF SUCH DAMAGE. 28.\" 29.\" $FreeBSD: src/share/man/man4/bce.4,v 1.7 2007/02/09 18:26:13 brueffer Exp $ 30.\" 31.Dd November 28, 2014 32.Dt BCE 4 33.Os 34.Sh NAME 35.Nm bce 36.Nd "Broadcom NetXtreme II PCIe Gigabit Ethernet adapter driver" 37.Sh SYNOPSIS 38To compile this driver into the kernel, 39place the following lines in your 40kernel configuration file: 41.Bd -ragged -offset indent 42.Cd "device miibus" 43.Cd "device bce" 44.Ed 45.Pp 46Alternatively, to load the driver as a 47module at boot time, place the following line in 48.Xr loader.conf 5 : 49.Bd -literal -offset indent 50if_bce_load="YES" 51.Ed 52.Sh DESCRIPTION 53The 54.Nm 55driver supports Broadcom's NetXtreme II product family, including the 56BCM5706, BCM5708, BCM5709 and BCM5716 Ethernet controllers. 57.Pp 58The NetXtreme II product family is composed of various Converged NIC (or CNIC) 59Ethernet controllers which support a TCP Offload Engine (TOE), Remote DMA (RDMA), 60and iSCSI acceleration, in addition to standard L2 Ethernet traffic, all on the 61same controller. 62The following features are supported in the 63.Nm 64driver: 65.Pp 66.Bl -item -offset indent -compact 67.It 68.\"IP/TCP/UDP checksum offload 69TCP/UDP checksum offload 70.\".It 71.\"Jumbo frames (up to 9022 bytes) 72.It 73TCP segmentation offloading (TSO) 74.It 75VLAN tag stripping and inserting 76.It 77Interrupt coalescing 78.It 7910/100/1000Mbps operation in full-duplex mode 80.It 8110/100Mbps operation in half-duplex mode 82.El 83.Pp 84The following features are supported in the 85.Nm 86driver for BCM5709 and BCM5716: 87.Pp 88.Bl -item -offset indent -compact 89.It 90Receive side scaling (RSS), up to 8 reception queues 91.It 92Multiple tranmission queues, up to 8 transmission queues 93.It 94Multiple vector MSI-X 95.El 96.Pp 97For BCM5709 and BCM5716, 98by default, the 99.Nm 100driver will try enabling as many reception and transmission queues 101as are allowed by the number of CPUs in the system. 102If multiple transmission queues are enabled, 103the round-robin arbitration is performed among the transmission queues. 104It should be noted that 105if both TSO and multiple transmission queues are enabled, 106the round-robin arbitration between transmission queues is done 107at the TSO packet boundary. 108.Pp 109The 110.Nm 111driver supports the following media types: 112.Bl -tag -width ".Cm 10baseT/UTP" 113.It Cm autoselect 114Enable autoselection of the media type and options. 115The user can manually override 116the autoselected mode by adding media options to 117.Xr rc.conf 5 . 118.It Cm 10baseT/UTP 119Set 10Mbps operation. 120The 121.Xr ifconfig 8 122.Cm mediaopt 123option can also be used to select either 124.Cm full-duplex 125or 126.Cm half-duplex 127modes. 128.It Cm 100baseTX 129Set 100Mbps (Fast Ethernet) operation. 130The 131.Xr ifconfig 8 132.Cm mediaopt 133option can also be used to select either 134.Cm full-duplex 135or 136.Cm half-duplex 137modes. 138.It Cm 1000baseT 139Set 1000baseT operation over twisted pair. 140Only 141.Cm full-duplex 142mode is supported. 143.El 144.Pp 145The 146.Nm 147driver supports the following media options: 148.Bl -tag -width ".Cm full-duplex" 149.It Cm full-duplex 150Force full duplex operation. 151.It Cm half-duplex 152Force half duplex operation. 153.El 154.Pp 155For more information on configuring this device, see 156.Xr ifconfig 8 . 157The 158.Nm 159driver supports 160.Xr polling 4 . 161.Sh TUNABLES 162.Em X 163is the device unit number. 164.Bl -tag -width ".Va hw.bceX.npoll.offset" 165.It Va hw.bce.tx_bds 166Maximum number of sending BDs which must be processed by the device 167before the device updates the status block and generates interrupt. 168It is used together with 169.Va hw.bce.tx_ticks 170to achieve TX interrupt moderation. 171Default value is 255. 172.It Va hw.bce.tx_bds_int 173Maximum number of sending BDs which must be processed by the device 174before the device updates the status block 175during host interrupt processing. 176Default value is 255. 177.It Va hw.bce.tx_ticks 178How often status block should be updated and interrupt should be generated 179by the device, 180due to sending packets. 181It is used together with 182.Va hw.bce.tx_bds 183to achieve TX interrupt moderation. 184Default value is 1022 (microseconds). 185.It Va hw.bce.tx_ticks_int 186How often status block should be updated by the device 187during host interrupt processing, 188due to sending packets. 189Default value is 1022 (microseconds). 190.It Va hw.bce.rx_bds 191Maximum number of BDs which must be received by the device 192before the device updates the status block and generates interrupt. 193It is used together with 194.Va hw.bce.rx_ticks 195to achieve RX interrupt moderation. 196Default value is 0. 197.It Va hw.bce.rx_bds_int 198Maximum number of BDs which must be received by the device 199before the device updates the status block 200during host interrupt processing. 201Default value is 128. 202.It Va hw.bce.rx_ticks 203How often status block should be updated and interrupt should be generated 204by the device, 205due to receiving packets. 206It is used together with 207.Va hw.bce.rx_bds 208to achieve RX interrupt moderation. 209Default value is 150 (microseconds). 210.It Va hw.bce.rx_ticks_int 211How often status block should be updated by the device 212during host interrupt processing, 213due to receiving packets. 214Default value is 150 (microseconds). 215.It Va hw.bce.msi.enable Va hw.bceX.msi.enable 216For BCM5706 and BCM5708, 217by default, 218the driver will use MSI if it is supported. 219This behavior can be turned off by setting this tunable to 0. 220.It Va hw.bceX.msi.cpu 221If MSI is used, it specifies the MSI's target CPU. 222.It Va hw.bce.msix.enable Va hw.bceX.msix.enable 223For BCM5709 and BCM5716, 224by default, 225the driver will use MSI-X if it is supported. 226This behavior can be turned off by setting this tunable to 0. 227.It Va hw.bce.rx_pages Va hw.bceX.rx_pages 228How many reception descriptor pages should be used. 229One reception descriptor page holds 256 reception descriptors. 230Default value is 2. 231.It Va hw.bce.tx_pages Va hw.bceX.tx_pages 232How many transmission descriptor pages should be used. 233One transmission descriptor page holds 256 transmission descriptors. 234Default value is 2. 235.It Va hw.bceX.msix.offset 236For BCM5709 and BCM5716, 237if MSI-X is used, 238this tunable specifies the leading target CPU for transmission and reception 239queues processing. 240The value specificed must be aligned to the number of reception queues 241enabled and must be less than the power of 2 number of CPUs. 242.It Va hw.bceX.npoll.offset 243This tunable specifies the leading target CPU for transmission and reception 244queues 245.Xr polling 4 246processing. 247The value specificed must be aligned to the number of reception queues 248enabled and must be less than the power of 2 number of CPUs. 249.It Va hw.bce.rx_rings Va hw.bceX.rx_rings 250For BCM5709 and BCM5716, 251if MSI-X is used, 252this tunable specifies the number of reception queues to be enabled. 253Maximum allowed value for these tunables is 8 and 254it must be power of 2 aligned. 255Setting these tunables to 0 allows the driver to enable as many reception queues 256as allowed by the number of CPUs. 257.It Va hw.bce.tx_rings Va hw.bceX.tx_rings 258For BCM5709 and BCM5716, 259if MSI-X is used, 260this tunable specifies the number of transmission queues to be enabled. 261Maximum allowed value for these tunables is 8, 262it must be power of 2 aligned 263and it must be less than or equal to the number of reception queues enabled. 264Setting these tunables to 0 allows the driver to enable as many transmission queues 265as allowed by the number of CPUs and number reception queues enabled. 266.It Va hw.bce.tx_wreg 267The number of transmission descriptors should be setup before the hardware 268register is written. 269Setting this value too high will have negative effect 270on transmission timeliness. 271Setting this value too low will hurt overall transmission due to the frequent 272hardware register writing. 273Default value is 8. 274.El 275.Sh MIB Variables 276A number of per-interface variables are implemented in the 277.Va dev.bce. Ns Em X 278branch of the 279.Xr sysctl 3 280MIB. 281.Bl -tag -width "tx_ticks_int" 282.It Va tx_bds_int 283See the tunable 284.Va hw.bce.tx_bds_int . 285.It Va tx_bds 286See the tunable 287.Va hw.bce.tx_bds . 288.It Va tx_ticks_int 289See the tunable 290.Va hw.bce.tx_ticks_int . 291.It Va tx_ticks 292See the tunable 293.Va hw.bce.tx_ticks . 294.It Va rx_bds_int 295See the tunable 296.Va hw.bce.rx_bds_int . 297.It Va rx_bds 298See the tunable 299.Va hw.bce_rx_bds . 300.It Va rx_ticks_int 301See the tunable 302.Va hw.bce.rx_ticks_int . 303.It Va rx_ticks 304See the tunable 305.Va hw.bce.rx_ticks . 306.It Va rx_rings 307Number of reception queues actually enabled (read-only). 308For BCM5709 and BCM5716, 309if MSI-X is enabled, 310the enabled reception queues will be one more than the 311value specified in the tunable 312.Va hw.bce.rx_rings 313or 314.Va hw.bceX.rx_rings . 315The extra reception queue is for the packets whose RSS hash 316could not be calculated by the hardware. 317.It Va tx_rings 318Number of transmission queues enable (read-only). 319For BCM5709 and BCM5716, 320if MSI-X is enabled, 321use the tunable 322.Va hw.bce.tx_rings 323or 324.Va hw.bceX.tx_rings 325to configure it. 326.It Va rx_pages 327Number of reception descriptor pages enabled (read-only). 328Use the tunable 329.Va hw.bce.rx_pages 330or 331.Va hw.bceX.rx_pages 332to configure it. 333.It Va tx_pages 334Number of transmission descriptor pages enabled (read-only). 335Use the tunable 336.Va hw.bce.tx_pages 337or 338.Va hw.bceX.tx_pages 339to configure it. 340.It Va tx_wreg 341See the tunable 342.Va hw.bce.tx_wreg . 343.It Va npoll_offset 344.Xr polling 4 345reception and transmission queues' leading target CPU. 346It has the same constraints as the tunable 347.Va hw.bceX.npoll.offset . 348The set value will take effect the next time 349.Xr polling 4 350is enabled on the device. 351.It Va stat_* 352Various hardware statistics. 353.El 354.Sh SEE ALSO 355.Xr altq 4 , 356.Xr arp 4 , 357.Xr ifmedia 4 , 358.Xr miibus 4 , 359.Xr netintro 4 , 360.Xr ng_ether 4 , 361.Xr polling 4 , 362.Xr vlan 4 , 363.Xr ifconfig 8 364.Sh HISTORY 365The 366.Nm 367device driver first appeared in 368.Fx 6.1 . 369.Sh AUTHORS 370The 371.Nm 372driver was written by 373.An David Christensen Aq Mt davidch@broadcom.com . 374.An Sepherosa Ziehau 375added receive side scaling, 376multiple transmission queues 377and multiple vector MSI-X support to 378.Dx . 379