2 * Broadcom NetXtreme-C/E network driver.
4 * Copyright (c) 2016 Broadcom, All Rights Reserved.
5 * The term Broadcom refers to Broadcom Limited and/or its subsidiaries
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
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.
29 #include <sys/cdefs.h>
30 __FBSDID("$FreeBSD$");
32 #include <sys/types.h>
33 #include <sys/sysctl.h>
36 #include "bnxt_hwrm.h"
37 #include "bnxt_sysctl.h"
39 static int bnxt_vlan_only_sysctl(SYSCTL_HANDLER_ARGS);
42 * dev.bnxt.0.hwstats.txq0
43 * dev.bnxt.0.hwstats.txq0.txmbufs
44 * dev.bnxt.0.hwstats.rxq0
45 * dev.bnxt.0.hwstats.txq0.rxmbufs
46 * so the hwstats ctx list needs to be created in attach_post and populated
49 * Then, it needs to be cleaned up in stop.
53 bnxt_init_sysctl_ctx(struct bnxt_softc *softc)
55 struct sysctl_ctx_list *ctx;
57 sysctl_ctx_init(&softc->hw_stats);
58 ctx = device_get_sysctl_ctx(softc->dev);
59 softc->hw_stats_oid = SYSCTL_ADD_NODE(ctx,
60 SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO,
61 "hwstats", CTLFLAG_RD, 0, "hardware statistics");
62 if (!softc->hw_stats_oid) {
63 sysctl_ctx_free(&softc->hw_stats);
67 sysctl_ctx_init(&softc->ver_info->ver_ctx);
68 ctx = device_get_sysctl_ctx(softc->dev);
69 softc->ver_info->ver_oid = SYSCTL_ADD_NODE(ctx,
70 SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO,
71 "ver", CTLFLAG_RD, 0, "hardware/firmware version information");
72 if (!softc->ver_info->ver_oid) {
73 sysctl_ctx_free(&softc->ver_info->ver_ctx);
77 sysctl_ctx_init(&softc->nvm_info->nvm_ctx);
78 ctx = device_get_sysctl_ctx(softc->dev);
79 softc->nvm_info->nvm_oid = SYSCTL_ADD_NODE(ctx,
80 SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO,
81 "nvram", CTLFLAG_RD, 0, "nvram information");
82 if (!softc->nvm_info->nvm_oid) {
83 sysctl_ctx_free(&softc->nvm_info->nvm_ctx);
87 sysctl_ctx_init(&softc->hw_lro_ctx);
88 ctx = device_get_sysctl_ctx(softc->dev);
89 softc->hw_lro_oid = SYSCTL_ADD_NODE(ctx,
90 SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO,
91 "hw_lro", CTLFLAG_RD, 0, "hardware lro");
92 if (!softc->hw_lro_oid) {
93 sysctl_ctx_free(&softc->hw_lro_ctx);
97 sysctl_ctx_init(&softc->flow_ctrl_ctx);
98 ctx = device_get_sysctl_ctx(softc->dev);
99 softc->flow_ctrl_oid = SYSCTL_ADD_NODE(ctx,
100 SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO,
101 "fc", CTLFLAG_RD, 0, "flow ctrl");
102 if (!softc->flow_ctrl_oid) {
103 sysctl_ctx_free(&softc->flow_ctrl_ctx);
111 bnxt_free_sysctl_ctx(struct bnxt_softc *softc)
116 if (softc->hw_stats_oid != NULL) {
117 orc = sysctl_ctx_free(&softc->hw_stats);
121 softc->hw_stats_oid = NULL;
123 if (softc->ver_info->ver_oid != NULL) {
124 orc = sysctl_ctx_free(&softc->ver_info->ver_ctx);
128 softc->ver_info->ver_oid = NULL;
130 if (softc->nvm_info->nvm_oid != NULL) {
131 orc = sysctl_ctx_free(&softc->nvm_info->nvm_ctx);
135 softc->nvm_info->nvm_oid = NULL;
137 if (softc->hw_lro_oid != NULL) {
138 orc = sysctl_ctx_free(&softc->hw_lro_ctx);
142 softc->hw_lro_oid = NULL;
145 if (softc->flow_ctrl_oid != NULL) {
146 orc = sysctl_ctx_free(&softc->flow_ctrl_ctx);
150 softc->flow_ctrl_oid = NULL;
157 bnxt_create_tx_sysctls(struct bnxt_softc *softc, int txr)
159 struct sysctl_oid *oid;
160 struct ctx_hw_stats *tx_stats = (void *)softc->tx_stats.idi_vaddr;
164 sprintf(name, "txq%d", txr);
165 sprintf(desc, "transmit queue %d", txr);
166 oid = SYSCTL_ADD_NODE(&softc->hw_stats,
167 SYSCTL_CHILDREN(softc->hw_stats_oid), OID_AUTO, name, CTLFLAG_RD, 0,
173 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
174 "ucast_pkts", CTLFLAG_RD, &tx_stats[txr].tx_ucast_pkts,
175 "unicast packets sent");
176 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
177 "mcast_pkts", CTLFLAG_RD, &tx_stats[txr].tx_mcast_pkts,
178 "multicast packets sent");
179 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
180 "bcast_pkts", CTLFLAG_RD, &tx_stats[txr].tx_bcast_pkts,
181 "broadcast packets sent");
182 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
183 "discard_pkts", CTLFLAG_RD,
184 &tx_stats[txr].tx_discard_pkts, "discarded transmit packets");
185 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
186 "drop_pkts", CTLFLAG_RD, &tx_stats[txr].tx_drop_pkts,
187 "dropped transmit packets");
188 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
189 "ucast_bytes", CTLFLAG_RD, &tx_stats[txr].tx_ucast_bytes,
190 "unicast bytes sent");
191 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
192 "mcast_bytes", CTLFLAG_RD, &tx_stats[txr].tx_mcast_bytes,
193 "multicast bytes sent");
194 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
195 "bcast_bytes", CTLFLAG_RD, &tx_stats[txr].tx_bcast_bytes,
196 "broadcast bytes sent");
202 bnxt_create_port_stats_sysctls(struct bnxt_softc *softc)
204 struct sysctl_oid *oid;
208 sprintf(name, "port_stats");
209 sprintf(desc, "Port Stats");
210 oid = SYSCTL_ADD_NODE(&softc->hw_stats,
211 SYSCTL_CHILDREN(softc->hw_stats_oid), OID_AUTO, name, CTLFLAG_RD, 0,
216 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
217 "tx_64b_frames", CTLFLAG_RD,
218 &softc->tx_port_stats->tx_64b_frames, "Transmitted 64b frames");
219 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
220 "tx_65b_127b_frames", CTLFLAG_RD,
221 &softc->tx_port_stats->tx_65b_127b_frames,
222 "Transmitted 65b 127b frames");
223 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
224 "tx_128b_255b_frames", CTLFLAG_RD,
225 &softc->tx_port_stats->tx_128b_255b_frames,
226 "Transmitted 128b 255b frames");
227 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
228 "tx_256b_511b_frames", CTLFLAG_RD,
229 &softc->tx_port_stats->tx_256b_511b_frames,
230 "Transmitted 256b 511b frames");
231 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
232 "tx_512b_1023b_frames", CTLFLAG_RD,
233 &softc->tx_port_stats->tx_512b_1023b_frames,
234 "Transmitted 512b 1023b frames");
235 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
236 "tx_1024b_1518_frames", CTLFLAG_RD,
237 &softc->tx_port_stats->tx_1024b_1518_frames,
238 "Transmitted 1024b 1518 frames");
239 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
240 "tx_good_vlan_frames", CTLFLAG_RD,
241 &softc->tx_port_stats->tx_good_vlan_frames,
242 "Transmitted good vlan frames");
243 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
244 "tx_1519b_2047_frames", CTLFLAG_RD,
245 &softc->tx_port_stats->tx_1519b_2047_frames,
246 "Transmitted 1519b 2047 frames");
247 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
248 "tx_2048b_4095b_frames", CTLFLAG_RD,
249 &softc->tx_port_stats->tx_2048b_4095b_frames,
250 "Transmitted 2048b 4095b frames");
251 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
252 "tx_4096b_9216b_frames", CTLFLAG_RD,
253 &softc->tx_port_stats->tx_4096b_9216b_frames,
254 "Transmitted 4096b 9216b frames");
255 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
256 "tx_9217b_16383b_frames", CTLFLAG_RD,
257 &softc->tx_port_stats->tx_9217b_16383b_frames,
258 "Transmitted 9217b 16383b frames");
259 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
260 "tx_good_frames", CTLFLAG_RD,
261 &softc->tx_port_stats->tx_good_frames, "Transmitted good frames");
262 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
263 "tx_total_frames", CTLFLAG_RD,
264 &softc->tx_port_stats->tx_total_frames, "Transmitted total frames");
265 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
266 "tx_ucast_frames", CTLFLAG_RD,
267 &softc->tx_port_stats->tx_ucast_frames, "Transmitted ucast frames");
268 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
269 "tx_mcast_frames", CTLFLAG_RD,
270 &softc->tx_port_stats->tx_mcast_frames, "Transmitted mcast frames");
271 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
272 "tx_bcast_frames", CTLFLAG_RD,
273 &softc->tx_port_stats->tx_bcast_frames, "Transmitted bcast frames");
274 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
275 "tx_pause_frames", CTLFLAG_RD,
276 &softc->tx_port_stats->tx_pause_frames, "Transmitted pause frames");
277 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
278 "tx_pfc_frames", CTLFLAG_RD,
279 &softc->tx_port_stats->tx_pfc_frames, "Transmitted pfc frames");
280 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
281 "tx_jabber_frames", CTLFLAG_RD,
282 &softc->tx_port_stats->tx_jabber_frames, "Transmitted jabber frames");
283 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
284 "tx_fcs_err_frames", CTLFLAG_RD,
285 &softc->tx_port_stats->tx_fcs_err_frames,
286 "Transmitted fcs err frames");
287 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
288 "tx_control_frames", CTLFLAG_RD,
289 &softc->tx_port_stats->tx_control_frames,
290 "Transmitted control frames");
291 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
292 "tx_oversz_frames", CTLFLAG_RD,
293 &softc->tx_port_stats->tx_oversz_frames, "Transmitted oversz frames");
294 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
295 "tx_single_dfrl_frames", CTLFLAG_RD,
296 &softc->tx_port_stats->tx_single_dfrl_frames,
297 "Transmitted single dfrl frames");
298 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
299 "tx_multi_dfrl_frames", CTLFLAG_RD,
300 &softc->tx_port_stats->tx_multi_dfrl_frames,
301 "Transmitted multi dfrl frames");
302 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
303 "tx_single_coll_frames", CTLFLAG_RD,
304 &softc->tx_port_stats->tx_single_coll_frames,
305 "Transmitted single coll frames");
306 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
307 "tx_multi_coll_frames", CTLFLAG_RD,
308 &softc->tx_port_stats->tx_multi_coll_frames,
309 "Transmitted multi coll frames");
310 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
311 "tx_late_coll_frames", CTLFLAG_RD,
312 &softc->tx_port_stats->tx_late_coll_frames,
313 "Transmitted late coll frames");
314 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
315 "tx_excessive_coll_frames", CTLFLAG_RD,
316 &softc->tx_port_stats->tx_excessive_coll_frames,
317 "Transmitted excessive coll frames");
318 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
319 "tx_frag_frames", CTLFLAG_RD,
320 &softc->tx_port_stats->tx_frag_frames, "Transmitted frag frames");
321 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
322 "tx_err", CTLFLAG_RD,
323 &softc->tx_port_stats->tx_err, "Transmitted err");
324 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
325 "tx_tagged_frames", CTLFLAG_RD,
326 &softc->tx_port_stats->tx_tagged_frames, "Transmitted tagged frames");
327 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
328 "tx_dbl_tagged_frames", CTLFLAG_RD,
329 &softc->tx_port_stats->tx_dbl_tagged_frames,
330 "Transmitted dbl tagged frames");
331 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
332 "tx_runt_frames", CTLFLAG_RD,
333 &softc->tx_port_stats->tx_runt_frames, "Transmitted runt frames");
334 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
335 "tx_fifo_underruns", CTLFLAG_RD,
336 &softc->tx_port_stats->tx_fifo_underruns,
337 "Transmitted fifo underruns");
338 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
339 "tx_pfc_ena_frames_pri0", CTLFLAG_RD,
340 &softc->tx_port_stats->tx_pfc_ena_frames_pri0,
341 "Transmitted pfc ena frames pri0");
342 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
343 "tx_pfc_ena_frames_pri1", CTLFLAG_RD,
344 &softc->tx_port_stats->tx_pfc_ena_frames_pri1,
345 "Transmitted pfc ena frames pri1");
346 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
347 "tx_pfc_ena_frames_pri2", CTLFLAG_RD,
348 &softc->tx_port_stats->tx_pfc_ena_frames_pri2,
349 "Transmitted pfc ena frames pri2");
350 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
351 "tx_pfc_ena_frames_pri3", CTLFLAG_RD,
352 &softc->tx_port_stats->tx_pfc_ena_frames_pri3,
353 "Transmitted pfc ena frames pri3");
354 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
355 "tx_pfc_ena_frames_pri4", CTLFLAG_RD,
356 &softc->tx_port_stats->tx_pfc_ena_frames_pri4,
357 "Transmitted pfc ena frames pri4");
358 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
359 "tx_pfc_ena_frames_pri5", CTLFLAG_RD,
360 &softc->tx_port_stats->tx_pfc_ena_frames_pri5,
361 "Transmitted pfc ena frames pri5");
362 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
363 "tx_pfc_ena_frames_pri6", CTLFLAG_RD,
364 &softc->tx_port_stats->tx_pfc_ena_frames_pri6,
365 "Transmitted pfc ena frames pri6");
366 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
367 "tx_pfc_ena_frames_pri7", CTLFLAG_RD,
368 &softc->tx_port_stats->tx_pfc_ena_frames_pri7,
369 "Transmitted pfc ena frames pri7");
370 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
371 "tx_eee_lpi_events", CTLFLAG_RD,
372 &softc->tx_port_stats->tx_eee_lpi_events,
373 "Transmitted eee lpi events");
374 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
375 "tx_eee_lpi_duration", CTLFLAG_RD,
376 &softc->tx_port_stats->tx_eee_lpi_duration,
377 "Transmitted eee lpi duration");
378 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
379 "tx_llfc_logical_msgs", CTLFLAG_RD,
380 &softc->tx_port_stats->tx_llfc_logical_msgs,
381 "Transmitted llfc logical msgs");
382 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
383 "tx_hcfc_msgs", CTLFLAG_RD,
384 &softc->tx_port_stats->tx_hcfc_msgs, "Transmitted hcfc msgs");
385 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
386 "tx_total_collisions", CTLFLAG_RD,
387 &softc->tx_port_stats->tx_total_collisions,
388 "Transmitted total collisions");
389 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
390 "tx_bytes", CTLFLAG_RD,
391 &softc->tx_port_stats->tx_bytes, "Transmitted bytes");
392 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
393 "tx_xthol_frames", CTLFLAG_RD,
394 &softc->tx_port_stats->tx_xthol_frames, "Transmitted xthol frames");
395 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
396 "tx_stat_discard", CTLFLAG_RD,
397 &softc->tx_port_stats->tx_stat_discard, "Transmitted stat discard");
398 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
399 "tx_stat_error", CTLFLAG_RD,
400 &softc->tx_port_stats->tx_stat_error, "Transmitted stat error");
401 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
402 "rx_64b_frames", CTLFLAG_RD,
403 &softc->rx_port_stats->rx_64b_frames, "Received 64b frames");
404 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
405 "rx_65b_127b_frames", CTLFLAG_RD,
406 &softc->rx_port_stats->rx_65b_127b_frames, "Received 65b 127b frames");
407 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
408 "rx_128b_255b_frames", CTLFLAG_RD,
409 &softc->rx_port_stats->rx_128b_255b_frames,
410 "Received 128b 255b frames");
411 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
412 "rx_256b_511b_frames", CTLFLAG_RD,
413 &softc->rx_port_stats->rx_256b_511b_frames,
414 "Received 256b 511b frames");
415 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
416 "rx_512b_1023b_frames", CTLFLAG_RD,
417 &softc->rx_port_stats->rx_512b_1023b_frames,
418 "Received 512b 1023b frames");
419 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
420 "rx_1024b_1518_frames", CTLFLAG_RD,
421 &softc->rx_port_stats->rx_1024b_1518_frames,
422 "Received 1024b 1518 frames");
423 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
424 "rx_good_vlan_frames", CTLFLAG_RD,
425 &softc->rx_port_stats->rx_good_vlan_frames,
426 "Received good vlan frames");
427 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
428 "rx_1519b_2047b_frames", CTLFLAG_RD,
429 &softc->rx_port_stats->rx_1519b_2047b_frames,
430 "Received 1519b 2047b frames");
431 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
432 "rx_2048b_4095b_frames", CTLFLAG_RD,
433 &softc->rx_port_stats->rx_2048b_4095b_frames,
434 "Received 2048b 4095b frames");
435 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
436 "rx_4096b_9216b_frames", CTLFLAG_RD,
437 &softc->rx_port_stats->rx_4096b_9216b_frames,
438 "Received 4096b 9216b frames");
439 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
440 "rx_9217b_16383b_frames", CTLFLAG_RD,
441 &softc->rx_port_stats->rx_9217b_16383b_frames,
442 "Received 9217b 16383b frames");
443 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
444 "rx_total_frames", CTLFLAG_RD,
445 &softc->rx_port_stats->rx_total_frames, "Received total frames");
446 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
447 "rx_ucast_frames", CTLFLAG_RD,
448 &softc->rx_port_stats->rx_ucast_frames, "Received ucast frames");
449 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
450 "rx_mcast_frames", CTLFLAG_RD,
451 &softc->rx_port_stats->rx_mcast_frames, "Received mcast frames");
452 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
453 "rx_bcast_frames", CTLFLAG_RD,
454 &softc->rx_port_stats->rx_bcast_frames, "Received bcast frames");
455 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
456 "rx_fcs_err_frames", CTLFLAG_RD,
457 &softc->rx_port_stats->rx_fcs_err_frames, "Received fcs err frames");
458 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
459 "rx_ctrl_frames", CTLFLAG_RD,
460 &softc->rx_port_stats->rx_ctrl_frames, "Received ctrl frames");
461 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
462 "rx_pause_frames", CTLFLAG_RD,
463 &softc->rx_port_stats->rx_pause_frames, "Received pause frames");
464 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
465 "rx_pfc_frames", CTLFLAG_RD,
466 &softc->rx_port_stats->rx_pfc_frames, "Received pfc frames");
467 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
468 "rx_unsupported_opcode_frames", CTLFLAG_RD,
469 &softc->rx_port_stats->rx_unsupported_opcode_frames,
470 "Received unsupported opcode frames");
471 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
472 "rx_unsupported_da_pausepfc_frames", CTLFLAG_RD,
473 &softc->rx_port_stats->rx_unsupported_da_pausepfc_frames,
474 "Received unsupported da pausepfc frames");
475 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
476 "rx_wrong_sa_frames", CTLFLAG_RD,
477 &softc->rx_port_stats->rx_wrong_sa_frames,
478 "Received wrong sa frames");
479 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
480 "rx_align_err_frames", CTLFLAG_RD,
481 &softc->rx_port_stats->rx_align_err_frames,
482 "Received align err frames");
483 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
484 "rx_oor_len_frames", CTLFLAG_RD,
485 &softc->rx_port_stats->rx_oor_len_frames,
486 "Received oor len frames");
487 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
488 "rx_code_err_frames", CTLFLAG_RD,
489 &softc->rx_port_stats->rx_code_err_frames,
490 "Received code err frames");
491 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
492 "rx_false_carrier_frames", CTLFLAG_RD,
493 &softc->rx_port_stats->rx_false_carrier_frames,
494 "Received false carrier frames");
495 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
496 "rx_ovrsz_frames", CTLFLAG_RD,
497 &softc->rx_port_stats->rx_ovrsz_frames,
498 "Received ovrsz frames");
499 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
500 "rx_jbr_frames", CTLFLAG_RD,
501 &softc->rx_port_stats->rx_jbr_frames,
502 "Received jbr frames");
503 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
504 "rx_mtu_err_frames", CTLFLAG_RD,
505 &softc->rx_port_stats->rx_mtu_err_frames,
506 "Received mtu err frames");
507 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
508 "rx_match_crc_frames", CTLFLAG_RD,
509 &softc->rx_port_stats->rx_match_crc_frames,
510 "Received match crc frames");
511 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
512 "rx_promiscuous_frames", CTLFLAG_RD,
513 &softc->rx_port_stats->rx_promiscuous_frames,
514 "Received promiscuous frames");
515 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
516 "rx_tagged_frames", CTLFLAG_RD,
517 &softc->rx_port_stats->rx_tagged_frames,
518 "Received tagged frames");
519 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
520 "rx_double_tagged_frames", CTLFLAG_RD,
521 &softc->rx_port_stats->rx_double_tagged_frames,
522 "Received double tagged frames");
523 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
524 "rx_trunc_frames", CTLFLAG_RD,
525 &softc->rx_port_stats->rx_trunc_frames,
526 "Received trunc frames");
527 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
528 "rx_good_frames", CTLFLAG_RD,
529 &softc->rx_port_stats->rx_good_frames,
530 "Received good frames");
531 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
532 "rx_pfc_xon2xoff_frames_pri0", CTLFLAG_RD,
533 &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri0,
534 "Received pfc xon2xoff frames pri0");
535 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
536 "rx_pfc_xon2xoff_frames_pri1", CTLFLAG_RD,
537 &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri1,
538 "Received pfc xon2xoff frames pri1");
539 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
540 "rx_pfc_xon2xoff_frames_pri2", CTLFLAG_RD,
541 &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri2,
542 "Received pfc xon2xoff frames pri2");
543 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
544 "rx_pfc_xon2xoff_frames_pri3", CTLFLAG_RD,
545 &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri3,
546 "Received pfc xon2xoff frames pri3");
547 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
548 "rx_pfc_xon2xoff_frames_pri4", CTLFLAG_RD,
549 &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri4,
550 "Received pfc xon2xoff frames pri4");
551 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
552 "rx_pfc_xon2xoff_frames_pri5", CTLFLAG_RD,
553 &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri5,
554 "Received pfc xon2xoff frames pri5");
555 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
556 "rx_pfc_xon2xoff_frames_pri6", CTLFLAG_RD,
557 &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri6,
558 "Received pfc xon2xoff frames pri6");
559 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
560 "rx_pfc_xon2xoff_frames_pri7", CTLFLAG_RD,
561 &softc->rx_port_stats->rx_pfc_xon2xoff_frames_pri7,
562 "Received pfc xon2xoff frames pri7");
563 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
564 "rx_pfc_ena_frames_pri0", CTLFLAG_RD,
565 &softc->rx_port_stats->rx_pfc_ena_frames_pri0,
566 "Received pfc ena frames pri0");
567 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
568 "rx_pfc_ena_frames_pri1", CTLFLAG_RD,
569 &softc->rx_port_stats->rx_pfc_ena_frames_pri1,
570 "Received pfc ena frames pri1");
571 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
572 "rx_pfc_ena_frames_pri2", CTLFLAG_RD,
573 &softc->rx_port_stats->rx_pfc_ena_frames_pri2,
574 "Received pfc ena frames pri2");
575 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
576 "rx_pfc_ena_frames_pri3", CTLFLAG_RD,
577 &softc->rx_port_stats->rx_pfc_ena_frames_pri3,
578 "Received pfc ena frames pri3");
579 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
580 "rx_pfc_ena_frames_pri4", CTLFLAG_RD,
581 &softc->rx_port_stats->rx_pfc_ena_frames_pri4,
582 "Received pfc ena frames pri4");
583 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
584 "rx_pfc_ena_frames_pri5", CTLFLAG_RD,
585 &softc->rx_port_stats->rx_pfc_ena_frames_pri5,
586 "Received pfc ena frames pri5");
587 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
588 "rx_pfc_ena_frames_pri6", CTLFLAG_RD,
589 &softc->rx_port_stats->rx_pfc_ena_frames_pri6,
590 "Received pfc ena frames pri6");
591 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
592 "rx_pfc_ena_frames_pri7", CTLFLAG_RD,
593 &softc->rx_port_stats->rx_pfc_ena_frames_pri7,
594 "Received pfc ena frames pri7");
595 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
596 "rx_sch_crc_err_frames", CTLFLAG_RD,
597 &softc->rx_port_stats->rx_sch_crc_err_frames,
598 "Received sch crc err frames");
599 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
600 "rx_undrsz_frames", CTLFLAG_RD,
601 &softc->rx_port_stats->rx_undrsz_frames, "Received undrsz frames");
602 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
603 "rx_frag_frames", CTLFLAG_RD,
604 &softc->rx_port_stats->rx_frag_frames, "Received frag frames");
605 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
606 "rx_eee_lpi_events", CTLFLAG_RD,
607 &softc->rx_port_stats->rx_eee_lpi_events, "Received eee lpi events");
608 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
609 "rx_eee_lpi_duration", CTLFLAG_RD,
610 &softc->rx_port_stats->rx_eee_lpi_duration,
611 "Received eee lpi duration");
612 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
613 "rx_llfc_physical_msgs", CTLFLAG_RD,
614 &softc->rx_port_stats->rx_llfc_physical_msgs,
615 "Received llfc physical msgs");
616 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
617 "rx_llfc_logical_msgs", CTLFLAG_RD,
618 &softc->rx_port_stats->rx_llfc_logical_msgs,
619 "Received llfc logical msgs");
620 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
621 "rx_llfc_msgs_with_crc_err", CTLFLAG_RD,
622 &softc->rx_port_stats->rx_llfc_msgs_with_crc_err,
623 "Received llfc msgs with crc err");
624 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
625 "rx_hcfc_msgs", CTLFLAG_RD,
626 &softc->rx_port_stats->rx_hcfc_msgs, "Received hcfc msgs");
627 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
628 "rx_hcfc_msgs_with_crc_err", CTLFLAG_RD,
629 &softc->rx_port_stats->rx_hcfc_msgs_with_crc_err,
630 "Received hcfc msgs with crc err");
631 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
632 "rx_bytes", CTLFLAG_RD,
633 &softc->rx_port_stats->rx_bytes, "Received bytes");
634 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
635 "rx_runt_bytes", CTLFLAG_RD,
636 &softc->rx_port_stats->rx_runt_bytes, "Received runt bytes");
637 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
638 "rx_runt_frames", CTLFLAG_RD,
639 &softc->rx_port_stats->rx_runt_frames, "Received runt frames");
640 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
641 "rx_stat_discard", CTLFLAG_RD,
642 &softc->rx_port_stats->rx_stat_discard, "Received stat discard");
643 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
644 "rx_stat_err", CTLFLAG_RD,
645 &softc->rx_port_stats->rx_stat_err, "Received stat err");
652 bnxt_create_rx_sysctls(struct bnxt_softc *softc, int rxr)
654 struct sysctl_oid *oid;
655 struct ctx_hw_stats *rx_stats = (void *)softc->rx_stats.idi_vaddr;
659 sprintf(name, "rxq%d", rxr);
660 sprintf(desc, "receive queue %d", rxr);
661 oid = SYSCTL_ADD_NODE(&softc->hw_stats,
662 SYSCTL_CHILDREN(softc->hw_stats_oid), OID_AUTO, name, CTLFLAG_RD, 0,
667 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
668 "ucast_pkts", CTLFLAG_RD, &rx_stats[rxr].rx_ucast_pkts,
669 "unicast packets received");
670 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
671 "mcast_pkts", CTLFLAG_RD, &rx_stats[rxr].rx_mcast_pkts,
672 "multicast packets received");
673 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
674 "bcast_pkts", CTLFLAG_RD, &rx_stats[rxr].rx_bcast_pkts,
675 "broadcast packets received");
676 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
677 "discard_pkts", CTLFLAG_RD,
678 &rx_stats[rxr].rx_discard_pkts, "discarded receive packets");
679 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
680 "drop_pkts", CTLFLAG_RD, &rx_stats[rxr].rx_drop_pkts,
681 "dropped receive packets");
682 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
683 "ucast_bytes", CTLFLAG_RD, &rx_stats[rxr].rx_ucast_bytes,
684 "unicast bytes received");
685 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
686 "mcast_bytes", CTLFLAG_RD, &rx_stats[rxr].rx_mcast_bytes,
687 "multicast bytes received");
688 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
689 "bcast_bytes", CTLFLAG_RD, &rx_stats[rxr].rx_bcast_bytes,
690 "broadcast bytes received");
692 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
693 "tpa_pkts", CTLFLAG_RD, &rx_stats[rxr].tpa_pkts,
695 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
696 "tpa_bytes", CTLFLAG_RD, &rx_stats[rxr].tpa_bytes,
698 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
699 "tpa_events", CTLFLAG_RD, &rx_stats[rxr].tpa_events,
701 SYSCTL_ADD_QUAD(&softc->hw_stats, SYSCTL_CHILDREN(oid), OID_AUTO,
702 "tpa_aborts", CTLFLAG_RD, &rx_stats[rxr].tpa_aborts,
708 static char *bnxt_chip_type[] = {
714 #define MAX_CHIP_TYPE 3
717 bnxt_package_ver_sysctl(SYSCTL_HANDLER_ARGS)
719 struct bnxt_softc *softc = arg1;
720 struct iflib_dma_info dma_data;
724 char unk[] = "<unknown>";
728 uint16_t ordinal = BNX_DIR_ORDINAL_FIRST;
732 rc = bnxt_hwrm_nvm_find_dir_entry(softc, BNX_DIR_TYPE_PKG_LOG,
733 &ordinal, BNX_DIR_EXT_NONE, &index, false,
734 HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ,
735 &data_len, NULL, NULL);
736 dma_data.idi_vaddr = NULL;
737 if (rc == 0 && data_len) {
738 rc = iflib_dma_alloc(softc->ctx, data_len, &dma_data,
741 rc = bnxt_hwrm_nvm_read(softc, index, 0, data_len,
744 pkglog = dma_data.idi_vaddr;
745 /* NULL terminate (removes last \n) */
746 pkglog[data_len-1] = 0;
748 /* Set p = start of last line */
749 p = strrchr(pkglog, '\n');
753 /* Now find the correct tab delimited field */
754 for (field = 0, next = p,
755 p = strsep(&next, "\t");
757 BNX_PKG_LOG_FIELD_IDX_PKG_VERSION && p;
758 p = strsep(&next, "\t")) {
761 if (field == BNX_PKG_LOG_FIELD_IDX_PKG_VERSION)
766 dma_data.idi_vaddr = NULL;
769 rc = sysctl_handle_string(oidp, buf, 0, req);
770 if (dma_data.idi_vaddr)
771 iflib_dma_free(&dma_data);
776 bnxt_hwrm_min_ver_sysctl(SYSCTL_HANDLER_ARGS)
778 struct bnxt_softc *softc = arg1;
783 sprintf(buf, "%hhu.%hhu.%hhu", softc->ver_info->hwrm_min_major,
784 softc->ver_info->hwrm_min_minor, softc->ver_info->hwrm_min_update);
786 rc = sysctl_handle_string(oidp, buf, sizeof(buf), req);
787 if (rc || req->newptr == NULL)
789 if (sscanf(buf, "%hhu.%hhu.%hhu%*c", &newver[0], &newver[1],
792 softc->ver_info->hwrm_min_major = newver[0];
793 softc->ver_info->hwrm_min_minor = newver[1];
794 softc->ver_info->hwrm_min_update = newver[2];
795 bnxt_check_hwrm_version(softc);
801 bnxt_create_ver_sysctls(struct bnxt_softc *softc)
803 struct bnxt_ver_info *vi = softc->ver_info;
804 struct sysctl_oid *oid = vi->ver_oid;
809 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
810 "hwrm_if", CTLFLAG_RD, vi->hwrm_if_ver, 0,
811 "HWRM interface version");
812 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
813 "driver_hwrm_if", CTLFLAG_RD, vi->driver_hwrm_if_ver, 0,
814 "HWRM firmware version");
815 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
816 "hwrm_fw", CTLFLAG_RD, vi->hwrm_fw_ver, 0,
817 "HWRM firmware version");
818 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
819 "mgmt_fw", CTLFLAG_RD, vi->mgmt_fw_ver, 0,
820 "management firmware version");
821 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
822 "netctrl_fw", CTLFLAG_RD, vi->netctrl_fw_ver, 0,
823 "network control firmware version");
824 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
825 "roce_fw", CTLFLAG_RD, vi->roce_fw_ver, 0,
826 "RoCE firmware version");
827 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
828 "phy", CTLFLAG_RD, vi->phy_ver, 0,
830 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
831 "hwrm_fw_name", CTLFLAG_RD, vi->hwrm_fw_name, 0,
832 "HWRM firmware name");
833 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
834 "mgmt_fw_name", CTLFLAG_RD, vi->mgmt_fw_name, 0,
835 "management firmware name");
836 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
837 "netctrl_fw_name", CTLFLAG_RD, vi->netctrl_fw_name, 0,
838 "network control firmware name");
839 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
840 "roce_fw_name", CTLFLAG_RD, vi->roce_fw_name, 0,
841 "RoCE firmware name");
842 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
843 "phy_vendor", CTLFLAG_RD, vi->phy_vendor, 0,
845 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
846 "phy_partnumber", CTLFLAG_RD, vi->phy_partnumber, 0,
847 "PHY vendor part number");
848 SYSCTL_ADD_U16(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
849 "chip_num", CTLFLAG_RD, &vi->chip_num, 0, "chip number");
850 SYSCTL_ADD_U8(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
851 "chip_rev", CTLFLAG_RD, &vi->chip_rev, 0, "chip revision");
852 SYSCTL_ADD_U8(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
853 "chip_metal", CTLFLAG_RD, &vi->chip_metal, 0, "chip metal number");
854 SYSCTL_ADD_U8(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
855 "chip_bond_id", CTLFLAG_RD, &vi->chip_bond_id, 0,
857 SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
858 "chip_type", CTLFLAG_RD, vi->chip_type > MAX_CHIP_TYPE ?
859 bnxt_chip_type[MAX_CHIP_TYPE] : bnxt_chip_type[vi->chip_type], 0,
860 "RoCE firmware name");
861 SYSCTL_ADD_PROC(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
862 "package_ver", CTLTYPE_STRING|CTLFLAG_RD, softc, 0,
863 bnxt_package_ver_sysctl, "A",
864 "currently installed package version");
865 SYSCTL_ADD_PROC(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
866 "hwrm_min_ver", CTLTYPE_STRING|CTLFLAG_RWTUN, softc, 0,
867 bnxt_hwrm_min_ver_sysctl, "A",
868 "minimum hwrm API vesion to support");
874 bnxt_create_nvram_sysctls(struct bnxt_nvram_info *ni)
876 struct sysctl_oid *oid = ni->nvm_oid;
881 SYSCTL_ADD_U16(&ni->nvm_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
882 "mfg_id", CTLFLAG_RD, &ni->mfg_id, 0, "manufacturer id");
883 SYSCTL_ADD_U16(&ni->nvm_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
884 "device_id", CTLFLAG_RD, &ni->device_id, 0, "device id");
885 SYSCTL_ADD_U32(&ni->nvm_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
886 "sector_size", CTLFLAG_RD, &ni->sector_size, 0, "sector size");
887 SYSCTL_ADD_U32(&ni->nvm_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
888 "size", CTLFLAG_RD, &ni->size, 0, "nvram total size");
889 SYSCTL_ADD_U32(&ni->nvm_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
890 "reserved_size", CTLFLAG_RD, &ni->reserved_size, 0,
891 "total reserved space");
892 SYSCTL_ADD_U32(&ni->nvm_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
893 "available_size", CTLFLAG_RD, &ni->available_size, 0,
894 "total available space");
900 bnxt_rss_key_sysctl(SYSCTL_HANDLER_ARGS)
902 struct bnxt_softc *softc = arg1;
903 char buf[HW_HASH_KEY_SIZE*2+1] = {0};
908 for (p = buf, i=0; i<HW_HASH_KEY_SIZE; i++)
909 p += sprintf(p, "%02x", softc->vnic_info.rss_hash_key[i]);
911 rc = sysctl_handle_string(oidp, buf, sizeof(buf), req);
912 if (rc || req->newptr == NULL)
915 if (strspn(buf, "0123456789abcdefABCDEF") != (HW_HASH_KEY_SIZE * 2))
918 for (p = buf, i=0; i<HW_HASH_KEY_SIZE; i++) {
919 if (sscanf(p, "%02hhx", &softc->vnic_info.rss_hash_key[i]) != 1)
924 if (if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING)
925 bnxt_hwrm_rss_cfg(softc, &softc->vnic_info,
926 softc->vnic_info.rss_hash_type);
931 static const char *bnxt_hash_types[] = {"ipv4", "tcp_ipv4", "udp_ipv4", "ipv6",
932 "tcp_ipv6", "udp_ipv6", NULL};
934 static int bnxt_get_rss_type_str_bit(char *str)
938 for (i=0; bnxt_hash_types[i]; i++)
939 if (strcmp(bnxt_hash_types[i], str) == 0)
946 bnxt_rss_type_sysctl(SYSCTL_HANDLER_ARGS)
948 struct bnxt_softc *softc = arg1;
956 for (type = softc->vnic_info.rss_hash_type; type;
959 if (bit >= sizeof(bnxt_hash_types) / sizeof(const char *))
961 if (type != softc->vnic_info.rss_hash_type)
963 strcat(buf, bnxt_hash_types[bit]);
966 rc = sysctl_handle_string(oidp, buf, sizeof(buf), req);
967 if (rc || req->newptr == NULL)
970 for (type = 0, next = buf, p = strsep(&next, " ,"); p;
971 p = strsep(&next, " ,")) {
972 bit = bnxt_get_rss_type_str_bit(p);
977 if (type != softc->vnic_info.rss_hash_type) {
978 softc->vnic_info.rss_hash_type = type;
979 if (if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING)
980 bnxt_hwrm_rss_cfg(softc, &softc->vnic_info,
981 softc->vnic_info.rss_hash_type);
988 bnxt_rx_stall_sysctl(SYSCTL_HANDLER_ARGS) {
989 struct bnxt_softc *softc = arg1;
996 val = (bool)(softc->vnic_info.flags & BNXT_VNIC_FLAG_BD_STALL);
997 rc = sysctl_handle_int(oidp, &val, 0, req);
998 if (rc || !req->newptr)
1002 softc->vnic_info.flags |= BNXT_VNIC_FLAG_BD_STALL;
1004 softc->vnic_info.flags &= ~BNXT_VNIC_FLAG_BD_STALL;
1006 if (if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING)
1007 rc = bnxt_hwrm_vnic_cfg(softc, &softc->vnic_info);
1013 bnxt_vlan_strip_sysctl(SYSCTL_HANDLER_ARGS) {
1014 struct bnxt_softc *softc = arg1;
1021 val = (bool)(softc->vnic_info.flags & BNXT_VNIC_FLAG_VLAN_STRIP);
1022 rc = sysctl_handle_int(oidp, &val, 0, req);
1023 if (rc || !req->newptr)
1027 softc->vnic_info.flags |= BNXT_VNIC_FLAG_VLAN_STRIP;
1029 softc->vnic_info.flags &= ~BNXT_VNIC_FLAG_VLAN_STRIP;
1031 if (if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING)
1032 rc = bnxt_hwrm_vnic_cfg(softc, &softc->vnic_info);
1038 bnxt_set_coal_rx_usecs(SYSCTL_HANDLER_ARGS) {
1039 struct bnxt_softc *softc = arg1;
1046 val = softc->rx_coal_usecs;
1047 rc = sysctl_handle_int(oidp, &val, 0, req);
1048 if (rc || !req->newptr)
1051 softc->rx_coal_usecs = val;
1052 rc = bnxt_hwrm_set_coal(softc);
1058 bnxt_set_coal_rx_frames(SYSCTL_HANDLER_ARGS) {
1059 struct bnxt_softc *softc = arg1;
1066 val = softc->rx_coal_frames;
1067 rc = sysctl_handle_int(oidp, &val, 0, req);
1068 if (rc || !req->newptr)
1071 softc->rx_coal_frames = val;
1072 rc = bnxt_hwrm_set_coal(softc);
1078 bnxt_set_coal_rx_usecs_irq(SYSCTL_HANDLER_ARGS) {
1079 struct bnxt_softc *softc = arg1;
1086 val = softc->rx_coal_usecs_irq;
1087 rc = sysctl_handle_int(oidp, &val, 0, req);
1088 if (rc || !req->newptr)
1091 softc->rx_coal_usecs_irq = val;
1092 rc = bnxt_hwrm_set_coal(softc);
1098 bnxt_set_coal_rx_frames_irq(SYSCTL_HANDLER_ARGS) {
1099 struct bnxt_softc *softc = arg1;
1106 val = softc->rx_coal_frames_irq;
1107 rc = sysctl_handle_int(oidp, &val, 0, req);
1108 if (rc || !req->newptr)
1111 softc->rx_coal_frames_irq = val;
1112 rc = bnxt_hwrm_set_coal(softc);
1118 bnxt_set_coal_tx_usecs(SYSCTL_HANDLER_ARGS) {
1119 struct bnxt_softc *softc = arg1;
1126 val = softc->tx_coal_usecs;
1127 rc = sysctl_handle_int(oidp, &val, 0, req);
1128 if (rc || !req->newptr)
1131 softc->tx_coal_usecs = val;
1132 rc = bnxt_hwrm_set_coal(softc);
1138 bnxt_set_coal_tx_frames(SYSCTL_HANDLER_ARGS) {
1139 struct bnxt_softc *softc = arg1;
1146 val = softc->tx_coal_frames;
1147 rc = sysctl_handle_int(oidp, &val, 0, req);
1148 if (rc || !req->newptr)
1151 softc->tx_coal_frames = val;
1152 rc = bnxt_hwrm_set_coal(softc);
1158 bnxt_set_coal_tx_usecs_irq(SYSCTL_HANDLER_ARGS) {
1159 struct bnxt_softc *softc = arg1;
1166 val = softc->tx_coal_usecs_irq;
1167 rc = sysctl_handle_int(oidp, &val, 0, req);
1168 if (rc || !req->newptr)
1171 softc->tx_coal_usecs_irq = val;
1172 rc = bnxt_hwrm_set_coal(softc);
1178 bnxt_set_coal_tx_frames_irq(SYSCTL_HANDLER_ARGS) {
1179 struct bnxt_softc *softc = arg1;
1186 val = softc->tx_coal_frames_irq;
1187 rc = sysctl_handle_int(oidp, &val, 0, req);
1188 if (rc || !req->newptr)
1191 softc->tx_coal_frames_irq = val;
1192 rc = bnxt_hwrm_set_coal(softc);
1198 bnxt_create_config_sysctls_pre(struct bnxt_softc *softc)
1200 struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(softc->dev);
1201 struct sysctl_oid_list *children;
1203 children = SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev));;
1205 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rss_key",
1206 CTLTYPE_STRING|CTLFLAG_RWTUN, softc, 0, bnxt_rss_key_sysctl, "A",
1208 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rss_type",
1209 CTLTYPE_STRING|CTLFLAG_RWTUN, softc, 0, bnxt_rss_type_sysctl, "A",
1211 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_stall",
1212 CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_rx_stall_sysctl, "I",
1213 "buffer rx packets in hardware until the host posts new buffers");
1214 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "vlan_strip",
1215 CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_vlan_strip_sysctl, "I",
1216 "strip VLAN tag in the RX path");
1217 SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "if_name", CTLFLAG_RD,
1218 iflib_get_ifp(softc->ctx)->if_xname, 0, "interface name");
1220 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_usecs",
1221 CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_usecs,
1222 "I", "interrupt coalescing Rx Usecs");
1223 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_frames",
1224 CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_frames,
1225 "I", "interrupt coalescing Rx Frames");
1226 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_usecs_irq",
1227 CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_usecs_irq,
1228 "I", "interrupt coalescing Rx Usecs IRQ");
1229 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_frames_irq",
1230 CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_frames_irq,
1231 "I", "interrupt coalescing Rx Frames IRQ");
1232 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_usecs",
1233 CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_usecs,
1234 "I", "interrupt coalescing Tx Usces");
1235 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_frames",
1236 CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_frames,
1237 "I", "interrupt coalescing Tx Frames");
1238 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_usecs_irq",
1239 CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_usecs_irq,
1240 "I", "interrupt coalescing Tx Usecs IRQ");
1241 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_frames_irq",
1242 CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_frames_irq,
1243 "I", "interrupt coalescing Tx Frames IRQ");
1248 #define BNXT_HW_LRO_FN(fn_name, arg) \
1250 fn_name(SYSCTL_HANDLER_ARGS) { \
1251 struct bnxt_softc *softc = arg1; \
1255 if (softc == NULL) \
1258 val = softc->hw_lro.arg; \
1259 rc = sysctl_handle_int(oidp, &val, 0, req); \
1260 if (rc || !req->newptr) \
1263 if ((if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING)) \
1266 softc->hw_lro.arg = val; \
1267 bnxt_validate_hw_lro_settings(softc); \
1268 rc = bnxt_hwrm_vnic_tpa_cfg(softc); \
1273 BNXT_HW_LRO_FN(bnxt_hw_lro_enable_disable, enable)
1274 BNXT_HW_LRO_FN(bnxt_hw_lro_set_mode, is_mode_gro)
1275 BNXT_HW_LRO_FN(bnxt_hw_lro_set_max_agg_segs, max_agg_segs)
1276 BNXT_HW_LRO_FN(bnxt_hw_lro_set_max_aggs, max_aggs)
1277 BNXT_HW_LRO_FN(bnxt_hw_lro_set_min_agg_len, min_agg_len)
1279 #define BNXT_FLOW_CTRL_FN(fn_name, arg) \
1281 fn_name(SYSCTL_HANDLER_ARGS) { \
1282 struct bnxt_softc *softc = arg1; \
1286 if (softc == NULL) \
1289 val = softc->link_info.flow_ctrl.arg; \
1290 rc = sysctl_handle_int(oidp, &val, 0, req); \
1291 if (rc || !req->newptr) \
1297 if (softc->link_info.flow_ctrl.arg != val) { \
1298 softc->link_info.flow_ctrl.arg = val; \
1299 rc = bnxt_hwrm_set_link_setting(softc, true, false, false);\
1300 rc = bnxt_hwrm_port_phy_qcfg(softc); \
1306 BNXT_FLOW_CTRL_FN(bnxt_flow_ctrl_tx, tx)
1307 BNXT_FLOW_CTRL_FN(bnxt_flow_ctrl_rx, rx)
1308 BNXT_FLOW_CTRL_FN(bnxt_flow_ctrl_autoneg, autoneg)
1310 bnxt_create_pause_fc_sysctls(struct bnxt_softc *softc)
1312 struct sysctl_oid *oid = softc->flow_ctrl_oid;
1317 SYSCTL_ADD_PROC(&softc->flow_ctrl_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
1318 "tx", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0,
1319 bnxt_flow_ctrl_tx, "A",
1320 "Enable or Disable Tx Flow Ctrl: 0 / 1");
1322 SYSCTL_ADD_PROC(&softc->flow_ctrl_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
1323 "rx", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0,
1324 bnxt_flow_ctrl_rx, "A",
1325 "Enable or Disable Tx Flow Ctrl: 0 / 1");
1327 SYSCTL_ADD_PROC(&softc->flow_ctrl_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
1328 "autoneg", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0,
1329 bnxt_flow_ctrl_autoneg, "A",
1330 "Enable or Disable Autoneg Flow Ctrl: 0 / 1");
1336 bnxt_create_hw_lro_sysctls(struct bnxt_softc *softc)
1338 struct sysctl_oid *oid = softc->hw_lro_oid;
1343 SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
1344 "enable", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0,
1345 bnxt_hw_lro_enable_disable, "A",
1346 "Enable or Disable HW LRO: 0 / 1");
1348 SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
1349 "gro_mode", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0,
1350 bnxt_hw_lro_set_mode, "A",
1351 "Set mode: 1 = GRO mode, 0 = RSC mode");
1353 SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
1354 "max_agg_segs", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0,
1355 bnxt_hw_lro_set_max_agg_segs, "A",
1356 "Set Max Agg Seg Value (unit is Log2): "
1357 "0 (= 1 seg) / 1 (= 2 segs) / ... / 31 (= 2^31 segs)");
1359 SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
1360 "max_aggs", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0,
1361 bnxt_hw_lro_set_max_aggs, "A",
1362 "Set Max Aggs Value (unit is Log2): "
1363 "0 (= 1 agg) / 1 (= 2 aggs) / ... / 7 (= 2^7 segs)");
1365 SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
1366 "min_agg_len", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0,
1367 bnxt_hw_lro_set_min_agg_len, "A",
1368 "Min Agg Len: 1 to 9000");
1373 bnxt_vlan_only_sysctl(SYSCTL_HANDLER_ARGS) {
1374 struct bnxt_softc *softc = arg1;
1381 val = softc->vnic_info.vlan_only;
1382 rc = sysctl_handle_int(oidp, &val, 0, req);
1383 if (rc || !req->newptr)
1389 if (val != softc->vnic_info.vlan_only) {
1390 softc->vnic_info.vlan_only = val;
1391 if (if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING)
1392 rc = bnxt_hwrm_cfa_l2_set_rx_mask(softc,
1400 bnxt_create_config_sysctls_post(struct bnxt_softc *softc)
1402 struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(softc->dev);
1403 struct sysctl_oid_list *children;
1405 children = SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev));;
1407 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "vlan_only",
1408 CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_vlan_only_sysctl, "I",
1409 "require vlan tag on received packets when vlan is enabled");