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