FreeBSD kernel BXE device code
bxe_stats.c
Go to the documentation of this file.
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
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.
15 *
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.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD$");
31
32#include "bxe.h"
33#include "bxe_stats.h"
34
35#ifdef __i386__
36#define BITS_PER_LONG 32
37#else
38#define BITS_PER_LONG 64
39#endif
40
41
42static inline long
43bxe_hilo(uint32_t *hiref)
44{
45 uint32_t lo = *(hiref + 1);
46#if (BITS_PER_LONG == 64)
47 uint32_t hi = *hiref;
48 return (HILO_U64(hi, lo));
49#else
50 return (lo);
51#endif
52}
53
54static inline uint16_t
56{
57 uint16_t res = 0;
58 uint32_t size;
59
60 /* 'newest' convention - shmem2 contains the size of the port stats */
61 if (SHMEM2_HAS(sc, sizeof_port_stats)) {
62 size = SHMEM2_RD(sc, sizeof_port_stats);
63 if (size) {
64 res = size;
65 }
66
67 /* prevent newer BC from causing buffer overflow */
68 if (res > sizeof(struct host_port_stats)) {
69 res = sizeof(struct host_port_stats);
70 }
71 }
72
73 /*
74 * Older convention - all BCs support the port stats fields up until
75 * the 'not_used' field
76 */
77 if (!res) {
78 res = (offsetof(struct host_port_stats, not_used) + 4);
79
80 /* if PFC stats are supported by the MFW, DMA them as well */
82 res += (offsetof(struct host_port_stats, pfc_frames_rx_lo) -
83 offsetof(struct host_port_stats, pfc_frames_tx_hi) + 4);
84 }
85 }
86
87 res >>= 2;
88
89 DBASSERT(sc, !(res > 2 * DMAE_LEN32_RD_MAX), ("big stats dmae length\n"));
90 return (res);
91}
92
93/*
94 * Init service functions
95 */
96
97static void
99{
100 int i;
101
102 BLOGD(sc, DBG_STATS,
103 "dumping stats:\n"
104 " fw_stats_req\n"
105 " hdr\n"
106 " cmd_num %d\n"
107 " reserved0 %d\n"
108 " drv_stats_counter %d\n"
109 " reserved1 %d\n"
110 " stats_counters_addrs %x %x\n",
117
118 for (i = 0; i < sc->fw_stats_req->hdr.cmd_num; i++) {
119 BLOGD(sc, DBG_STATS,
120 "query[%d]\n"
121 " kind %d\n"
122 " index %d\n"
123 " funcID %d\n"
124 " reserved %d\n"
125 " address %x %x\n",
126 i,
127 sc->fw_stats_req->query[i].kind,
128 sc->fw_stats_req->query[i].index,
129 sc->fw_stats_req->query[i].funcID,
132 sc->fw_stats_req->query[i].address.lo);
133 }
134}
135
136/*
137 * Post the next statistics ramrod. Protect it with the lock in
138 * order to ensure the strict order between statistics ramrods
139 * (each ramrod has a sequence number passed in a
140 * sc->fw_stats_req->hdr.drv_stats_counter and ramrods must be
141 * sent in order).
142 */
143static void
145{
146 int rc;
147
148 if (!sc->stats_pending) {
149 BXE_STATS_LOCK(sc);
150
151 if (sc->stats_pending) {
153 return;
154 }
155
157 htole16(sc->stats_counter++);
158
159 BLOGD(sc, DBG_STATS,
160 "sending statistics ramrod %d\n",
161 le16toh(sc->fw_stats_req->hdr.drv_stats_counter));
162
163 /* adjust the ramrod to include VF queues statistics */
164 // XXX bxe_iov_adjust_stats_req(sc);
165
166 bxe_dp_stats(sc);
167
168 /* send FW stats ramrod */
173 if (rc == 0) {
174 sc->stats_pending = 1;
175 }
176
178 }
179}
180
181static void
183{
184 struct dmae_cmd *dmae = &sc->stats_dmae;
185 uint32_t *stats_comp = BXE_SP(sc, stats_comp);
186 int loader_idx;
187 uint32_t opcode;
188
189 *stats_comp = DMAE_COMP_VAL;
190 if (CHIP_REV_IS_SLOW(sc)) {
191 return;
192 }
193
194 /* Update MCP's statistics if possible */
195 if (sc->func_stx) {
196 memcpy(BXE_SP(sc, func_stats), &sc->func_stats,
197 sizeof(sc->func_stats));
198 }
199
200 /* loader */
201 if (sc->executer_idx) {
202 loader_idx = PMF_DMAE_C(sc);
204 TRUE, DMAE_COMP_GRC);
206
207 memset(dmae, 0, sizeof(struct dmae_cmd));
208 dmae->opcode = opcode;
209 dmae->src_addr_lo = U64_LO(BXE_SP_MAPPING(sc, dmae[0]));
210 dmae->src_addr_hi = U64_HI(BXE_SP_MAPPING(sc, dmae[0]));
211 dmae->dst_addr_lo = ((DMAE_REG_CMD_MEM +
212 sizeof(struct dmae_cmd) *
213 (loader_idx + 1)) >> 2);
214 dmae->dst_addr_hi = 0;
215 dmae->len = sizeof(struct dmae_cmd) >> 2;
216 if (CHIP_IS_E1(sc)) {
217 dmae->len--;
218 }
219 dmae->comp_addr_lo = (dmae_reg_go_c[loader_idx + 1] >> 2);
220 dmae->comp_addr_hi = 0;
221 dmae->comp_val = 1;
222
223 *stats_comp = 0;
224 bxe_post_dmae(sc, dmae, loader_idx);
225 } else if (sc->func_stx) {
226 *stats_comp = 0;
227 bxe_post_dmae(sc, dmae, INIT_DMAE_C(sc));
228 }
229}
230
231static int
233{
234 uint32_t *stats_comp = BXE_SP(sc, stats_comp);
235 int cnt = 10;
236
237 while (*stats_comp != DMAE_COMP_VAL) {
238 if (!cnt) {
239 BLOGE(sc, "Timeout waiting for stats finished\n");
241 taskqueue_enqueue_timeout(taskqueue_thread,
242 &sc->sp_err_timeout_task, hz/10);
243 break;
244
245 }
246
247 cnt--;
248 DELAY(1000);
249 }
250
251 return (1);
252}
253
254/*
255 * Statistics service functions
256 */
257
258static void
260{
261 struct dmae_cmd *dmae;
262 uint32_t opcode;
263 int loader_idx = PMF_DMAE_C(sc);
264 uint32_t *stats_comp = BXE_SP(sc, stats_comp);
265
266 if (sc->devinfo.bc_ver <= 0x06001400) {
267 /*
268 * Bootcode v6.0.21 fixed a GRC timeout that occurs when accessing
269 * BRB registers while the BRB block is in reset. The DMA transfer
270 * below triggers this issue resulting in the DMAE to stop
271 * functioning. Skip this initial stats transfer for old bootcode
272 * versions <= 6.0.20.
273 */
274 return;
275 }
276
277 /* sanity */
278 if (!sc->port.pmf || !sc->port.port_stx) {
279 BLOGE(sc, "BUG!\n");
280 return;
281 }
282
283 sc->executer_idx = 0;
284
286
287 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
289 dmae->src_addr_lo = (sc->port.port_stx >> 2);
290 dmae->src_addr_hi = 0;
291 dmae->dst_addr_lo = U64_LO(BXE_SP_MAPPING(sc, port_stats));
292 dmae->dst_addr_hi = U64_HI(BXE_SP_MAPPING(sc, port_stats));
293 dmae->len = DMAE_LEN32_RD_MAX;
294 dmae->comp_addr_lo = (dmae_reg_go_c[loader_idx] >> 2);
295 dmae->comp_addr_hi = 0;
296 dmae->comp_val = 1;
297
298 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
300 dmae->src_addr_lo = ((sc->port.port_stx >> 2) + DMAE_LEN32_RD_MAX);
301 dmae->src_addr_hi = 0;
302 dmae->dst_addr_lo = U64_LO(BXE_SP_MAPPING(sc, port_stats) +
304 dmae->dst_addr_hi = U64_HI(BXE_SP_MAPPING(sc, port_stats) +
307
308 dmae->comp_addr_lo = U64_LO(BXE_SP_MAPPING(sc, stats_comp));
309 dmae->comp_addr_hi = U64_HI(BXE_SP_MAPPING(sc, stats_comp));
310 dmae->comp_val = DMAE_COMP_VAL;
311
312 *stats_comp = 0;
314 bxe_stats_comp(sc);
315}
316
317static void
319{
320 struct dmae_cmd *dmae;
321 int port = SC_PORT(sc);
322 uint32_t opcode;
323 int loader_idx = PMF_DMAE_C(sc);
324 uint32_t mac_addr;
325 uint32_t *stats_comp = BXE_SP(sc, stats_comp);
326
327 /* sanity */
328 if (!sc->link_vars.link_up || !sc->port.pmf) {
329 BLOGE(sc, "BUG!\n");
330 return;
331 }
332
333 sc->executer_idx = 0;
334
335 /* MCP */
337 TRUE, DMAE_COMP_GRC);
338
339 if (sc->port.port_stx) {
340 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
341 dmae->opcode = opcode;
342 dmae->src_addr_lo = U64_LO(BXE_SP_MAPPING(sc, port_stats));
343 dmae->src_addr_hi = U64_HI(BXE_SP_MAPPING(sc, port_stats));
344 dmae->dst_addr_lo = sc->port.port_stx >> 2;
345 dmae->dst_addr_hi = 0;
346 dmae->len = bxe_get_port_stats_dma_len(sc);
347 dmae->comp_addr_lo = dmae_reg_go_c[loader_idx] >> 2;
348 dmae->comp_addr_hi = 0;
349 dmae->comp_val = 1;
350 }
351
352 if (sc->func_stx) {
353 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
354 dmae->opcode = opcode;
355 dmae->src_addr_lo = U64_LO(BXE_SP_MAPPING(sc, func_stats));
356 dmae->src_addr_hi = U64_HI(BXE_SP_MAPPING(sc, func_stats));
357 dmae->dst_addr_lo = (sc->func_stx >> 2);
358 dmae->dst_addr_hi = 0;
359 dmae->len = (sizeof(struct host_func_stats) >> 2);
360 dmae->comp_addr_lo = (dmae_reg_go_c[loader_idx] >> 2);
361 dmae->comp_addr_hi = 0;
362 dmae->comp_val = 1;
363 }
364
365 /* MAC */
367 TRUE, DMAE_COMP_GRC);
368
369 /* EMAC is special */
372
373 /* EMAC_REG_EMAC_RX_STAT_AC (EMAC_REG_EMAC_RX_STAT_AC_COUNT)*/
374 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
375 dmae->opcode = opcode;
377 dmae->src_addr_hi = 0;
381 dmae->comp_addr_lo = (dmae_reg_go_c[loader_idx] >> 2);
382 dmae->comp_addr_hi = 0;
383 dmae->comp_val = 1;
384
385 /* EMAC_REG_EMAC_RX_STAT_AC_28 */
386 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
387 dmae->opcode = opcode;
389 dmae->src_addr_hi = 0;
391 offsetof(struct emac_stats,
392 rx_stat_falsecarriererrors));
394 offsetof(struct emac_stats,
395 rx_stat_falsecarriererrors));
396 dmae->len = 1;
397 dmae->comp_addr_lo = (dmae_reg_go_c[loader_idx] >> 2);
398 dmae->comp_addr_hi = 0;
399 dmae->comp_val = 1;
400
401 /* EMAC_REG_EMAC_TX_STAT_AC (EMAC_REG_EMAC_TX_STAT_AC_COUNT)*/
402 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
403 dmae->opcode = opcode;
405 dmae->src_addr_hi = 0;
407 offsetof(struct emac_stats,
408 tx_stat_ifhcoutoctets));
410 offsetof(struct emac_stats,
411 tx_stat_ifhcoutoctets));
413 dmae->comp_addr_lo = (dmae_reg_go_c[loader_idx] >> 2);
414 dmae->comp_addr_hi = 0;
415 dmae->comp_val = 1;
416 } else {
417 uint32_t tx_src_addr_lo, rx_src_addr_lo;
418 uint16_t rx_len, tx_len;
419
420 /* configure the params according to MAC type */
421 switch (sc->link_vars.mac_type) {
425
426 /* BIGMAC_REGISTER_TX_STAT_GTPKT ..
427 BIGMAC_REGISTER_TX_STAT_GTBYT */
428 if (CHIP_IS_E1x(sc)) {
429 tx_src_addr_lo =
431 tx_len = ((8 + BIGMAC_REGISTER_TX_STAT_GTBYT -
433 rx_src_addr_lo =
435 rx_len = ((8 + BIGMAC_REGISTER_RX_STAT_GRIPJ -
437 } else {
438 tx_src_addr_lo =
440 tx_len = ((8 + BIGMAC2_REGISTER_TX_STAT_GTBYT -
442 rx_src_addr_lo =
444 rx_len = ((8 + BIGMAC2_REGISTER_RX_STAT_GRIPJ -
446 }
447
448 break;
449
450 case ELINK_MAC_TYPE_UMAC: /* handled by MSTAT */
451 case ELINK_MAC_TYPE_XMAC: /* handled by MSTAT */
452 default:
454 tx_src_addr_lo = ((mac_addr + MSTAT_REG_TX_STAT_GTXPOK_LO) >> 2);
455 rx_src_addr_lo = ((mac_addr + MSTAT_REG_RX_STAT_GR64_LO) >> 2);
456 tx_len =
457 (sizeof(sc->sp->mac_stats.mstat_stats.stats_tx) >> 2);
458 rx_len =
459 (sizeof(sc->sp->mac_stats.mstat_stats.stats_rx) >> 2);
460 break;
461 }
462
463 /* TX stats */
464 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
465 dmae->opcode = opcode;
466 dmae->src_addr_lo = tx_src_addr_lo;
467 dmae->src_addr_hi = 0;
468 dmae->len = tx_len;
471 dmae->comp_addr_lo = dmae_reg_go_c[loader_idx] >> 2;
472 dmae->comp_addr_hi = 0;
473 dmae->comp_val = 1;
474
475 /* RX stats */
476 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
477 dmae->opcode = opcode;
478 dmae->src_addr_hi = 0;
479 dmae->src_addr_lo = rx_src_addr_lo;
480 dmae->dst_addr_lo =
481 U64_LO(BXE_SP_MAPPING(sc, mac_stats) + (tx_len << 2));
482 dmae->dst_addr_hi =
483 U64_HI(BXE_SP_MAPPING(sc, mac_stats) + (tx_len << 2));
484 dmae->len = rx_len;
485 dmae->comp_addr_lo = dmae_reg_go_c[loader_idx] >> 2;
486 dmae->comp_addr_hi = 0;
487 dmae->comp_val = 1;
488 }
489
490 /* NIG */
491 if (!CHIP_IS_E3(sc)) {
492 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
493 dmae->opcode = opcode;
494 dmae->src_addr_lo =
497 dmae->src_addr_hi = 0;
499 offsetof(struct nig_stats,
500 egress_mac_pkt0_lo));
502 offsetof(struct nig_stats,
503 egress_mac_pkt0_lo));
504 dmae->len = ((2 * sizeof(uint32_t)) >> 2);
505 dmae->comp_addr_lo = (dmae_reg_go_c[loader_idx] >> 2);
506 dmae->comp_addr_hi = 0;
507 dmae->comp_val = 1;
508
509 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
510 dmae->opcode = opcode;
511 dmae->src_addr_lo =
514 dmae->src_addr_hi = 0;
516 offsetof(struct nig_stats,
517 egress_mac_pkt1_lo));
519 offsetof(struct nig_stats,
520 egress_mac_pkt1_lo));
521 dmae->len = ((2 * sizeof(uint32_t)) >> 2);
522 dmae->comp_addr_lo = (dmae_reg_go_c[loader_idx] >> 2);
523 dmae->comp_addr_hi = 0;
524 dmae->comp_val = 1;
525 }
526
527 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
529 TRUE, DMAE_COMP_PCI);
530 dmae->src_addr_lo =
533 dmae->src_addr_hi = 0;
536 dmae->len = (sizeof(struct nig_stats) - 4*sizeof(uint32_t)) >> 2;
537
538 dmae->comp_addr_lo = U64_LO(BXE_SP_MAPPING(sc, stats_comp));
539 dmae->comp_addr_hi = U64_HI(BXE_SP_MAPPING(sc, stats_comp));
540 dmae->comp_val = DMAE_COMP_VAL;
541
542 *stats_comp = 0;
543}
544
545static void
547{
548 struct dmae_cmd *dmae = &sc->stats_dmae;
549 uint32_t *stats_comp = BXE_SP(sc, stats_comp);
550
551 /* sanity */
552 if (!sc->func_stx) {
553 BLOGE(sc, "BUG!\n");
554 return;
555 }
556
557 sc->executer_idx = 0;
558 memset(dmae, 0, sizeof(struct dmae_cmd));
559
561 TRUE, DMAE_COMP_PCI);
562 dmae->src_addr_lo = U64_LO(BXE_SP_MAPPING(sc, func_stats));
563 dmae->src_addr_hi = U64_HI(BXE_SP_MAPPING(sc, func_stats));
564 dmae->dst_addr_lo = (sc->func_stx >> 2);
565 dmae->dst_addr_hi = 0;
566 dmae->len = (sizeof(struct host_func_stats) >> 2);
567 dmae->comp_addr_lo = U64_LO(BXE_SP_MAPPING(sc, stats_comp));
568 dmae->comp_addr_hi = U64_HI(BXE_SP_MAPPING(sc, stats_comp));
569 dmae->comp_val = DMAE_COMP_VAL;
570
571 *stats_comp = 0;
572}
573
574static void
576{
577 /*
578 * VFs travel through here as part of the statistics FSM, but no action
579 * is required
580 */
581 if (IS_VF(sc)) {
582 return;
583 }
584
585 if (sc->port.pmf) {
587 }
588
589 else if (sc->func_stx) {
591 }
592
595}
596
597static void
599{
600 bxe_stats_comp(sc);
602 bxe_stats_start(sc);
603}
604
605static void
607{
608 /*
609 * VFs travel through here as part of the statistics FSM, but no action
610 * is required
611 */
612 if (IS_VF(sc)) {
613 return;
614 }
615
616 bxe_stats_comp(sc);
617 bxe_stats_start(sc);
618}
619
620static void
622{
623 struct host_port_stats *pstats = BXE_SP(sc, port_stats);
624 struct bxe_eth_stats *estats = &sc->eth_stats;
625 struct {
626 uint32_t lo;
627 uint32_t hi;
628 } diff;
629
630 if (CHIP_IS_E1x(sc)) {
631 struct bmac1_stats *new = BXE_SP(sc, mac_stats.bmac1_stats);
632
633 /* the macros below will use "bmac1_stats" type */
634 UPDATE_STAT64(rx_stat_grerb, rx_stat_ifhcinbadoctets);
635 UPDATE_STAT64(rx_stat_grfcs, rx_stat_dot3statsfcserrors);
636 UPDATE_STAT64(rx_stat_grund, rx_stat_etherstatsundersizepkts);
637 UPDATE_STAT64(rx_stat_grovr, rx_stat_dot3statsframestoolong);
638 UPDATE_STAT64(rx_stat_grfrg, rx_stat_etherstatsfragments);
639 UPDATE_STAT64(rx_stat_grjbr, rx_stat_etherstatsjabbers);
640 UPDATE_STAT64(rx_stat_grxcf, rx_stat_maccontrolframesreceived);
641 UPDATE_STAT64(rx_stat_grxpf, rx_stat_xoffstateentered);
642 UPDATE_STAT64(rx_stat_grxpf, rx_stat_mac_xpf);
643
644 UPDATE_STAT64(tx_stat_gtxpf, tx_stat_outxoffsent);
645 UPDATE_STAT64(tx_stat_gtxpf, tx_stat_flowcontroldone);
646 UPDATE_STAT64(tx_stat_gt64, tx_stat_etherstatspkts64octets);
647 UPDATE_STAT64(tx_stat_gt127,
648 tx_stat_etherstatspkts65octetsto127octets);
649 UPDATE_STAT64(tx_stat_gt255,
650 tx_stat_etherstatspkts128octetsto255octets);
651 UPDATE_STAT64(tx_stat_gt511,
652 tx_stat_etherstatspkts256octetsto511octets);
653 UPDATE_STAT64(tx_stat_gt1023,
654 tx_stat_etherstatspkts512octetsto1023octets);
655 UPDATE_STAT64(tx_stat_gt1518,
656 tx_stat_etherstatspkts1024octetsto1522octets);
657 UPDATE_STAT64(tx_stat_gt2047, tx_stat_mac_2047);
658 UPDATE_STAT64(tx_stat_gt4095, tx_stat_mac_4095);
659 UPDATE_STAT64(tx_stat_gt9216, tx_stat_mac_9216);
660 UPDATE_STAT64(tx_stat_gt16383, tx_stat_mac_16383);
661 UPDATE_STAT64(tx_stat_gterr,
662 tx_stat_dot3statsinternalmactransmiterrors);
663 UPDATE_STAT64(tx_stat_gtufl, tx_stat_mac_ufl);
664 } else {
665 struct bmac2_stats *new = BXE_SP(sc, mac_stats.bmac2_stats);
666 struct bxe_fw_port_stats_old *fwstats = &sc->fw_stats_old;
667
668 /* the macros below will use "bmac2_stats" type */
669 UPDATE_STAT64(rx_stat_grerb, rx_stat_ifhcinbadoctets);
670 UPDATE_STAT64(rx_stat_grfcs, rx_stat_dot3statsfcserrors);
671 UPDATE_STAT64(rx_stat_grund, rx_stat_etherstatsundersizepkts);
672 UPDATE_STAT64(rx_stat_grovr, rx_stat_dot3statsframestoolong);
673 UPDATE_STAT64(rx_stat_grfrg, rx_stat_etherstatsfragments);
674 UPDATE_STAT64(rx_stat_grjbr, rx_stat_etherstatsjabbers);
675 UPDATE_STAT64(rx_stat_grxcf, rx_stat_maccontrolframesreceived);
676 UPDATE_STAT64(rx_stat_grxpf, rx_stat_xoffstateentered);
677 UPDATE_STAT64(rx_stat_grxpf, rx_stat_mac_xpf);
678 UPDATE_STAT64(tx_stat_gtxpf, tx_stat_outxoffsent);
679 UPDATE_STAT64(tx_stat_gtxpf, tx_stat_flowcontroldone);
680 UPDATE_STAT64(tx_stat_gt64, tx_stat_etherstatspkts64octets);
681 UPDATE_STAT64(tx_stat_gt127,
682 tx_stat_etherstatspkts65octetsto127octets);
683 UPDATE_STAT64(tx_stat_gt255,
684 tx_stat_etherstatspkts128octetsto255octets);
685 UPDATE_STAT64(tx_stat_gt511,
686 tx_stat_etherstatspkts256octetsto511octets);
687 UPDATE_STAT64(tx_stat_gt1023,
688 tx_stat_etherstatspkts512octetsto1023octets);
689 UPDATE_STAT64(tx_stat_gt1518,
690 tx_stat_etherstatspkts1024octetsto1522octets);
691 UPDATE_STAT64(tx_stat_gt2047, tx_stat_mac_2047);
692 UPDATE_STAT64(tx_stat_gt4095, tx_stat_mac_4095);
693 UPDATE_STAT64(tx_stat_gt9216, tx_stat_mac_9216);
694 UPDATE_STAT64(tx_stat_gt16383, tx_stat_mac_16383);
695 UPDATE_STAT64(tx_stat_gterr,
696 tx_stat_dot3statsinternalmactransmiterrors);
697 UPDATE_STAT64(tx_stat_gtufl, tx_stat_mac_ufl);
698
699 /* collect PFC stats */
700 pstats->pfc_frames_tx_hi = new->tx_stat_gtpp_hi;
701 pstats->pfc_frames_tx_lo = new->tx_stat_gtpp_lo;
702 ADD_64(pstats->pfc_frames_tx_hi, fwstats->pfc_frames_tx_hi,
703 pstats->pfc_frames_tx_lo, fwstats->pfc_frames_tx_lo);
704
705 pstats->pfc_frames_rx_hi = new->rx_stat_grpp_hi;
706 pstats->pfc_frames_rx_lo = new->rx_stat_grpp_lo;
707 ADD_64(pstats->pfc_frames_rx_hi, fwstats->pfc_frames_rx_hi,
708 pstats->pfc_frames_rx_lo, fwstats->pfc_frames_rx_lo);
709 }
710
713
716
719 estats->pfc_frames_sent_hi = pstats->pfc_frames_tx_hi;
720 estats->pfc_frames_sent_lo = pstats->pfc_frames_tx_lo;
721}
722
723static void
725{
726 struct host_port_stats *pstats = BXE_SP(sc, port_stats);
727 struct bxe_eth_stats *estats = &sc->eth_stats;
728 struct mstat_stats *new = BXE_SP(sc, mac_stats.mstat_stats);
729
730 ADD_STAT64(stats_rx.rx_grerb, rx_stat_ifhcinbadoctets);
731 ADD_STAT64(stats_rx.rx_grfcs, rx_stat_dot3statsfcserrors);
732 ADD_STAT64(stats_rx.rx_grund, rx_stat_etherstatsundersizepkts);
733 ADD_STAT64(stats_rx.rx_grovr, rx_stat_dot3statsframestoolong);
734 ADD_STAT64(stats_rx.rx_grfrg, rx_stat_etherstatsfragments);
735 ADD_STAT64(stats_rx.rx_grxcf, rx_stat_maccontrolframesreceived);
736 ADD_STAT64(stats_rx.rx_grxpf, rx_stat_xoffstateentered);
737 ADD_STAT64(stats_rx.rx_grxpf, rx_stat_mac_xpf);
738 ADD_STAT64(stats_tx.tx_gtxpf, tx_stat_outxoffsent);
739 ADD_STAT64(stats_tx.tx_gtxpf, tx_stat_flowcontroldone);
740
741 /* collect pfc stats */
742 ADD_64(pstats->pfc_frames_tx_hi, new->stats_tx.tx_gtxpp_hi,
743 pstats->pfc_frames_tx_lo, new->stats_tx.tx_gtxpp_lo);
744 ADD_64(pstats->pfc_frames_rx_hi, new->stats_rx.rx_grxpp_hi,
745 pstats->pfc_frames_rx_lo, new->stats_rx.rx_grxpp_lo);
746
747 ADD_STAT64(stats_tx.tx_gt64, tx_stat_etherstatspkts64octets);
748 ADD_STAT64(stats_tx.tx_gt127, tx_stat_etherstatspkts65octetsto127octets);
749 ADD_STAT64(stats_tx.tx_gt255, tx_stat_etherstatspkts128octetsto255octets);
750 ADD_STAT64(stats_tx.tx_gt511, tx_stat_etherstatspkts256octetsto511octets);
751 ADD_STAT64(stats_tx.tx_gt1023,
752 tx_stat_etherstatspkts512octetsto1023octets);
753 ADD_STAT64(stats_tx.tx_gt1518,
754 tx_stat_etherstatspkts1024octetsto1522octets);
755 ADD_STAT64(stats_tx.tx_gt2047, tx_stat_mac_2047);
756
757 ADD_STAT64(stats_tx.tx_gt4095, tx_stat_mac_4095);
758 ADD_STAT64(stats_tx.tx_gt9216, tx_stat_mac_9216);
759 ADD_STAT64(stats_tx.tx_gt16383, tx_stat_mac_16383);
760
761 ADD_STAT64(stats_tx.tx_gterr, tx_stat_dot3statsinternalmactransmiterrors);
762 ADD_STAT64(stats_tx.tx_gtufl, tx_stat_mac_ufl);
763
768
770 pstats->mac_stx[1].tx_stat_mac_2047_hi;
772 pstats->mac_stx[1].tx_stat_mac_2047_lo;
773
775 pstats->mac_stx[1].tx_stat_mac_4095_hi,
777 pstats->mac_stx[1].tx_stat_mac_4095_lo);
778
780 pstats->mac_stx[1].tx_stat_mac_9216_hi,
782 pstats->mac_stx[1].tx_stat_mac_9216_lo);
783
785 pstats->mac_stx[1].tx_stat_mac_16383_hi,
787 pstats->mac_stx[1].tx_stat_mac_16383_lo);
788
791
794
797 estats->pfc_frames_sent_hi = pstats->pfc_frames_tx_hi;
798 estats->pfc_frames_sent_lo = pstats->pfc_frames_tx_lo;
799}
800
801static void
803{
804 struct emac_stats *new = BXE_SP(sc, mac_stats.emac_stats);
805 struct host_port_stats *pstats = BXE_SP(sc, port_stats);
806 struct bxe_eth_stats *estats = &sc->eth_stats;
807
808 UPDATE_EXTEND_STAT(rx_stat_ifhcinbadoctets);
809 UPDATE_EXTEND_STAT(tx_stat_ifhcoutbadoctets);
810 UPDATE_EXTEND_STAT(rx_stat_dot3statsfcserrors);
811 UPDATE_EXTEND_STAT(rx_stat_dot3statsalignmenterrors);
812 UPDATE_EXTEND_STAT(rx_stat_dot3statscarriersenseerrors);
813 UPDATE_EXTEND_STAT(rx_stat_falsecarriererrors);
814 UPDATE_EXTEND_STAT(rx_stat_etherstatsundersizepkts);
815 UPDATE_EXTEND_STAT(rx_stat_dot3statsframestoolong);
816 UPDATE_EXTEND_STAT(rx_stat_etherstatsfragments);
817 UPDATE_EXTEND_STAT(rx_stat_etherstatsjabbers);
818 UPDATE_EXTEND_STAT(rx_stat_maccontrolframesreceived);
819 UPDATE_EXTEND_STAT(rx_stat_xoffstateentered);
820 UPDATE_EXTEND_STAT(rx_stat_xonpauseframesreceived);
821 UPDATE_EXTEND_STAT(rx_stat_xoffpauseframesreceived);
822 UPDATE_EXTEND_STAT(tx_stat_outxonsent);
823 UPDATE_EXTEND_STAT(tx_stat_outxoffsent);
824 UPDATE_EXTEND_STAT(tx_stat_flowcontroldone);
825 UPDATE_EXTEND_STAT(tx_stat_etherstatscollisions);
826 UPDATE_EXTEND_STAT(tx_stat_dot3statssinglecollisionframes);
827 UPDATE_EXTEND_STAT(tx_stat_dot3statsmultiplecollisionframes);
828 UPDATE_EXTEND_STAT(tx_stat_dot3statsdeferredtransmissions);
829 UPDATE_EXTEND_STAT(tx_stat_dot3statsexcessivecollisions);
830 UPDATE_EXTEND_STAT(tx_stat_dot3statslatecollisions);
831 UPDATE_EXTEND_STAT(tx_stat_etherstatspkts64octets);
832 UPDATE_EXTEND_STAT(tx_stat_etherstatspkts65octetsto127octets);
833 UPDATE_EXTEND_STAT(tx_stat_etherstatspkts128octetsto255octets);
834 UPDATE_EXTEND_STAT(tx_stat_etherstatspkts256octetsto511octets);
835 UPDATE_EXTEND_STAT(tx_stat_etherstatspkts512octetsto1023octets);
836 UPDATE_EXTEND_STAT(tx_stat_etherstatspkts1024octetsto1522octets);
837 UPDATE_EXTEND_STAT(tx_stat_etherstatspktsover1522octets);
838 UPDATE_EXTEND_STAT(tx_stat_dot3statsinternalmactransmiterrors);
839
848
849 estats->pause_frames_sent_hi =
851 estats->pause_frames_sent_lo =
855 estats->pause_frames_sent_lo,
857}
858
859static int
861{
862 struct nig_stats *new = BXE_SP(sc, nig_stats);
863 struct nig_stats *old = &(sc->port.old_nig_stats);
864 struct host_port_stats *pstats = BXE_SP(sc, port_stats);
865 struct bxe_eth_stats *estats = &sc->eth_stats;
866 uint32_t lpi_reg, nig_timer_max;
867 struct {
868 uint32_t lo;
869 uint32_t hi;
870 } diff;
871
872 switch (sc->link_vars.mac_type) {
875 break;
876
879 break;
880
884 break;
885
886 case ELINK_MAC_TYPE_NONE: /* unreached */
887 BLOGD(sc, DBG_STATS,
888 "stats updated by DMAE but no MAC active\n");
889 return (-1);
890
891 default: /* unreached */
892 BLOGE(sc, "stats update failed, unknown MAC type\n");
893 }
894
895 ADD_EXTEND_64(pstats->brb_drop_hi, pstats->brb_drop_lo,
896 new->brb_discard - old->brb_discard);
898 new->brb_truncate - old->brb_truncate);
899
900 if (!CHIP_IS_E3(sc)) {
901 UPDATE_STAT64_NIG(egress_mac_pkt0,
902 etherstatspkts1024octetsto1522octets);
903 UPDATE_STAT64_NIG(egress_mac_pkt1,
904 etherstatspktsover1522octets);
905 }
906
907 memcpy(old, new, sizeof(struct nig_stats));
908
909 memcpy(&(estats->rx_stat_ifhcinbadoctets_hi), &(pstats->mac_stx[1]),
910 sizeof(struct mac_stx));
911 estats->brb_drop_hi = pstats->brb_drop_hi;
912 estats->brb_drop_lo = pstats->brb_drop_lo;
913
914 pstats->host_port_stats_counter++;
915
916 if (CHIP_IS_E3(sc)) {
917 lpi_reg = (SC_PORT(sc)) ?
920 estats->eee_tx_lpi += REG_RD(sc, lpi_reg);
921 }
922
923 if (!BXE_NOMCP(sc)) {
924 nig_timer_max = SHMEM_RD(sc, port_mb[SC_PORT(sc)].stat_nig_timer);
925 if (nig_timer_max != estats->nig_timer_max) {
926 estats->nig_timer_max = nig_timer_max;
927 /*NOTE: not setting error bit */
928 BLOGE(sc, "invalid NIG timer max (%u)\n",
929 estats->nig_timer_max);
930 }
931 }
932
933 return (0);
934}
935
936static int
938{
939 struct stats_counter *counters = &sc->fw_stats_data->storm_counters;
940 uint16_t cur_stats_counter;
941
942 /*
943 * Make sure we use the value of the counter
944 * used for sending the last stats ramrod.
945 */
946 BXE_STATS_LOCK(sc);
947 cur_stats_counter = (sc->stats_counter - 1);
949
950 /* are storm stats valid? */
951 if (le16toh(counters->xstats_counter) != cur_stats_counter) {
952 BLOGD(sc, DBG_STATS,
953 "stats not updated by xstorm, "
954 "counter 0x%x != stats_counter 0x%x\n",
955 le16toh(counters->xstats_counter), sc->stats_counter);
956 return (-EAGAIN);
957 }
958
959 if (le16toh(counters->ustats_counter) != cur_stats_counter) {
960 BLOGD(sc, DBG_STATS,
961 "stats not updated by ustorm, "
962 "counter 0x%x != stats_counter 0x%x\n",
963 le16toh(counters->ustats_counter), sc->stats_counter);
964 return (-EAGAIN);
965 }
966
967 if (le16toh(counters->cstats_counter) != cur_stats_counter) {
968 BLOGD(sc, DBG_STATS,
969 "stats not updated by cstorm, "
970 "counter 0x%x != stats_counter 0x%x\n",
971 le16toh(counters->cstats_counter), sc->stats_counter);
972 return (-EAGAIN);
973 }
974
975 if (le16toh(counters->tstats_counter) != cur_stats_counter) {
976 BLOGD(sc, DBG_STATS,
977 "stats not updated by tstorm, "
978 "counter 0x%x != stats_counter 0x%x\n",
979 le16toh(counters->tstats_counter), sc->stats_counter);
980 return (-EAGAIN);
981 }
982
983 return (0);
984}
985
986static int
988{
989 struct tstorm_per_port_stats *tport =
991 struct tstorm_per_pf_stats *tfunc =
993 struct host_func_stats *fstats = &sc->func_stats;
994 struct bxe_eth_stats *estats = &sc->eth_stats;
995 struct bxe_eth_stats_old *estats_old = &sc->eth_stats_old;
996 int i;
997
998 /* vfs stat counter is managed by pf */
1000 return (-EAGAIN);
1001 }
1002
1003 estats->error_bytes_received_hi = 0;
1004 estats->error_bytes_received_lo = 0;
1005
1006 for (i = 0; i < sc->num_queues; i++) {
1007 struct bxe_fastpath *fp = &sc->fp[i];
1008 struct tstorm_per_queue_stats *tclient =
1010 struct tstorm_per_queue_stats *old_tclient = &fp->old_tclient;
1011 struct ustorm_per_queue_stats *uclient =
1013 struct ustorm_per_queue_stats *old_uclient = &fp->old_uclient;
1014 struct xstorm_per_queue_stats *xclient =
1016 struct xstorm_per_queue_stats *old_xclient = &fp->old_xclient;
1017 struct bxe_eth_q_stats *qstats = &fp->eth_q_stats;
1018 struct bxe_eth_q_stats_old *qstats_old = &fp->eth_q_stats_old;
1019
1020 uint32_t diff;
1021
1022 BLOGD(sc, DBG_STATS,
1023 "queue[%d]: ucast_sent 0x%x bcast_sent 0x%x mcast_sent 0x%x\n",
1024 i, xclient->ucast_pkts_sent, xclient->bcast_pkts_sent,
1025 xclient->mcast_pkts_sent);
1026
1027 BLOGD(sc, DBG_STATS, "---------------\n");
1028
1030 total_broadcast_bytes_received);
1032 total_multicast_bytes_received);
1034 total_unicast_bytes_received);
1035
1036 /*
1037 * sum to total_bytes_received all
1038 * unicast/multicast/broadcast
1039 */
1040 qstats->total_bytes_received_hi =
1042 qstats->total_bytes_received_lo =
1044
1049
1054
1057
1058 UPDATE_EXTEND_TSTAT(rcv_ucast_pkts, total_unicast_packets_received);
1059 UPDATE_EXTEND_TSTAT(rcv_mcast_pkts, total_multicast_packets_received);
1060 UPDATE_EXTEND_TSTAT(rcv_bcast_pkts, total_broadcast_packets_received);
1061 UPDATE_EXTEND_E_TSTAT(pkts_too_big_discard,
1062 etherstatsoverrsizepkts, 32);
1063 UPDATE_EXTEND_E_TSTAT(no_buff_discard, no_buff_discard, 16);
1064
1065 SUB_EXTEND_USTAT(ucast_no_buff_pkts, total_unicast_packets_received);
1066 SUB_EXTEND_USTAT(mcast_no_buff_pkts,
1067 total_multicast_packets_received);
1068 SUB_EXTEND_USTAT(bcast_no_buff_pkts,
1069 total_broadcast_packets_received);
1070 UPDATE_EXTEND_E_USTAT(ucast_no_buff_pkts, no_buff_discard);
1071 UPDATE_EXTEND_E_USTAT(mcast_no_buff_pkts, no_buff_discard);
1072 UPDATE_EXTEND_E_USTAT(bcast_no_buff_pkts, no_buff_discard);
1073
1075 total_broadcast_bytes_transmitted);
1077 total_multicast_bytes_transmitted);
1079 total_unicast_bytes_transmitted);
1080
1081 /*
1082 * sum to total_bytes_transmitted all
1083 * unicast/multicast/broadcast
1084 */
1089
1094
1099
1100 UPDATE_EXTEND_XSTAT(ucast_pkts_sent,
1101 total_unicast_packets_transmitted);
1102 UPDATE_EXTEND_XSTAT(mcast_pkts_sent,
1103 total_multicast_packets_transmitted);
1104 UPDATE_EXTEND_XSTAT(bcast_pkts_sent,
1105 total_broadcast_packets_transmitted);
1106
1107 UPDATE_EXTEND_TSTAT(checksum_discard,
1108 total_packets_received_checksum_discarded);
1109 UPDATE_EXTEND_TSTAT(ttl0_discard,
1110 total_packets_received_ttl0_discarded);
1111
1112 UPDATE_EXTEND_XSTAT(error_drop_pkts,
1113 total_transmitted_dropped_packets_error);
1114
1115 /* TPA aggregations completed */
1116 UPDATE_EXTEND_E_USTAT(coalesced_events, total_tpa_aggregations);
1117 /* Number of network frames aggregated by TPA */
1118 UPDATE_EXTEND_E_USTAT(coalesced_pkts, total_tpa_aggregated_frames);
1119 /* Total number of bytes in completed TPA aggregations */
1120 UPDATE_QSTAT(uclient->coalesced_bytes, total_tpa_bytes);
1121
1122 UPDATE_ESTAT_QSTAT_64(total_tpa_bytes);
1123
1124 UPDATE_FSTAT_QSTAT(total_bytes_received);
1125 UPDATE_FSTAT_QSTAT(total_bytes_transmitted);
1126 UPDATE_FSTAT_QSTAT(total_unicast_packets_received);
1127 UPDATE_FSTAT_QSTAT(total_multicast_packets_received);
1128 UPDATE_FSTAT_QSTAT(total_broadcast_packets_received);
1129 UPDATE_FSTAT_QSTAT(total_unicast_packets_transmitted);
1130 UPDATE_FSTAT_QSTAT(total_multicast_packets_transmitted);
1131 UPDATE_FSTAT_QSTAT(total_broadcast_packets_transmitted);
1132 UPDATE_FSTAT_QSTAT(valid_bytes_received);
1133 }
1134
1139
1141 tfunc->rcv_error_bytes.hi,
1143 tfunc->rcv_error_bytes.lo);
1144
1146 tfunc->rcv_error_bytes.hi,
1148 tfunc->rcv_error_bytes.lo);
1149
1150 UPDATE_ESTAT(etherstatsoverrsizepkts, rx_stat_dot3statsframestoolong);
1151
1156
1157 if (sc->port.pmf) {
1158 struct bxe_fw_port_stats_old *fwstats = &sc->fw_stats_old;
1163 }
1164
1165 fstats->host_func_stats_start = ++fstats->host_func_stats_end;
1166
1167 sc->stats_pending = 0;
1168
1169 return (0);
1170}
1171
1172static void
1174{
1175
1176 for (int i = 0; i < sc->num_queues; i++)
1177 if_inc_counter(sc->ifp, IFCOUNTER_IQDROPS,
1178 le32toh(sc->fp[i].old_tclient.checksum_discard));
1179}
1180
1181uint64_t
1182bxe_get_counter(if_t ifp, ift_counter cnt)
1183{
1184 struct bxe_softc *sc;
1185 struct bxe_eth_stats *estats;
1186
1187 sc = if_getsoftc(ifp);
1188 estats = &sc->eth_stats;
1189
1190 switch (cnt) {
1191 case IFCOUNTER_IPACKETS:
1195 case IFCOUNTER_OPACKETS:
1199 case IFCOUNTER_IBYTES:
1200 return (bxe_hilo(&estats->total_bytes_received_hi));
1201 case IFCOUNTER_OBYTES:
1202 return (bxe_hilo(&estats->total_bytes_transmitted_hi));
1203 case IFCOUNTER_IERRORS:
1206 bxe_hilo(&estats->brb_drop_hi) +
1207 bxe_hilo(&estats->brb_truncate_hi) +
1210 bxe_hilo(&estats->no_buff_discard_hi));
1211 case IFCOUNTER_OERRORS:
1214 case IFCOUNTER_IMCASTS:
1216 case IFCOUNTER_COLLISIONS:
1217 return (bxe_hilo(&estats->tx_stat_etherstatscollisions_hi) +
1220 default:
1221 return (if_get_counter_default(ifp, cnt));
1222 }
1223}
1224
1225static void
1227{
1228 struct bxe_eth_stats *estats = &sc->eth_stats;
1229 int i;
1230
1231 for (i = 0; i < sc->num_queues; i++) {
1232 struct bxe_eth_q_stats *qstats = &sc->fp[i].eth_q_stats;
1233 struct bxe_eth_q_stats_old *qstats_old = &sc->fp[i].eth_q_stats_old;
1234
1235 UPDATE_ESTAT_QSTAT(rx_calls);
1236 UPDATE_ESTAT_QSTAT(rx_pkts);
1237 UPDATE_ESTAT_QSTAT(rx_tpa_pkts);
1238 UPDATE_ESTAT_QSTAT(rx_erroneous_jumbo_sge_pkts);
1239 UPDATE_ESTAT_QSTAT(rx_bxe_service_rxsgl);
1240 UPDATE_ESTAT_QSTAT(rx_jumbo_sge_pkts);
1241 UPDATE_ESTAT_QSTAT(rx_soft_errors);
1242 UPDATE_ESTAT_QSTAT(rx_hw_csum_errors);
1243 UPDATE_ESTAT_QSTAT(rx_ofld_frames_csum_ip);
1244 UPDATE_ESTAT_QSTAT(rx_ofld_frames_csum_tcp_udp);
1245 UPDATE_ESTAT_QSTAT(rx_budget_reached);
1246 UPDATE_ESTAT_QSTAT(tx_pkts);
1247 UPDATE_ESTAT_QSTAT(tx_soft_errors);
1248 UPDATE_ESTAT_QSTAT(tx_ofld_frames_csum_ip);
1249 UPDATE_ESTAT_QSTAT(tx_ofld_frames_csum_tcp);
1250 UPDATE_ESTAT_QSTAT(tx_ofld_frames_csum_udp);
1251 UPDATE_ESTAT_QSTAT(tx_ofld_frames_lso);
1252 UPDATE_ESTAT_QSTAT(tx_ofld_frames_lso_hdr_splits);
1253 UPDATE_ESTAT_QSTAT(tx_encap_failures);
1254 UPDATE_ESTAT_QSTAT(tx_hw_queue_full);
1255 UPDATE_ESTAT_QSTAT(tx_hw_max_queue_depth);
1256 UPDATE_ESTAT_QSTAT(tx_dma_mapping_failure);
1257 UPDATE_ESTAT_QSTAT(tx_max_drbr_queue_depth);
1258 UPDATE_ESTAT_QSTAT(tx_window_violation_std);
1259 UPDATE_ESTAT_QSTAT(tx_window_violation_tso);
1260 //UPDATE_ESTAT_QSTAT(tx_unsupported_tso_request_ipv6);
1261 //UPDATE_ESTAT_QSTAT(tx_unsupported_tso_request_not_tcp);
1262 UPDATE_ESTAT_QSTAT(tx_chain_lost_mbuf);
1263 UPDATE_ESTAT_QSTAT(tx_frames_deferred);
1264 UPDATE_ESTAT_QSTAT(tx_queue_xoff);
1265
1266 /* mbuf driver statistics */
1267 UPDATE_ESTAT_QSTAT(mbuf_defrag_attempts);
1268 UPDATE_ESTAT_QSTAT(mbuf_defrag_failures);
1269 UPDATE_ESTAT_QSTAT(mbuf_rx_bd_alloc_failed);
1270 UPDATE_ESTAT_QSTAT(mbuf_rx_bd_mapping_failed);
1271 UPDATE_ESTAT_QSTAT(mbuf_rx_tpa_alloc_failed);
1272 UPDATE_ESTAT_QSTAT(mbuf_rx_tpa_mapping_failed);
1273 UPDATE_ESTAT_QSTAT(mbuf_rx_sge_alloc_failed);
1274 UPDATE_ESTAT_QSTAT(mbuf_rx_sge_mapping_failed);
1275
1276 /* track the number of allocated mbufs */
1277 UPDATE_ESTAT_QSTAT(mbuf_alloc_tx);
1278 UPDATE_ESTAT_QSTAT(mbuf_alloc_rx);
1279 UPDATE_ESTAT_QSTAT(mbuf_alloc_sge);
1280 UPDATE_ESTAT_QSTAT(mbuf_alloc_tpa);
1281 }
1282}
1283
1284static uint8_t
1286{
1287 uint32_t val;
1288
1289 if (SHMEM2_HAS(sc, edebug_driver_if[1])) {
1290 val = SHMEM2_RD(sc, edebug_driver_if[1]);
1291
1293 return (TRUE);
1294 }
1295 }
1296
1297 return (FALSE);
1298}
1299
1300static void
1302{
1303 uint32_t *stats_comp = BXE_SP(sc, stats_comp);
1304
1305 if (bxe_edebug_stats_stopped(sc)) {
1306 return;
1307 }
1308
1309 if (IS_PF(sc)) {
1310 if (*stats_comp != DMAE_COMP_VAL) {
1311 return;
1312 }
1313
1314 if (sc->port.pmf) {
1316 }
1317
1318 if (bxe_storm_stats_update(sc)) {
1319 if (sc->stats_pending++ == 3) {
1320 if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) {
1321 BLOGE(sc, "Storm stats not updated for 3 times, resetting\n");
1323 taskqueue_enqueue_timeout(taskqueue_thread,
1324 &sc->sp_err_timeout_task, hz/10);
1325 }
1326 }
1327 return;
1328 }
1329 } else {
1330 /*
1331 * VF doesn't collect HW statistics, and doesn't get completions,
1332 * performs only update.
1333 */
1335 }
1336
1339
1340 /* vf is done */
1341 if (IS_VF(sc)) {
1342 return;
1343 }
1344
1347}
1348
1349static void
1351{
1352 struct dmae_cmd *dmae;
1353 uint32_t opcode;
1354 int loader_idx = PMF_DMAE_C(sc);
1355 uint32_t *stats_comp = BXE_SP(sc, stats_comp);
1356
1357 sc->executer_idx = 0;
1358
1360
1361 if (sc->port.port_stx) {
1362 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
1363
1364 if (sc->func_stx) {
1366 } else {
1368 }
1369
1370 dmae->src_addr_lo = U64_LO(BXE_SP_MAPPING(sc, port_stats));
1371 dmae->src_addr_hi = U64_HI(BXE_SP_MAPPING(sc, port_stats));
1372 dmae->dst_addr_lo = sc->port.port_stx >> 2;
1373 dmae->dst_addr_hi = 0;
1374 dmae->len = bxe_get_port_stats_dma_len(sc);
1375 if (sc->func_stx) {
1376 dmae->comp_addr_lo = (dmae_reg_go_c[loader_idx] >> 2);
1377 dmae->comp_addr_hi = 0;
1378 dmae->comp_val = 1;
1379 } else {
1380 dmae->comp_addr_lo = U64_LO(BXE_SP_MAPPING(sc, stats_comp));
1381 dmae->comp_addr_hi = U64_HI(BXE_SP_MAPPING(sc, stats_comp));
1382 dmae->comp_val = DMAE_COMP_VAL;
1383
1384 *stats_comp = 0;
1385 }
1386 }
1387
1388 if (sc->func_stx) {
1389 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
1391 dmae->src_addr_lo = U64_LO(BXE_SP_MAPPING(sc, func_stats));
1392 dmae->src_addr_hi = U64_HI(BXE_SP_MAPPING(sc, func_stats));
1393 dmae->dst_addr_lo = (sc->func_stx >> 2);
1394 dmae->dst_addr_hi = 0;
1395 dmae->len = (sizeof(struct host_func_stats) >> 2);
1396 dmae->comp_addr_lo = U64_LO(BXE_SP_MAPPING(sc, stats_comp));
1397 dmae->comp_addr_hi = U64_HI(BXE_SP_MAPPING(sc, stats_comp));
1398 dmae->comp_val = DMAE_COMP_VAL;
1399
1400 *stats_comp = 0;
1401 }
1402}
1403
1404static void
1406{
1407 uint8_t update = FALSE;
1408
1409 bxe_stats_comp(sc);
1410
1411 if (sc->port.pmf) {
1412 update = bxe_hw_stats_update(sc) == 0;
1413 }
1414
1415 update |= bxe_storm_stats_update(sc) == 0;
1416
1417 if (update) {
1419
1420 if (sc->port.pmf) {
1422 }
1423
1425 bxe_stats_comp(sc);
1426 }
1427}
1428
1429static void
1431{
1432 return;
1433}
1434
1435static const struct {
1436 void (*action)(struct bxe_softc *sc);
1439 {
1440 /* DISABLED PMF */ { bxe_stats_pmf_update, STATS_STATE_DISABLED },
1441 /* LINK_UP */ { bxe_stats_start, STATS_STATE_ENABLED },
1444 },
1445 {
1446 /* ENABLED PMF */ { bxe_stats_pmf_start, STATS_STATE_ENABLED },
1447 /* LINK_UP */ { bxe_stats_restart, STATS_STATE_ENABLED },
1448 /* UPDATE */ { bxe_stats_update, STATS_STATE_ENABLED },
1449 /* STOP */ { bxe_stats_stop, STATS_STATE_DISABLED }
1450 }
1452
1454 enum bxe_stats_event event)
1455{
1457
1458 if (__predict_false(sc->panic)) {
1459 return;
1460 }
1461
1462 BXE_STATS_LOCK(sc);
1463 state = sc->stats_state;
1464 sc->stats_state = bxe_stats_stm[state][event].next_state;
1465 BXE_STATS_UNLOCK(sc);
1466
1467 bxe_stats_stm[state][event].action(sc);
1468
1469 if (event != STATS_EVENT_UPDATE) {
1470 BLOGD(sc, DBG_STATS,
1471 "state %d -> event %d -> state %d\n",
1472 state, event, sc->stats_state);
1473 }
1474}
1475
1476static void
1478{
1479 struct dmae_cmd *dmae;
1480 uint32_t *stats_comp = BXE_SP(sc, stats_comp);
1481
1482 /* sanity */
1483 if (!sc->port.pmf || !sc->port.port_stx) {
1484 BLOGE(sc, "BUG!\n");
1485 return;
1486 }
1487
1488 sc->executer_idx = 0;
1489
1490 dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
1492 TRUE, DMAE_COMP_PCI);
1493 dmae->src_addr_lo = U64_LO(BXE_SP_MAPPING(sc, port_stats));
1494 dmae->src_addr_hi = U64_HI(BXE_SP_MAPPING(sc, port_stats));
1495 dmae->dst_addr_lo = (sc->port.port_stx >> 2);
1496 dmae->dst_addr_hi = 0;
1497 dmae->len = bxe_get_port_stats_dma_len(sc);
1498 dmae->comp_addr_lo = U64_LO(BXE_SP_MAPPING(sc, stats_comp));
1499 dmae->comp_addr_hi = U64_HI(BXE_SP_MAPPING(sc, stats_comp));
1500 dmae->comp_val = DMAE_COMP_VAL;
1501
1502 *stats_comp = 0;
1504 bxe_stats_comp(sc);
1505}
1506
1507/*
1508 * This function will prepare the statistics ramrod data the way
1509 * we will only have to increment the statistics counter and
1510 * send the ramrod each time we have to.
1511 */
1512static void
1514{
1515 int i;
1516 int first_queue_query_index;
1517 struct stats_query_header *stats_hdr = &sc->fw_stats_req->hdr;
1518 bus_addr_t cur_data_offset;
1519 struct stats_query_entry *cur_query_entry;
1520
1521 stats_hdr->cmd_num = sc->fw_stats_num;
1522 stats_hdr->drv_stats_counter = 0;
1523
1524 /*
1525 * The storm_counters struct contains the counters of completed
1526 * statistics requests per storm which are incremented by FW
1527 * each time it completes hadning a statistics ramrod. We will
1528 * check these counters in the timer handler and discard a
1529 * (statistics) ramrod completion.
1530 */
1531 cur_data_offset = (sc->fw_stats_data_mapping +
1532 offsetof(struct bxe_fw_stats_data, storm_counters));
1533
1534 stats_hdr->stats_counters_addrs.hi = htole32(U64_HI(cur_data_offset));
1535 stats_hdr->stats_counters_addrs.lo = htole32(U64_LO(cur_data_offset));
1536
1537 /*
1538 * Prepare the first stats ramrod (will be completed with
1539 * the counters equal to zero) - init counters to somethig different.
1540 */
1541 memset(&sc->fw_stats_data->storm_counters, 0xff,
1542 sizeof(struct stats_counter));
1543
1544 /**** Port FW statistics data ****/
1545 cur_data_offset = (sc->fw_stats_data_mapping +
1546 offsetof(struct bxe_fw_stats_data, port));
1547
1548 cur_query_entry = &sc->fw_stats_req->query[BXE_PORT_QUERY_IDX];
1549
1550 cur_query_entry->kind = STATS_TYPE_PORT;
1551 /* For port query index is a DONT CARE */
1552 cur_query_entry->index = SC_PORT(sc);
1553 /* For port query funcID is a DONT CARE */
1554 cur_query_entry->funcID = htole16(SC_FUNC(sc));
1555 cur_query_entry->address.hi = htole32(U64_HI(cur_data_offset));
1556 cur_query_entry->address.lo = htole32(U64_LO(cur_data_offset));
1557
1558 /**** PF FW statistics data ****/
1559 cur_data_offset = (sc->fw_stats_data_mapping +
1560 offsetof(struct bxe_fw_stats_data, pf));
1561
1562 cur_query_entry = &sc->fw_stats_req->query[BXE_PF_QUERY_IDX];
1563
1564 cur_query_entry->kind = STATS_TYPE_PF;
1565 /* For PF query index is a DONT CARE */
1566 cur_query_entry->index = SC_PORT(sc);
1567 cur_query_entry->funcID = htole16(SC_FUNC(sc));
1568 cur_query_entry->address.hi = htole32(U64_HI(cur_data_offset));
1569 cur_query_entry->address.lo = htole32(U64_LO(cur_data_offset));
1570
1571 /**** Clients' queries ****/
1572 cur_data_offset = (sc->fw_stats_data_mapping +
1573 offsetof(struct bxe_fw_stats_data, queue_stats));
1574
1575 /*
1576 * First queue query index depends whether FCoE offloaded request will
1577 * be included in the ramrod
1578 */
1579 first_queue_query_index = (BXE_FIRST_QUEUE_QUERY_IDX - 1);
1580
1581 for (i = 0; i < sc->num_queues; i++) {
1582 cur_query_entry =
1583 &sc->fw_stats_req->query[first_queue_query_index + i];
1584
1585 cur_query_entry->kind = STATS_TYPE_QUEUE;
1586 cur_query_entry->index = bxe_stats_id(&sc->fp[i]);
1587 cur_query_entry->funcID = htole16(SC_FUNC(sc));
1588 cur_query_entry->address.hi = htole32(U64_HI(cur_data_offset));
1589 cur_query_entry->address.lo = htole32(U64_LO(cur_data_offset));
1590
1591 cur_data_offset += sizeof(struct per_queue_stats);
1592 }
1593}
1594
1595void
1597{
1598 int /*abs*/port = SC_PORT(sc);
1599 int mb_idx = SC_FW_MB_IDX(sc);
1600 int i;
1601
1602 sc->stats_pending = 0;
1603 sc->executer_idx = 0;
1604 sc->stats_counter = 0;
1605
1606 /* port and func stats for management */
1607 if (!BXE_NOMCP(sc)) {
1608 sc->port.port_stx = SHMEM_RD(sc, port_mb[port].port_stx);
1609 sc->func_stx = SHMEM_RD(sc, func_mb[mb_idx].fw_mb_param);
1610 } else {
1611 sc->port.port_stx = 0;
1612 sc->func_stx = 0;
1613 }
1614
1615 BLOGD(sc, DBG_STATS, "port_stx 0x%x func_stx 0x%x\n",
1616 sc->port.port_stx, sc->func_stx);
1617
1618 /* pmf should retrieve port statistics from SP on a non-init*/
1619 if (!sc->stats_init && sc->port.pmf && sc->port.port_stx) {
1621 }
1622
1623 port = SC_PORT(sc);
1624 /* port stats */
1625 memset(&(sc->port.old_nig_stats), 0, sizeof(struct nig_stats));
1627 REG_RD(sc, NIG_REG_STAT0_BRB_DISCARD + port*0x38);
1629 REG_RD(sc, NIG_REG_STAT0_BRB_TRUNCATE + port*0x38);
1630 if (!CHIP_IS_E3(sc)) {
1635 }
1636
1637 /* function stats */
1638 for (i = 0; i < sc->num_queues; i++) {
1639 memset(&sc->fp[i].old_tclient, 0, sizeof(sc->fp[i].old_tclient));
1640 memset(&sc->fp[i].old_uclient, 0, sizeof(sc->fp[i].old_uclient));
1641 memset(&sc->fp[i].old_xclient, 0, sizeof(sc->fp[i].old_xclient));
1642 if (sc->stats_init) {
1643 memset(&sc->fp[i].eth_q_stats, 0,
1644 sizeof(sc->fp[i].eth_q_stats));
1645 memset(&sc->fp[i].eth_q_stats_old, 0,
1646 sizeof(sc->fp[i].eth_q_stats_old));
1647 }
1648 }
1649
1650 /* prepare statistics ramrod data */
1652
1653 if (sc->stats_init) {
1654 memset(&sc->net_stats_old, 0, sizeof(sc->net_stats_old));
1655 memset(&sc->fw_stats_old, 0, sizeof(sc->fw_stats_old));
1656 memset(&sc->eth_stats_old, 0, sizeof(sc->eth_stats_old));
1657 memset(&sc->eth_stats, 0, sizeof(sc->eth_stats));
1658 memset(&sc->func_stats, 0, sizeof(sc->func_stats));
1659
1660 /* Clean SP from previous statistics */
1661 if (sc->func_stx) {
1662 memset(BXE_SP(sc, func_stats), 0, sizeof(struct host_func_stats));
1665 bxe_stats_comp(sc);
1666 }
1667 }
1668
1670
1671 if (sc->port.pmf && sc->port.port_stx) {
1673 }
1674
1675 /* mark the end of statistics initialization */
1676 sc->stats_init = FALSE;
1677}
1678
1679void
1681{
1682 int i;
1683
1684 /* save queue statistics */
1685 for (i = 0; i < sc->num_queues; i++) {
1686 struct bxe_fastpath *fp = &sc->fp[i];
1687 struct bxe_eth_q_stats *qstats = &fp->eth_q_stats;
1688 struct bxe_eth_q_stats_old *qstats_old = &fp->eth_q_stats_old;
1689
1704 }
1705
1706 /* store port firmware statistics */
1707 if (sc->port.pmf) {
1708 struct bxe_eth_stats *estats = &sc->eth_stats;
1709 struct bxe_fw_port_stats_old *fwstats = &sc->fw_stats_old;
1710 struct host_port_stats *pstats = BXE_SP(sc, port_stats);
1711
1712 fwstats->pfc_frames_rx_hi = pstats->pfc_frames_rx_hi;
1713 fwstats->pfc_frames_rx_lo = pstats->pfc_frames_rx_lo;
1714 fwstats->pfc_frames_tx_hi = pstats->pfc_frames_tx_hi;
1715 fwstats->pfc_frames_tx_lo = pstats->pfc_frames_tx_lo;
1716
1717 if (IS_MF(sc)) {
1718 UPDATE_FW_STAT_OLD(mac_filter_discard);
1719 UPDATE_FW_STAT_OLD(mf_tag_discard);
1720 UPDATE_FW_STAT_OLD(brb_truncate_discard);
1721 UPDATE_FW_STAT_OLD(mac_discard);
1722 }
1723 }
1724}
1725
1726void
1728 void *void_afex_stats,
1729 uint32_t stats_type)
1730{
1731 int i;
1732 struct afex_stats *afex_stats = (struct afex_stats *)void_afex_stats;
1733 struct bxe_eth_stats *estats = &sc->eth_stats;
1734
1735 memset(afex_stats, 0, sizeof(struct afex_stats));
1736
1737 for (i = 0; i < sc->num_queues; i++) {
1738 struct bxe_eth_q_stats *qstats = &sc->fp[i].eth_q_stats;
1739
1744
1749
1754
1759
1764
1769
1770 /*
1771 * sum to rx_frames_discarded all discarded
1772 * packets due to size, ttl0 and checksum
1773 */
1778
1783
1788
1790 qstats->no_buff_discard_hi,
1792 qstats->no_buff_discard_lo);
1793
1798
1803
1808
1813
1818
1823
1828 }
1829
1830 /*
1831 * If port stats are requested, add them to the PMF
1832 * stats, as anyway they will be accumulated by the
1833 * MCP before sent to the switch
1834 */
1835 if ((sc->port.pmf) && (stats_type == VICSTATST_UIF_INDEX)) {
1837 0,
1839 estats->mac_filter_discard);
1841 0,
1843 estats->brb_truncate_discard);
1845 0,
1847 estats->mac_discard);
1848 }
1849}
1850
uint32_t bxe_dmae_opcode_clr_src_reset(uint32_t opcode)
Definition: bxe.c:1531
uint32_t bxe_dmae_opcode(struct bxe_softc *sc, uint8_t src_type, uint8_t dst_type, uint8_t with_comp, uint8_t comp_type)
Definition: bxe.c:1537
void bxe_post_dmae(struct bxe_softc *sc, struct dmae_cmd *dmae, int idx)
Definition: bxe.c:1507
int bxe_sp_post(struct bxe_softc *sc, int command, int cid, uint32_t data_hi, uint32_t data_lo, int cmd_type)
Definition: bxe.c:2399
uint32_t size
Definition: bxe.c:322
uint32_t bxe_dmae_opcode_add_comp(uint32_t opcode, uint8_t comp_type)
Definition: bxe.c:1523
#define IS_MF(sc)
Definition: bxe.h:1078
#define BXE_SP_MAPPING(sc, var)
Definition: bxe.h:1881
#define SHMEM2_RD(sc, field)
Definition: bxe.h:1938
#define DMAE_DST_PCI
Definition: bxe.h:1958
#define PMF_DMAE_C(sc)
Definition: bxe.h:1999
#define CHIP_IS_E1(sc)
Definition: bxe.h:1161
#define U64_LO(addr)
Definition: bxe.h:171
#define BXE_SET_ERROR_BIT(sc, error)
Definition: bxe.h:453
#define DMAE_SRC_GRC
Definition: bxe.h:1955
#define DMAE_SRC_PCI
Definition: bxe.h:1954
#define SC_FW_MB_IDX(sc)
Definition: bxe.h:1402
#define IS_VF(sc)
Definition: bxe.h:1217
#define DMAE_COMP_GRC
Definition: bxe.h:1962
#define BXE_SP(sc, var)
Definition: bxe.h:1880
static uint8_t bxe_stats_id(struct bxe_fastpath *fp)
Definition: bxe.h:2434
#define CHIP_IS_E1x(sc)
Definition: bxe.h:1167
static const uint32_t dmae_reg_go_c[]
Definition: bxe.h:2001
#define BXE_ERR_STATS_TO
Definition: bxe.h:1506
#define BXE_STATS_LOCK(sc)
Definition: bxe.h:1461
#define DMAE_LEN32_RD_MAX
Definition: bxe.h:1992
#define SHMEM2_HAS(sc, field)
Definition: bxe.h:1935
#define DMAE_COMP_VAL
Definition: bxe.h:1995
#define SC_PORT(sc)
Definition: bxe.h:1389
#define HILO_U64(hi, lo)
Definition: bxe.h:174
#define DBASSERT(sc, exp, msg)
Definition: bxe.h:2178
#define DBG_STATS
Definition: bxe.h:2167
#define IS_PF(sc)
Definition: bxe.h:1221
#define DMAE_DST_GRC
Definition: bxe.h:1959
#define SC_FUNC(sc)
Definition: bxe.h:1390
#define U64_HI(addr)
Definition: bxe.h:172
#define CHIP_REV_IS_SLOW(sc)
Definition: bxe.h:1149
@ BXE_FIRST_QUEUE_QUERY_IDX
Definition: bxe.h:875
@ BXE_PORT_QUERY_IDX
Definition: bxe.h:872
@ BXE_PF_QUERY_IDX
Definition: bxe.h:873
#define CHIP_IS_E3(sc)
Definition: bxe.h:1192
#define REG_RD(sc, offset)
Definition: bxe.h:1874
#define INIT_DMAE_C(sc)
Definition: bxe.h:1998
#define BLOGE(sc, format, args...)
Definition: bxe.h:2235
#define BLOGD(sc, codepath, format, args...)
Definition: bxe.h:2188
#define BXE_NOMCP(sc)
Definition: bxe.h:1339
#define SHMEM_RD(sc, field)
Definition: bxe.h:1929
#define BXE_STATS_UNLOCK(sc)
Definition: bxe.h:1462
#define REG_RD_DMAE(sc, offset, valp, len32)
Definition: bxe.h:1887
#define DMAE_COMP_PCI
Definition: bxe.h:1961
void bxe_save_statistics(struct bxe_softc *sc)
Definition: bxe_stats.c:1680
static void bxe_prep_fw_stats_req(struct bxe_softc *sc)
Definition: bxe_stats.c:1513
static void bxe_func_stats_init(struct bxe_softc *sc)
Definition: bxe_stats.c:546
static long bxe_hilo(uint32_t *hiref)
Definition: bxe_stats.c:43
static void bxe_dp_stats(struct bxe_softc *sc)
Definition: bxe_stats.c:98
static uint16_t bxe_get_port_stats_dma_len(struct bxe_softc *sc)
Definition: bxe_stats.c:55
static void bxe_storm_stats_post(struct bxe_softc *sc)
Definition: bxe_stats.c:144
static void bxe_mstat_stats_update(struct bxe_softc *sc)
Definition: bxe_stats.c:724
uint64_t bxe_get_counter(if_t ifp, ift_counter cnt)
Definition: bxe_stats.c:1182
static void bxe_bmac_stats_update(struct bxe_softc *sc)
Definition: bxe_stats.c:621
void bxe_afex_collect_stats(struct bxe_softc *sc, void *void_afex_stats, uint32_t stats_type)
Definition: bxe_stats.c:1727
static void bxe_stats_start(struct bxe_softc *sc)
Definition: bxe_stats.c:575
static void bxe_net_stats_update(struct bxe_softc *sc)
Definition: bxe_stats.c:1173
static void bxe_hw_stats_post(struct bxe_softc *sc)
Definition: bxe_stats.c:182
static void bxe_emac_stats_update(struct bxe_softc *sc)
Definition: bxe_stats.c:802
static void bxe_stats_update(struct bxe_softc *sc)
Definition: bxe_stats.c:1301
static void bxe_stats_pmf_start(struct bxe_softc *sc)
Definition: bxe_stats.c:598
static void bxe_stats_do_nothing(struct bxe_softc *sc)
Definition: bxe_stats.c:1430
static void bxe_stats_stop(struct bxe_softc *sc)
Definition: bxe_stats.c:1405
static void bxe_port_stats_stop(struct bxe_softc *sc)
Definition: bxe_stats.c:1350
static uint8_t bxe_edebug_stats_stopped(struct bxe_softc *sc)
Definition: bxe_stats.c:1285
__FBSDID("$FreeBSD$")
void(* action)(struct bxe_softc *sc)
Definition: bxe_stats.c:1436
void bxe_stats_init(struct bxe_softc *sc)
Definition: bxe_stats.c:1596
static void bxe_port_stats_init(struct bxe_softc *sc)
Definition: bxe_stats.c:318
void bxe_stats_handle(struct bxe_softc *sc, enum bxe_stats_event event)
Definition: bxe_stats.c:1453
static void bxe_stats_restart(struct bxe_softc *sc)
Definition: bxe_stats.c:606
static void bxe_drv_stats_update(struct bxe_softc *sc)
Definition: bxe_stats.c:1226
static int bxe_hw_stats_update(struct bxe_softc *sc)
Definition: bxe_stats.c:860
static int bxe_storm_stats_update(struct bxe_softc *sc)
Definition: bxe_stats.c:987
static void bxe_stats_pmf_update(struct bxe_softc *sc)
Definition: bxe_stats.c:259
static int bxe_storm_stats_validate_counters(struct bxe_softc *sc)
Definition: bxe_stats.c:937
static const struct @14 bxe_stats_stm[STATS_STATE_MAX][STATS_EVENT_MAX]
enum bxe_stats_state next_state
Definition: bxe_stats.c:1437
static int bxe_stats_comp(struct bxe_softc *sc)
Definition: bxe_stats.c:232
static void bxe_port_stats_base_init(struct bxe_softc *sc)
Definition: bxe_stats.c:1477
bxe_stats_event
Definition: bxe_stats.h:59
@ STATS_EVENT_UPDATE
Definition: bxe_stats.h:62
@ STATS_EVENT_MAX
Definition: bxe_stats.h:64
@ STATS_EVENT_PMF
Definition: bxe_stats.h:60
bxe_stats_state
Definition: bxe_stats.h:67
@ STATS_STATE_DISABLED
Definition: bxe_stats.h:68
@ STATS_STATE_MAX
Definition: bxe_stats.h:70
@ STATS_STATE_ENABLED
Definition: bxe_stats.h:69
#define UPDATE_ESTAT_QSTAT_64(s)
Definition: bxe_stats.h:640
#define UPDATE_ESTAT(s, t)
Definition: bxe_stats.h:679
#define UPDATE_QSTAT_OLD(f)
Definition: bxe_stats.h:635
#define ADD_EXTEND_64(s_hi, s_lo, a)
Definition: bxe_stats.h:574
#define ADD_64_LE(s_hi, a_hi_le, s_lo, a_lo_le)
Definition: bxe_stats.h:519
#define UPDATE_ESTAT_QSTAT(s)
Definition: bxe_stats.h:650
#define UPDATE_EXTEND_TSTAT(s, t)
Definition: bxe_stats.h:601
#define UPDATE_QSTAT(s, t)
Definition: bxe_stats.h:629
#define UPDATE_FW_STAT_OLD(f)
Definition: bxe_stats.h:674
#define UPDATE_FW_STAT(s)
Definition: bxe_stats.h:669
#define UPDATE_STAT64_NIG(s, t)
Definition: bxe_stats.h:565
#define SUB_EXTEND_USTAT(s, t)
Definition: bxe_stats.h:701
#define UPDATE_EXTEND_E_USTAT(s, t)
Definition: bxe_stats.h:616
#define UPDATE_FSTAT_QSTAT(s)
Definition: bxe_stats.h:657
#define UPDATE_EXTEND_XSTAT(s, t)
Definition: bxe_stats.h:622
#define UPDATE_STAT64(s, t)
Definition: bxe_stats.h:555
#define ADD_STAT64(diff, t)
Definition: bxe_stats.h:580
#define UPDATE_EXTEND_STAT(s)
Definition: bxe_stats.h:586
#define UPDATE_EXTEND_E_TSTAT(s, t, size)
Definition: bxe_stats.h:603
#define ADD_64(s_hi, a_hi, s_lo, a_lo)
Definition: bxe_stats.h:509
@ RAMROD_CMD_ID_COMMON_STAT_QUERY
Definition: ecore_hsi.h:11319
#define EDEBUG_DRIVER_IF_OP_CODE_DISABLE_STAT
Definition: ecore_hsi.h:2633
#define VICSTATST_UIF_INDEX
Definition: ecore_hsi.h:3454
#define REQ_BC_VER_4_PFC_STATS_SUPPORTED
Definition: ecore_hsi.h:1705
@ STATS_TYPE_PORT
Definition: ecore_hsi.h:12238
@ STATS_TYPE_QUEUE
Definition: ecore_hsi.h:12237
@ STATS_TYPE_PF
Definition: ecore_hsi.h:12239
@ NONE_CONNECTION_TYPE
Definition: ecore_hsi.h:11340
#define BIGMAC_REGISTER_RX_STAT_GRIPJ
Definition: ecore_reg.h:1765
#define NIG_REG_STAT0_EGRESS_MAC_PKT0
Definition: ecore_reg.h:804
#define MSTAT_REG_RX_STAT_GR64_LO
Definition: ecore_reg.h:496
#define NIG_REG_STAT0_BRB_DISCARD
Definition: ecore_reg.h:800
#define BIGMAC2_REGISTER_TX_STAT_GTPOK
Definition: ecore_reg.h:1787
#define BIGMAC_REGISTER_TX_STAT_GTPKT
Definition: ecore_reg.h:1771
#define MSTAT_REG_TX_STAT_GTXPOK_LO
Definition: ecore_reg.h:498
#define BIGMAC2_REGISTER_RX_STAT_GRIPJ
Definition: ecore_reg.h:1781
#define EMAC_REG_EMAC_TX_STAT_AC_COUNT
Definition: ecore_reg.h:1825
#define EMAC_REG_EMAC_RX_STAT_AC
Definition: ecore_reg.h:1820
#define BIGMAC2_REGISTER_RX_STAT_GR64
Definition: ecore_reg.h:1780
#define GRCBASE_EMAC1
Definition: ecore_reg.h:2166
#define EMAC_REG_EMAC_TX_STAT_AC
Definition: ecore_reg.h:1824
#define GRCBASE_MSTAT1
Definition: ecore_reg.h:2197
#define NIG_REG_STAT0_BRB_TRUNCATE
Definition: ecore_reg.h:802
#define BIGMAC2_REGISTER_TX_STAT_GTBYT
Definition: ecore_reg.h:1786
#define BIGMAC_REGISTER_TX_STAT_GTBYT
Definition: ecore_reg.h:1770
#define DMAE_REG_CMD_MEM
Definition: ecore_reg.h:146
#define NIG_REG_INGRESS_BMAC0_MEM
Definition: ecore_reg.h:538
#define GRCBASE_MSTAT0
Definition: ecore_reg.h:2196
#define GRCBASE_EMAC0
Definition: ecore_reg.h:2165
#define NIG_REG_STAT1_EGRESS_MAC_PKT0
Definition: ecore_reg.h:810
#define BIGMAC_REGISTER_RX_STAT_GR64
Definition: ecore_reg.h:1764
#define NIG_REG_STAT1_EGRESS_MAC_PKT1
Definition: ecore_reg.h:812
#define MISC_REG_CPMU_LP_SM_ENT_CNT_P0
Definition: ecore_reg.h:420
#define MISC_REG_CPMU_LP_SM_ENT_CNT_P1
Definition: ecore_reg.h:422
#define NIG_REG_STAT1_BRB_DISCARD
Definition: ecore_reg.h:808
#define NIG_REG_STAT0_EGRESS_MAC_PKT1
Definition: ecore_reg.h:806
#define EMAC_REG_EMAC_RX_STAT_AC_28
Definition: ecore_reg.h:1821
#define EMAC_REG_EMAC_RX_STAT_AC_COUNT
Definition: ecore_reg.h:1822
#define NIG_REG_INGRESS_BMAC1_MEM
Definition: ecore_reg.h:540
uint32_t tx_multicast_bytes_lo
Definition: ecore_hsi.h:3469
uint32_t rx_frames_discarded_lo
Definition: ecore_hsi.h:3492
uint32_t tx_unicast_bytes_lo
Definition: ecore_hsi.h:3465
uint32_t rx_multicast_bytes_hi
Definition: ecore_hsi.h:3485
uint32_t rx_multicast_frames_hi
Definition: ecore_hsi.h:3483
uint32_t rx_broadcast_frames_lo
Definition: ecore_hsi.h:3488
uint32_t tx_unicast_bytes_hi
Definition: ecore_hsi.h:3464
uint32_t tx_multicast_frames_hi
Definition: ecore_hsi.h:3466
uint32_t rx_unicast_bytes_lo
Definition: ecore_hsi.h:3482
uint32_t tx_frames_dropped_lo
Definition: ecore_hsi.h:3477
uint32_t tx_multicast_frames_lo
Definition: ecore_hsi.h:3467
uint32_t rx_broadcast_frames_hi
Definition: ecore_hsi.h:3487
uint32_t rx_unicast_frames_hi
Definition: ecore_hsi.h:3479
uint32_t rx_multicast_frames_lo
Definition: ecore_hsi.h:3484
uint32_t tx_frames_dropped_hi
Definition: ecore_hsi.h:3476
uint32_t rx_broadcast_bytes_lo
Definition: ecore_hsi.h:3490
uint32_t rx_multicast_bytes_lo
Definition: ecore_hsi.h:3486
uint32_t rx_frames_dropped_hi
Definition: ecore_hsi.h:3493
uint32_t rx_frames_discarded_hi
Definition: ecore_hsi.h:3491
uint32_t tx_broadcast_bytes_hi
Definition: ecore_hsi.h:3472
uint32_t tx_broadcast_frames_lo
Definition: ecore_hsi.h:3471
uint32_t rx_broadcast_bytes_hi
Definition: ecore_hsi.h:3489
uint32_t tx_unicast_frames_hi
Definition: ecore_hsi.h:3462
uint32_t tx_unicast_frames_lo
Definition: ecore_hsi.h:3463
uint32_t rx_frames_dropped_lo
Definition: ecore_hsi.h:3494
uint32_t rx_unicast_bytes_hi
Definition: ecore_hsi.h:3481
uint32_t tx_broadcast_bytes_lo
Definition: ecore_hsi.h:3473
uint32_t rx_unicast_frames_lo
Definition: ecore_hsi.h:3480
uint32_t tx_broadcast_frames_hi
Definition: ecore_hsi.h:3470
uint32_t tx_multicast_bytes_hi
Definition: ecore_hsi.h:3468
uint32_t bc_ver
Definition: bxe.h:1256
uint32_t total_unicast_bytes_received_lo
Definition: bxe_stats.h:404
uint32_t total_broadcast_bytes_received_lo
Definition: bxe_stats.h:406
uint32_t total_unicast_bytes_received_hi
Definition: bxe_stats.h:403
uint32_t total_unicast_bytes_transmitted_hi
Definition: bxe_stats.h:409
uint32_t total_broadcast_bytes_transmitted_lo
Definition: bxe_stats.h:412
uint32_t total_multicast_bytes_received_hi
Definition: bxe_stats.h:407
uint32_t total_tpa_bytes_lo
Definition: bxe_stats.h:416
uint32_t total_multicast_bytes_transmitted_lo
Definition: bxe_stats.h:414
uint32_t total_multicast_bytes_received_lo
Definition: bxe_stats.h:408
uint32_t total_tpa_bytes_hi
Definition: bxe_stats.h:415
uint32_t total_broadcast_bytes_transmitted_hi
Definition: bxe_stats.h:411
uint32_t total_unicast_bytes_transmitted_lo
Definition: bxe_stats.h:410
uint32_t total_broadcast_bytes_received_hi
Definition: bxe_stats.h:405
uint32_t total_multicast_bytes_transmitted_hi
Definition: bxe_stats.h:413
uint32_t total_unicast_bytes_received_hi
Definition: bxe_stats.h:283
uint32_t total_packets_received_checksum_discarded_lo
Definition: bxe_stats.h:320
uint32_t total_unicast_packets_transmitted_hi
Definition: bxe_stats.h:305
uint32_t total_packets_received_checksum_discarded_hi
Definition: bxe_stats.h:319
uint32_t valid_bytes_received_lo
Definition: bxe_stats.h:312
uint32_t total_multicast_packets_transmitted_hi
Definition: bxe_stats.h:307
uint32_t total_broadcast_bytes_received_lo
Definition: bxe_stats.h:286
uint32_t total_multicast_packets_transmitted_lo
Definition: bxe_stats.h:308
uint32_t total_unicast_bytes_received_lo
Definition: bxe_stats.h:284
uint32_t total_multicast_packets_received_lo
Definition: bxe_stats.h:302
uint32_t total_bytes_received_hi
Definition: bxe_stats.h:289
uint32_t total_unicast_packets_received_hi
Definition: bxe_stats.h:299
uint32_t total_packets_received_ttl0_discarded_lo
Definition: bxe_stats.h:322
uint32_t total_broadcast_packets_received_lo
Definition: bxe_stats.h:304
uint32_t total_broadcast_bytes_transmitted_hi
Definition: bxe_stats.h:293
uint32_t total_unicast_bytes_transmitted_lo
Definition: bxe_stats.h:292
uint32_t total_bytes_transmitted_lo
Definition: bxe_stats.h:298
uint32_t total_multicast_bytes_received_lo
Definition: bxe_stats.h:288
uint32_t total_multicast_bytes_received_hi
Definition: bxe_stats.h:287
uint32_t total_broadcast_bytes_transmitted_lo
Definition: bxe_stats.h:294
uint32_t no_buff_discard_hi
Definition: bxe_stats.h:316
uint32_t total_transmitted_dropped_packets_error_hi
Definition: bxe_stats.h:323
uint32_t total_bytes_transmitted_hi
Definition: bxe_stats.h:297
uint32_t total_unicast_packets_transmitted_lo
Definition: bxe_stats.h:306
uint32_t total_multicast_packets_received_hi
Definition: bxe_stats.h:301
uint32_t total_transmitted_dropped_packets_error_lo
Definition: bxe_stats.h:324
uint32_t total_unicast_packets_received_lo
Definition: bxe_stats.h:300
uint32_t total_multicast_bytes_transmitted_lo
Definition: bxe_stats.h:296
uint32_t total_broadcast_packets_received_hi
Definition: bxe_stats.h:303
uint32_t total_broadcast_packets_transmitted_hi
Definition: bxe_stats.h:309
uint32_t total_multicast_bytes_transmitted_hi
Definition: bxe_stats.h:295
uint32_t no_buff_discard_lo
Definition: bxe_stats.h:317
uint32_t valid_bytes_received_hi
Definition: bxe_stats.h:311
uint32_t total_unicast_bytes_transmitted_hi
Definition: bxe_stats.h:291
uint32_t etherstatsoverrsizepkts_lo
Definition: bxe_stats.h:315
uint32_t total_bytes_received_lo
Definition: bxe_stats.h:290
uint32_t total_broadcast_packets_transmitted_lo
Definition: bxe_stats.h:310
uint32_t total_broadcast_bytes_received_hi
Definition: bxe_stats.h:285
uint32_t etherstatsoverrsizepkts_hi
Definition: bxe_stats.h:314
uint32_t total_packets_received_ttl0_discarded_hi
Definition: bxe_stats.h:321
uint32_t brb_drop_lo
Definition: bxe_stats.h:188
uint32_t tx_stat_dot3statsinternalmactransmiterrors_hi
Definition: bxe_stats.h:172
uint32_t total_unicast_packets_received_hi
Definition: bxe_stats.h:78
uint32_t pause_frames_sent_hi
Definition: bxe_stats.h:179
uint32_t pause_frames_received_hi
Definition: bxe_stats.h:177
uint32_t error_bytes_received_lo
Definition: bxe_stats.h:94
uint32_t total_unicast_packets_transmitted_hi
Definition: bxe_stats.h:84
uint32_t total_multicast_packets_received_hi
Definition: bxe_stats.h:80
uint32_t etherstatspktsover1522octets_lo
Definition: bxe_stats.h:185
uint32_t mac_filter_discard
Definition: bxe_stats.h:192
uint32_t tx_stat_etherstatscollisions_hi
Definition: bxe_stats.h:138
uint32_t tx_stat_dot3statsexcessivecollisions_hi
Definition: bxe_stats.h:146
uint32_t rx_stat_dot3statsfcserrors_hi
Definition: bxe_stats.h:104
uint32_t etherstatspkts1024octetsto1522octets_lo
Definition: bxe_stats.h:183
uint32_t pause_frames_received_lo
Definition: bxe_stats.h:178
uint32_t rx_stat_dot3statscarriersenseerrors_hi
Definition: bxe_stats.h:108
uint32_t etherstatspktsover1522octets_hi
Definition: bxe_stats.h:184
uint32_t error_bytes_received_hi
Definition: bxe_stats.h:93
uint32_t total_multicast_packets_transmitted_hi
Definition: bxe_stats.h:86
uint32_t rx_stat_etherstatsundersizepkts_hi
Definition: bxe_stats.h:112
uint32_t pfc_frames_received_hi
Definition: bxe_stats.h:207
uint32_t pause_frames_sent_lo
Definition: bxe_stats.h:180
uint32_t nig_timer_max
Definition: bxe_stats.h:197
uint32_t eee_tx_lpi
Definition: bxe_stats.h:217
uint32_t total_bytes_transmitted_hi
Definition: bxe_stats.h:76
uint32_t brb_truncate_lo
Definition: bxe_stats.h:190
uint32_t etherstatspkts1024octetsto1522octets_hi
Definition: bxe_stats.h:182
uint32_t total_broadcast_packets_transmitted_hi
Definition: bxe_stats.h:88
uint32_t rx_stat_ifhcinbadoctets_lo
Definition: bxe_stats.h:101
uint32_t rx_stat_ifhcinbadoctets_hi
Definition: bxe_stats.h:100
uint32_t tx_stat_dot3statslatecollisions_hi
Definition: bxe_stats.h:148
uint32_t pfc_frames_sent_hi
Definition: bxe_stats.h:209
uint32_t brb_truncate_discard
Definition: bxe_stats.h:194
uint32_t pfc_frames_sent_lo
Definition: bxe_stats.h:210
uint32_t brb_drop_hi
Definition: bxe_stats.h:187
uint32_t no_buff_discard_hi
Definition: bxe_stats.h:97
uint32_t etherstatsoverrsizepkts_hi
Definition: bxe_stats.h:95
uint32_t total_broadcast_packets_received_hi
Definition: bxe_stats.h:82
uint32_t total_bytes_received_hi
Definition: bxe_stats.h:74
uint32_t rx_stat_dot3statsalignmenterrors_hi
Definition: bxe_stats.h:106
uint32_t brb_truncate_hi
Definition: bxe_stats.h:189
uint32_t total_bytes_received_lo
Definition: bxe_stats.h:75
uint32_t mac_discard
Definition: bxe_stats.h:195
uint32_t pfc_frames_received_lo
Definition: bxe_stats.h:208
struct tstorm_per_queue_stats old_tclient
Definition: bxe.h:658
struct bxe_eth_q_stats eth_q_stats
Definition: bxe.h:661
struct bxe_softc * sc
Definition: bxe.h:544
struct ustorm_per_queue_stats old_uclient
Definition: bxe.h:659
struct xstorm_per_queue_stats old_xclient
Definition: bxe.h:660
struct bxe_eth_q_stats_old eth_q_stats_old
Definition: bxe.h:662
uint32_t pfc_frames_tx_lo
Definition: bxe_stats.h:498
uint32_t pfc_frames_tx_hi
Definition: bxe_stats.h:497
uint32_t brb_truncate_discard
Definition: bxe_stats.h:504
uint32_t mac_filter_discard
Definition: bxe_stats.h:502
uint32_t pfc_frames_rx_hi
Definition: bxe_stats.h:499
uint32_t pfc_frames_rx_lo
Definition: bxe_stats.h:500
uint32_t mf_tag_discard
Definition: bxe_stats.h:503
struct per_port_stats port
Definition: bxe.h:886
struct per_pf_stats pf
Definition: bxe.h:887
struct stats_counter storm_counters
Definition: bxe.h:885
struct per_queue_stats queue_stats[1]
Definition: bxe.h:889
struct stats_query_entry query[FP_SB_MAX_E1x+BXE_FIRST_QUEUE_QUERY_IDX]
Definition: bxe.h:880
struct stats_query_header hdr
Definition: bxe.h:879
uint32_t pmf
Definition: bxe.h:984
uint32_t port_stx
Definition: bxe.h:1031
struct nig_stats old_nig_stats
Definition: bxe.h:1033
union mac_stats mac_stats
Definition: bxe.h:926
struct bxe_eth_stats_old eth_stats_old
Definition: bxe.h:1719
volatile int state
Definition: bxe.h:1316
struct bxe_net_stats_old net_stats_old
Definition: bxe.h:1720
int executer_idx
Definition: bxe.h:1724
struct host_func_stats func_stats
Definition: bxe.h:1718
struct bxe_fw_stats_data * fw_stats_data
Definition: bxe.h:1706
struct dmae_cmd stats_dmae
Definition: bxe.h:1723
uint8_t fw_stats_num
Definition: bxe.h:1688
struct bxe_fw_stats_req * fw_stats_req
Definition: bxe.h:1699
int panic
Definition: bxe.h:1758
struct bxe_slowpath * sp
Definition: bxe.h:1598
struct bxe_fastpath fp[MAX_RSS_CHAINS]
Definition: bxe.h:1375
struct elink_vars link_vars
Definition: bxe.h:1484
uint8_t stats_init
Definition: bxe.h:1714
uint16_t stats_pending
Definition: bxe.h:1710
struct bxe_eth_stats eth_stats
Definition: bxe.h:1717
struct bxe_port port
Definition: bxe.h:1520
bus_addr_t fw_stats_req_mapping
Definition: bxe.h:1700
struct bxe_devinfo devinfo
Definition: bxe.h:1406
if_t ifp
Definition: bxe.h:1312
int num_queues
Definition: bxe.h:1525
struct timeout_task sp_err_timeout_task
Definition: bxe.h:1368
struct bxe_fw_port_stats_old fw_stats_old
Definition: bxe.h:1721
uint32_t func_stx
Definition: bxe.h:1481
uint16_t stats_counter
Definition: bxe.h:1713
bus_addr_t fw_stats_data_mapping
Definition: bxe.h:1707
int stats_state
Definition: bxe.h:1715
uint32_t comp_addr_lo
Definition: ecore_hsi.h:3802
uint32_t dst_addr_hi
Definition: ecore_hsi.h:3770
uint32_t src_addr_lo
Definition: ecore_hsi.h:3767
uint32_t comp_val
Definition: ecore_hsi.h:3804
uint32_t src_addr_hi
Definition: ecore_hsi.h:3768
uint32_t comp_addr_hi
Definition: ecore_hsi.h:3803
uint32_t dst_addr_lo
Definition: ecore_hsi.h:3769
uint32_t opcode
Definition: ecore_hsi.h:3734
uint32_t host_func_stats_start
Definition: ecore_hsi.h:3421
uint32_t host_func_stats_end
Definition: ecore_hsi.h:3450
uint32_t host_port_stats_counter
Definition: ecore_hsi.h:3401
uint32_t not_used
Definition: ecore_hsi.h:3408
struct mac_stx mac_stx[MAC_STX_IDX_MAX]
Definition: ecore_hsi.h:3403
uint32_t pfc_frames_tx_hi
Definition: ecore_hsi.h:3410
uint32_t pfc_frames_rx_lo
Definition: ecore_hsi.h:3413
uint32_t brb_drop_hi
Definition: ecore_hsi.h:3405
uint32_t pfc_frames_tx_lo
Definition: ecore_hsi.h:3411
uint32_t pfc_frames_rx_hi
Definition: ecore_hsi.h:3412
uint32_t brb_drop_lo
Definition: ecore_hsi.h:3406
uint32_t tx_stat_outxonsent_hi
Definition: ecore_hsi.h:3330
uint32_t tx_stat_mac_2047_hi
Definition: ecore_hsi.h:3379
uint32_t tx_stat_mac_16383_hi
Definition: ecore_hsi.h:3385
uint32_t tx_stat_mac_16383_lo
Definition: ecore_hsi.h:3386
uint32_t rx_stat_xoffpauseframesreceived_hi
Definition: ecore_hsi.h:3327
uint32_t rx_stat_xoffpauseframesreceived_lo
Definition: ecore_hsi.h:3328
uint32_t rx_stat_xonpauseframesreceived_hi
Definition: ecore_hsi.h:3324
uint32_t tx_stat_mac_2047_lo
Definition: ecore_hsi.h:3380
uint32_t tx_stat_outxoffsent_lo
Definition: ecore_hsi.h:3334
uint32_t tx_stat_mac_4095_hi
Definition: ecore_hsi.h:3381
uint32_t rx_stat_mac_xpf_lo
Definition: ecore_hsi.h:3316
uint32_t tx_stat_outxoffsent_hi
Definition: ecore_hsi.h:3333
uint32_t tx_stat_mac_9216_lo
Definition: ecore_hsi.h:3384
uint32_t rx_stat_mac_xpf_hi
Definition: ecore_hsi.h:3315
uint32_t tx_stat_etherstatspkts1024octetsto1522octets_hi
Definition: ecore_hsi.h:3374
uint32_t tx_stat_outxonsent_lo
Definition: ecore_hsi.h:3331
uint32_t tx_stat_etherstatspkts1024octetsto1522octets_lo
Definition: ecore_hsi.h:3375
uint32_t rx_stat_xonpauseframesreceived_lo
Definition: ecore_hsi.h:3325
uint32_t tx_stat_mac_4095_lo
Definition: ecore_hsi.h:3382
uint32_t tx_stat_mac_9216_hi
Definition: ecore_hsi.h:3383
struct mstat_stats::@17 stats_rx
struct mstat_stats::@16 stats_tx
uint32_t egress_mac_pkt1_lo
Definition: bxe_stats.h:54
uint32_t egress_mac_pkt0_lo
Definition: bxe_stats.h:52
uint32_t brb_truncate
Definition: bxe_stats.h:40
uint32_t brb_discard
Definition: bxe_stats.h:38
struct tstorm_per_pf_stats tstorm_pf_statistics
Definition: ecore_hsi.h:12023
struct tstorm_per_port_stats tstorm_port_statistics
Definition: ecore_hsi.h:12045
struct xstorm_per_queue_stats xstorm_queue_statistics
Definition: ecore_hsi.h:12106
struct ustorm_per_queue_stats ustorm_queue_statistics
Definition: ecore_hsi.h:12105
struct tstorm_per_queue_stats tstorm_queue_statistics
Definition: ecore_hsi.h:12104
uint32_t lo
Definition: ecore_hsi.h:6601
uint32_t hi
Definition: ecore_hsi.h:6602
uint16_t xstats_counter
Definition: ecore_hsi.h:12183
uint16_t tstats_counter
Definition: ecore_hsi.h:12186
uint16_t ustats_counter
Definition: ecore_hsi.h:12189
uint16_t cstats_counter
Definition: ecore_hsi.h:12192
Definition: ecore_hsi.h:12202
uint8_t kind
Definition: ecore_hsi.h:12203
struct regpair_t address
Definition: ecore_hsi.h:12207
uint8_t index
Definition: ecore_hsi.h:12204
uint16_t funcID
Definition: ecore_hsi.h:12205
uint32_t reserved
Definition: ecore_hsi.h:12206
struct regpair_t stats_counters_addrs
Definition: ecore_hsi.h:12228
uint16_t drv_stats_counter
Definition: ecore_hsi.h:12226
struct regpair_t rcv_error_bytes
Definition: ecore_hsi.h:12015
struct regpair_t rcv_mcast_bytes
Definition: ecore_hsi.h:12060
struct regpair_t rcv_ucast_bytes
Definition: ecore_hsi.h:12054
struct regpair_t rcv_bcast_bytes
Definition: ecore_hsi.h:12057
struct regpair_t coalesced_bytes
Definition: ecore_hsi.h:12080
struct regpair_t ucast_bytes_sent
Definition: ecore_hsi.h:12090
struct regpair_t bcast_bytes_sent
Definition: ecore_hsi.h:12092
struct regpair_t mcast_bytes_sent
Definition: ecore_hsi.h:12091
struct mstat_stats mstat_stats
Definition: ecore_hsi.h:3272
struct bmac1_stats bmac1_stats
Definition: ecore_hsi.h:3270
struct bmac2_stats bmac2_stats
Definition: ecore_hsi.h:3271
struct emac_stats emac_stats
Definition: ecore_hsi.h:3269