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 June 1, 2017 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.bce.rx_rings Va hw.bceX.rx_rings 236For BCM5709 and BCM5716, 237if MSI-X is used, 238this tunable specifies the number of reception queues to be enabled. 239Maximum allowed value for these tunables is 8. 240Setting these tunables to 0 allows the driver to enable as many reception queues 241as allowed by the number of CPUs. 242.It Va hw.bce.tx_rings Va hw.bceX.tx_rings 243For BCM5709 and BCM5716, 244if MSI-X is used, 245this tunable specifies the number of transmission queues to be enabled. 246Maximum allowed value for these tunables is 8, 247and it must be less than or equal to the number of reception queues enabled. 248Setting these tunables to 0 allows the driver to enable as many transmission queues 249as allowed by the number of CPUs and number reception queues enabled. 250.It Va hw.bce.tx_wreg 251The number of transmission descriptors should be setup before the hardware 252register is written. 253Setting this value too high will have negative effect 254on transmission timeliness. 255Setting this value too low will hurt overall transmission due to the frequent 256hardware register writing. 257Default value is 8. 258.El 259.Sh MIB Variables 260A number of per-interface variables are implemented in the 261.Va dev.bce. Ns Em X 262branch of the 263.Xr sysctl 3 264MIB. 265.Bl -tag -width "tx_ticks_int" 266.It Va tx_bds_int 267See the tunable 268.Va hw.bce.tx_bds_int . 269.It Va tx_bds 270See the tunable 271.Va hw.bce.tx_bds . 272.It Va tx_ticks_int 273See the tunable 274.Va hw.bce.tx_ticks_int . 275.It Va tx_ticks 276See the tunable 277.Va hw.bce.tx_ticks . 278.It Va rx_bds_int 279See the tunable 280.Va hw.bce.rx_bds_int . 281.It Va rx_bds 282See the tunable 283.Va hw.bce_rx_bds . 284.It Va rx_ticks_int 285See the tunable 286.Va hw.bce.rx_ticks_int . 287.It Va rx_ticks 288See the tunable 289.Va hw.bce.rx_ticks . 290.It Va rx_rings 291Number of reception queues actually enabled (read-only). 292For BCM5709 and BCM5716, 293if MSI-X is enabled, 294the enabled reception queues will be one more than the 295value specified in the tunable 296.Va hw.bce.rx_rings 297or 298.Va hw.bceX.rx_rings . 299The extra reception queue is for the packets whose RSS hash 300could not be calculated by the hardware. 301.It Va tx_rings 302Number of transmission queues enable (read-only). 303For BCM5709 and BCM5716, 304if MSI-X is enabled, 305use the tunable 306.Va hw.bce.tx_rings 307or 308.Va hw.bceX.tx_rings 309to configure it. 310.It Va rx_pages 311Number of reception descriptor pages enabled (read-only). 312Use the tunable 313.Va hw.bce.rx_pages 314or 315.Va hw.bceX.rx_pages 316to configure it. 317.It Va tx_pages 318Number of transmission descriptor pages enabled (read-only). 319Use the tunable 320.Va hw.bce.tx_pages 321or 322.Va hw.bceX.tx_pages 323to configure it. 324.It Va tx_wreg 325See the tunable 326.Va hw.bce.tx_wreg . 327.It Va stat_* 328Various hardware statistics. 329.El 330.Sh SEE ALSO 331.Xr altq 4 , 332.Xr arp 4 , 333.Xr ifmedia 4 , 334.Xr miibus 4 , 335.Xr netintro 4 , 336.Xr ng_ether 4 , 337.Xr polling 4 , 338.Xr vlan 4 , 339.Xr ifconfig 8 340.Sh HISTORY 341The 342.Nm 343device driver first appeared in 344.Fx 6.1 . 345.Sh AUTHORS 346The 347.Nm 348driver was written by 349.An David Christensen Aq Mt davidch@broadcom.com . 350.An Sepherosa Ziehau 351added receive side scaling, 352multiple transmission queues 353and multiple vector MSI-X support to 354.Dx . 355