1bbf21555SRichard Lowe.\" 2bbf21555SRichard Lowe.\" This file and its contents are supplied under the terms of the 3bbf21555SRichard Lowe.\" Common Development and Distribution License ("CDDL"), version 1.0. 4bbf21555SRichard Lowe.\" You may only use this file in accordance with the terms of version 5bbf21555SRichard Lowe.\" 1.0 of the CDDL. 6bbf21555SRichard Lowe.\" 7bbf21555SRichard Lowe.\" A full copy of the text of the CDDL should have accompanied this 8bbf21555SRichard Lowe.\" source. A copy of the CDDL is also available via the Internet at 9bbf21555SRichard Lowe.\" http://www.illumos.org/license/CDDL. 10bbf21555SRichard Lowe.\" 11bbf21555SRichard Lowe.\" 12*5014e1faSAlex Wilson.\" Copyright 2023 the University of Queensland 13bbf21555SRichard Lowe.\" 14bbf21555SRichard Lowe.Dd August 27, 2020 15bbf21555SRichard Lowe.Dt MLXCX 4D 16bbf21555SRichard Lowe.Os 17bbf21555SRichard Lowe.Sh NAME 18bbf21555SRichard Lowe.Nm mlxcx 19bbf21555SRichard Lowe.Nd Mellanox ConnectX-4/5/6 Ethernet controller driver 20bbf21555SRichard Lowe.Sh SYNOPSIS 21bbf21555SRichard Lowe.Pa /dev/net/mlxcx* 22bbf21555SRichard Lowe.Sh DESCRIPTION 23bbf21555SRichard LoweThe 24bbf21555SRichard Lowe.Sy mlxcx 25bbf21555SRichard Lowedriver is a GLDv3 NIC driver for the ConnectX-4, ConnectX-4 Lx, ConnectX-5 and 26bbf21555SRichard LoweConnectX-6 families of ethernet controllers from Mellanox. 27bbf21555SRichard LoweIt supports the Data Link Provider Interface, 28bbf21555SRichard Lowe.Xr dlpi 4P . 29bbf21555SRichard Lowe.Pp 30bbf21555SRichard LoweThis driver supports: 31bbf21555SRichard Lowe.Bl -dash -offset indent 32bbf21555SRichard Lowe.It 33bbf21555SRichard LoweJumbo frames up to 9000 bytes. 34bbf21555SRichard Lowe.It 35bbf21555SRichard LoweChecksum offload for TCP, UDP, IPv4 and IPv6. 36bbf21555SRichard Lowe.It 37bbf21555SRichard LoweGroup support with VLAN and MAC steering to avoid software classification 38bbf21555SRichard Lowewhen using VNICs. 39bbf21555SRichard Lowe.It 40bbf21555SRichard LowePromiscuous access via 41bbf21555SRichard Lowe.Xr snoop 8 and 42bbf21555SRichard Lowe.Xr dlpi 4P 43bbf21555SRichard Lowe.It 44bbf21555SRichard LoweLED control 45bbf21555SRichard Lowe.It 46bbf21555SRichard LoweTransceiver information 47bbf21555SRichard Lowe.It 48bbf21555SRichard LoweInternal temperature sensors 49bbf21555SRichard Lowe.El 50bbf21555SRichard Lowe.Pp 51bbf21555SRichard LoweAt this time, the driver does not support Large Send Offload (LSO), energy 52bbf21555SRichard Loweefficient Ethernet (EEE), or the use of flow control through hardware pause 53bbf21555SRichard Loweframes. 54bbf21555SRichard Lowe.Sh CONFIGURATION 55bbf21555SRichard LoweThe 56bbf21555SRichard Lowe.Sy mlxcx.conf 57bbf21555SRichard Lowefile contains user configurable parameters, including the ability to set the 58bbf21555SRichard Lowenumber of rings and groups advertised to MAC, the sizes of rings and groups, 59bbf21555SRichard Loweand the maximum number of MAC address filters available. 60bbf21555SRichard Lowe.Sh PROPERTIES 61bbf21555SRichard LoweThe driver supports the following device properties which may be tuned through 62bbf21555SRichard Loweits driver.conf file, 63bbf21555SRichard Lowe.Pa /kernel/drv/mlxcx.conf . 64bbf21555SRichard LoweThese properties cannot be changed after the driver has been attached. 65bbf21555SRichard Lowe.Pp 66bbf21555SRichard LoweThese properties are not considered stable at this time, and may change. 67bbf21555SRichard Lowe.Bl -hang -width Ds 68bbf21555SRichard Lowe.It Sy eq_size_shift 69bbf21555SRichard Lowe.Bd -filled -compact 70bbf21555SRichard LoweMinimum: 71bbf21555SRichard Lowe.Sy 2 | 72bbf21555SRichard LoweMaximum: 73bbf21555SRichard Lowe.Sy device dependent (up to 255) 74bbf21555SRichard Lowe.Ed 75bbf21555SRichard Lowe.Bd -filled 76bbf21555SRichard LoweThe 77bbf21555SRichard Lowe.Sy eq_size_shift 78bbf21555SRichard Loweproperty determines the number of entries on Event Queues for the device. 79bbf21555SRichard LoweThe number of entries is calculated as 80bbf21555SRichard Lowe.Dv (1 << eq_size_shift) , 81bbf21555SRichard Loweso a value of 9 would mean 512 entries are created on each Event Queue. 82bbf21555SRichard LoweThe default value is 83bbf21555SRichard Lowe.Sy 9 . 84bbf21555SRichard Lowe.Ed 85bbf21555SRichard Lowe.It Sy cq_size_shift 86bbf21555SRichard Lowe.Bd -filled -compact 87bbf21555SRichard LoweMinimum: 88bbf21555SRichard Lowe.Sy 2 | 89bbf21555SRichard LoweMaximum: 90bbf21555SRichard Lowe.Sy device dependent (up to 255) 91bbf21555SRichard Lowe.Ed 92bbf21555SRichard Lowe.Bd -filled 93bbf21555SRichard LoweThe 94bbf21555SRichard Lowe.Sy cq_size_shift 95bbf21555SRichard Loweproperty determines the number of entries on Completion Queues for the device. 96bbf21555SRichard LoweThe number of entries is calculated as 97bbf21555SRichard Lowe.Li (1 << cq_size_shift) , 98bbf21555SRichard Loweso a value of 9 would mean 512 entries are created on each Event Queue. 99bbf21555SRichard LoweThe default value is device dependent, 100bbf21555SRichard Lowe.Sy 10 101bbf21555SRichard Lowefor devices with maximum supported speed of 10Gb/s or less and 102bbf21555SRichard Lowe.Sy 12 103bbf21555SRichard Lowefor devices with higher supported speeds. 104bbf21555SRichard LoweThis should be kept very close to the value set for 105bbf21555SRichard Lowe.Sy rq_size_shift 106bbf21555SRichard Loweand 107bbf21555SRichard Lowe.Sy sq_size_shift . 108bbf21555SRichard Lowe.Ed 109bbf21555SRichard Lowe.It Sy rq_size_shift 110bbf21555SRichard Lowe.Bd -filled -compact 111bbf21555SRichard LoweMinimum: 112bbf21555SRichard Lowe.Sy 2 | 113bbf21555SRichard LoweMaximum: 114bbf21555SRichard Lowe.Sy device dependent (up to 255) 115bbf21555SRichard Lowe.Ed 116bbf21555SRichard Lowe.Bd -filled 117bbf21555SRichard LoweThe 118bbf21555SRichard Lowe.Sy rq_size_shift 119bbf21555SRichard Loweproperty determines the number of descriptors on Receive Queues for the device. 120bbf21555SRichard LoweThe number of descriptors is calculated as 121bbf21555SRichard Lowe.Dv (1 << rq_size_shift) , 122bbf21555SRichard Loweso a value of 9 would mean 512 descriptors are created on each Receive Queue. 123bbf21555SRichard LoweThis sets the number of packets on RX rings advertised to MAC. 124bbf21555SRichard LoweThe default value is device dependent, 125bbf21555SRichard Lowe.Sy 10 126bbf21555SRichard Lowefor devices with maximum supported speed of 10Gb/s or less and 127bbf21555SRichard Lowe.Sy 12 128bbf21555SRichard Lowefor devices with higher supported speeds. 129bbf21555SRichard Lowe.Ed 130bbf21555SRichard Lowe.It Sy sq_size_shift 131bbf21555SRichard Lowe.Bd -filled -compact 132bbf21555SRichard LoweMinimum: 133bbf21555SRichard Lowe.Sy 2 | 134bbf21555SRichard LoweMaximum: 135bbf21555SRichard Lowe.Sy device dependent (up to 255) 136bbf21555SRichard Lowe.Ed 137bbf21555SRichard Lowe.Bd -filled 138bbf21555SRichard LoweThe 139bbf21555SRichard Lowe.Sy sq_size_shift 140bbf21555SRichard Loweproperty determines the number of descriptors on Send Queues for the device. 141bbf21555SRichard LoweThe number of descriptors is calculated as 142bbf21555SRichard Lowe.Dv (1 << sq_size_shift) , 143bbf21555SRichard Loweso a value of 9 would mean 512 descriptors are created on each Send Queue. 144bbf21555SRichard LoweThis sets the number of packets on RX rings advertised to MAC. 145bbf21555SRichard LoweThe default value is device dependent, 146bbf21555SRichard Lowe.Sy 11 147bbf21555SRichard Lowefor devices with maximum supported speed of 10Gb/s or less and 148bbf21555SRichard Lowe.Sy 13 149bbf21555SRichard Lowefor devices with higher supported speeds. 150bbf21555SRichard LoweNote that large packets often occupy more than one descriptor slot on the SQ, 151bbf21555SRichard Loweso it is sometimes a good idea to increase this if using a large MTU. 152bbf21555SRichard Lowe.Ed 153bbf21555SRichard Lowe.It Sy tx_ngroups 154bbf21555SRichard Lowe.Bd -filled -compact 155bbf21555SRichard LoweMinimum: 156bbf21555SRichard Lowe.Sy 1 | 157bbf21555SRichard LoweMaximum: 158bbf21555SRichard Lowe.Sy device dependent 159bbf21555SRichard Lowe.Ed 160bbf21555SRichard Lowe.Bd -filled 161bbf21555SRichard LoweThe 162bbf21555SRichard Lowe.Sy tx_ngroups 163bbf21555SRichard Loweproperty determines the number of TX groups advertised to MAC. 164bbf21555SRichard LoweThe default value is 165bbf21555SRichard Lowe.Sy 1 . 166bbf21555SRichard Lowe.Ed 167bbf21555SRichard Lowe.It Sy tx_nrings_per_group 168bbf21555SRichard Lowe.Bd -filled -compact 169bbf21555SRichard LoweMinimum: 170bbf21555SRichard Lowe.Sy 1 | 171bbf21555SRichard LoweMaximum: 172bbf21555SRichard Lowe.Sy device dependent 173bbf21555SRichard Lowe.Ed 174bbf21555SRichard Lowe.Bd -filled 175bbf21555SRichard LoweThe 176bbf21555SRichard Lowe.Sy tx_nrings_per_group 177bbf21555SRichard Loweproperty determines the number of rings in each TX group advertised to MAC. 178bbf21555SRichard LoweThe default value is 179bbf21555SRichard Lowe.Sy 64 . 180bbf21555SRichard Lowe.Ed 181bbf21555SRichard Lowe.It Sy rx_ngroups_large 182bbf21555SRichard Lowe.Bd -filled -compact 183bbf21555SRichard LoweMinimum: 184bbf21555SRichard Lowe.Sy 1 | 185bbf21555SRichard LoweMaximum: 186bbf21555SRichard Lowe.Sy device dependent 187bbf21555SRichard Lowe.Ed 188bbf21555SRichard Lowe.Bd -filled 189bbf21555SRichard LoweThe 190bbf21555SRichard Lowe.Sy rx_ngroups_large 191bbf21555SRichard Loweproperty determines the number of "large" RX groups advertised to MAC. 192bbf21555SRichard LoweThe size of "large" RX groups is set by the 193bbf21555SRichard Lowe.Sy rx_nrings_per_large_group 194bbf21555SRichard Loweproperty. 195bbf21555SRichard LoweThe default value is 196bbf21555SRichard Lowe.Sy 2 . 197bbf21555SRichard Lowe.Ed 198bbf21555SRichard Lowe.It Sy rx_nrings_per_large_group 199bbf21555SRichard Lowe.Bd -filled -compact 200bbf21555SRichard LoweMinimum: 201bbf21555SRichard Lowe.Sy 1 | 202bbf21555SRichard LoweMaximum: 203bbf21555SRichard Lowe.Sy device dependent 204bbf21555SRichard Lowe.Ed 205bbf21555SRichard Lowe.Bd -filled 206bbf21555SRichard LoweThe 207bbf21555SRichard Lowe.Sy rx_nrings_per_large_group 208bbf21555SRichard Loweproperty determines the number of rings in each "large" RX group advertised to 209bbf21555SRichard LoweMAC. 210bbf21555SRichard LoweThe number of such groups is determined by the 211bbf21555SRichard Lowe.Sy rx_ngroups_large 212bbf21555SRichard Loweproperty. 213bbf21555SRichard LoweThe default value is 214bbf21555SRichard Lowe.Sy 16 . 215bbf21555SRichard Lowe.Ed 216bbf21555SRichard Lowe.It Sy rx_ngroups_small 217bbf21555SRichard Lowe.Bd -filled -compact 218bbf21555SRichard LoweMinimum: 219bbf21555SRichard Lowe.Sy 1 | 220bbf21555SRichard LoweMaximum: 221bbf21555SRichard Lowe.Sy device dependent 222bbf21555SRichard Lowe.Ed 223bbf21555SRichard Lowe.Bd -filled 224bbf21555SRichard LoweThe 225bbf21555SRichard Lowe.Sy rx_ngroups_small 226bbf21555SRichard Loweproperty determines the number of "small" RX groups advertised to MAC. 227bbf21555SRichard LoweThe size of "small" RX groups is set by the 228bbf21555SRichard Lowe.Sy rx_nrings_per_small_group 229bbf21555SRichard Loweproperty. 230bbf21555SRichard LoweIt is recommended to use many small groups when using a large number of 231bbf21555SRichard LoweVNICs on top of the NIC (e.g. on a system with many zones). 232bbf21555SRichard LoweThe default value is 233bbf21555SRichard Lowe.Sy 256 . 234bbf21555SRichard Lowe.Ed 235bbf21555SRichard Lowe.It Sy rx_nrings_per_small_group 236bbf21555SRichard Lowe.Bd -filled -compact 237bbf21555SRichard LoweMinimum: 238bbf21555SRichard Lowe.Sy 1 | 239bbf21555SRichard LoweMaximum: 240bbf21555SRichard Lowe.Sy device dependent 241bbf21555SRichard Lowe.Ed 242bbf21555SRichard Lowe.Bd -filled 243bbf21555SRichard LoweThe 244bbf21555SRichard Lowe.Sy rx_nrings_per_small_group 245bbf21555SRichard Loweproperty determines the number of rings in each "small" RX group advertised to 246bbf21555SRichard LoweMAC. 247bbf21555SRichard LoweThe number of such groups is determined by the 248bbf21555SRichard Lowe.Sy rx_ngroups_small 249bbf21555SRichard Loweproperty. 250bbf21555SRichard LoweThe default value is 251bbf21555SRichard Lowe.Sy 4 . 252bbf21555SRichard Lowe.Ed 253bbf21555SRichard Lowe.It Sy ftbl_root_size_shift 254bbf21555SRichard Lowe.Bd -filled -compact 255bbf21555SRichard LoweMinimum: 256bbf21555SRichard Lowe.Sy 4 | 257bbf21555SRichard LoweMaximum: 258bbf21555SRichard Lowe.Sy device dependent 259bbf21555SRichard Lowe.Ed 260bbf21555SRichard Lowe.Bd -filled 261bbf21555SRichard LoweThe 262bbf21555SRichard Lowe.Sy ftbl_root_size_shift 263bbf21555SRichard Loweproperty determines the number of flow table entries on the root flow table, 264bbf21555SRichard Loweand therefore how many MAC addresses can be filtered into groups across the 265bbf21555SRichard Loweentire NIC. 266bbf21555SRichard LoweThe number of flow entries is calculated as 267bbf21555SRichard Lowe.Dv (1 << ftbl_root_size_shift) , 268bbf21555SRichard Loweso a value of 9 would mean 512 entries are created in the root flow table. 269bbf21555SRichard LoweThe default value is 270bbf21555SRichard Lowe.Sy 12 . 271bbf21555SRichard Lowe.Ed 272bbf21555SRichard Lowe.It Sy cqemod_period_usec 273bbf21555SRichard Lowe.Bd -filled -compact 274bbf21555SRichard LoweMinimum: 275bbf21555SRichard Lowe.Sy 1 | 276bbf21555SRichard LoweMaximum: 277bbf21555SRichard Lowe.Sy 65535 278bbf21555SRichard Lowe.Ed 279bbf21555SRichard Lowe.Bd -filled 280bbf21555SRichard LoweThe 281bbf21555SRichard Lowe.Sy cqemod_period_usec 282bbf21555SRichard Loweproperty determines the maximum delay after a completion event has occurred 283bbf21555SRichard Lowebefore an event queue entry (and thus an interrupt) is generated. 284bbf21555SRichard LoweThe delay is measured in microseconds. 285bbf21555SRichard LoweThe default value is 286bbf21555SRichard Lowe.Sy 50 . 287bbf21555SRichard Lowe.Ed 288bbf21555SRichard Lowe.It Sy cqemod_count 289bbf21555SRichard Lowe.Bd -filled -compact 290bbf21555SRichard LoweMinimum: 291bbf21555SRichard Lowe.Sy 1 | 292bbf21555SRichard LoweMaximum: 293bbf21555SRichard Lowe.Sy 65535 294bbf21555SRichard Lowe.Ed 295bbf21555SRichard Lowe.Bd -filled 296bbf21555SRichard LoweThe 297bbf21555SRichard Lowe.Sy cqemod_count 298bbf21555SRichard Loweproperty determines the maximum number of completion events that can have 299bbf21555SRichard Loweoccurred before an event queue entry (and thus an interrupt) is generated. 300bbf21555SRichard LoweThe default value is 301bbf21555SRichard Lowe.Sy 80% of the CQ size . 302bbf21555SRichard Lowe.Ed 303bbf21555SRichard Lowe.It Sy intrmod_period_usec 304bbf21555SRichard Lowe.Bd -filled -compact 305bbf21555SRichard LoweMinimum: 306bbf21555SRichard Lowe.Sy 1 | 307bbf21555SRichard LoweMaximum: 308bbf21555SRichard Lowe.Sy 65535 309bbf21555SRichard Lowe.Ed 310bbf21555SRichard Lowe.Bd -filled 311bbf21555SRichard LoweThe 312bbf21555SRichard Lowe.Sy intrmod_period_usec 313bbf21555SRichard Loweproperty determines the maximum delay after an event queue entry has been 314bbf21555SRichard Lowegenerated before an interrupt is raised. 315bbf21555SRichard LoweThe delay is measured in microseconds. 316bbf21555SRichard LoweThe default value is 317bbf21555SRichard Lowe.Sy 10 . 318bbf21555SRichard Lowe.Ed 319bbf21555SRichard Lowe.It Sy tx_bind_threshold 320bbf21555SRichard Lowe.Bd -filled -compact 321bbf21555SRichard LoweMinimum: 322bbf21555SRichard Lowe.Sy 1 | 323bbf21555SRichard LoweMaximum: 324bbf21555SRichard Lowe.Sy 65535 325bbf21555SRichard Lowe.Ed 326bbf21555SRichard Lowe.Bd -filled 327bbf21555SRichard LoweThe 328bbf21555SRichard Lowe.Sy tx_bind_threshold 329bbf21555SRichard Loweproperty determines the minimum number of bytes in a packet before the driver 330bbf21555SRichard Loweuses 331bbf21555SRichard Lowe.Xr ddi_dma_addr_bind_handle 9F 332bbf21555SRichard Loweto bind the packet memory for DMA, rather than copying the memory as it does 333bbf21555SRichard Lowefor small packets. 334bbf21555SRichard LoweDMA binds are expensive and involve taking locks in the PCI nexus driver, so it 335bbf21555SRichard Loweis seldom worth using them for small packets. 336bbf21555SRichard LoweThe default value is 337bbf21555SRichard Lowe.Sy 2048 . 338bbf21555SRichard Lowe.Ed 339bbf21555SRichard Lowe.It Sy rx_limit_per_completion 340bbf21555SRichard Lowe.Bd -filled -compact 341bbf21555SRichard LoweMinimum: 342bbf21555SRichard Lowe.Sy 16 | 343bbf21555SRichard LoweMaximum: 344bbf21555SRichard Lowe.Sy 4096 345bbf21555SRichard Lowe.Ed 346bbf21555SRichard Lowe.Bd -filled 347bbf21555SRichard LoweThe 348bbf21555SRichard Lowe.Sy rx_limit_per_completion 349bbf21555SRichard Loweproperty determines the maximum number of packets that 350bbf21555SRichard Lowewill be processed on a given completion ring during a single interrupt. 351bbf21555SRichard LoweThis is done to try and guarantee some amount of liveness in the system. 352bbf21555SRichard LoweThe default value is 353bbf21555SRichard Lowe.Sy 256 . 354bbf21555SRichard Lowe.Ed 355*5014e1faSAlex Wilson.It Sy rx_p50_loan_min_size 356*5014e1faSAlex Wilson.Bd -filled -compact 357*5014e1faSAlex WilsonMinimum: 358*5014e1faSAlex Wilson.Sy 0 | 359*5014e1faSAlex WilsonMaximum: 360*5014e1faSAlex Wilson.Sy MTU 361*5014e1faSAlex Wilson.Ed 362*5014e1faSAlex Wilson.Bd -filled 363*5014e1faSAlex WilsonThe 364*5014e1faSAlex Wilson.Sy rx_p50_loan_min_size 365*5014e1faSAlex Wilsonproperty determines the minimum size of packet buffers allowed to be loaned 366*5014e1faSAlex Wilsonto MAC when the ring has reached >=50% of its buffers already on loan. 367*5014e1faSAlex WilsonPacket buffers larger than this value will be copied. 368*5014e1faSAlex WilsonAt <50% of ring buffers on loan, all buffers will be loaned. 369*5014e1faSAlex WilsonAt >=75% of buffers on loan, all packets will be copied instead to ensure 370*5014e1faSAlex Wilsonring availability. 371*5014e1faSAlex WilsonThe default value is 372*5014e1faSAlex Wilson.Sy 256 . 373*5014e1faSAlex Wilson.Ed 374bbf21555SRichard Lowe.El 375bbf21555SRichard Lowe.Sh FILES 376bbf21555SRichard Lowe.Bl -tag -width Pa 377bbf21555SRichard Lowe.It Pa /kernel/drv/amd64/mlxcx 378bbf21555SRichard LoweDevice driver (x86) 379bbf21555SRichard Lowe.It Pa /kernel/drv/mlxcx.conf 380bbf21555SRichard LoweDriver configuration file containing user-configurable options 381bbf21555SRichard Lowe.El 382bbf21555SRichard Lowe.Sh SEE ALSO 383bbf21555SRichard Lowe.Xr dlpi 4P , 384bbf21555SRichard Lowe.Xr driver.conf 5 , 385bbf21555SRichard Lowe.Xr dladm 8 , 386bbf21555SRichard Lowe.Xr snoop 8 387