diff options
author | Ryan Zezeski <rpz@joyent.com> | 2017-02-17 20:43:50 -0700 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2017-08-04 20:39:56 +0000 |
commit | a9bfd41d542f15c474711abb8b0ca66a4cef9918 (patch) | |
tree | 02b7739224924d620e49539a7b1069073bd33f67 | |
parent | d626ebd403efade415c36352e0c012082508b3ca (diff) | |
download | illumos-joyent-a9bfd41d542f15c474711abb8b0ca66a4cef9918.tar.gz |
8501 ixgbe has uninitialized kstat fields
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Yuri Pankov <yuripv@gmx.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r-- | usr/src/uts/common/io/ixgbe/ixgbe_main.c | 6 | ||||
-rw-r--r-- | usr/src/uts/common/io/ixgbe/ixgbe_rx.c | 11 | ||||
-rw-r--r-- | usr/src/uts/common/io/ixgbe/ixgbe_stat.c | 5 | ||||
-rw-r--r-- | usr/src/uts/common/io/ixgbe/ixgbe_sw.h | 16 | ||||
-rw-r--r-- | usr/src/uts/common/io/ixgbe/ixgbe_tx.c | 13 |
5 files changed, 24 insertions, 27 deletions
diff --git a/usr/src/uts/common/io/ixgbe/ixgbe_main.c b/usr/src/uts/common/io/ixgbe/ixgbe_main.c index 6ed17caa0a..18f5333e48 100644 --- a/usr/src/uts/common/io/ixgbe/ixgbe_main.c +++ b/usr/src/uts/common/io/ixgbe/ixgbe_main.c @@ -25,7 +25,7 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright 2017, Joyent, Inc. * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Saso Kiselkov. All rights reserved. * Copyright (c) 2013 OSN Online Service Nuernberg GmbH. All rights reserved. @@ -4516,7 +4516,7 @@ ixgbe_intr_tx_work(ixgbe_tx_ring_t *tx_ring) tx_ring->reschedule = B_FALSE; mac_tx_ring_update(tx_ring->ixgbe->mac_hdl, tx_ring->ring_handle); - IXGBE_DEBUG_STAT(tx_ring->stat_reschedule); + tx_ring->stat_reschedule++; } } @@ -4737,7 +4737,7 @@ ixgbe_intr_legacy(void *arg1, void *arg2) if (tx_reschedule) { tx_ring->reschedule = B_FALSE; mac_tx_ring_update(ixgbe->mac_hdl, tx_ring->ring_handle); - IXGBE_DEBUG_STAT(tx_ring->stat_reschedule); + tx_ring->stat_reschedule++; } return (result); diff --git a/usr/src/uts/common/io/ixgbe/ixgbe_rx.c b/usr/src/uts/common/io/ixgbe/ixgbe_rx.c index 4a03bf3bdd..85ae12477a 100644 --- a/usr/src/uts/common/io/ixgbe/ixgbe_rx.c +++ b/usr/src/uts/common/io/ixgbe/ixgbe_rx.c @@ -25,6 +25,7 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2017 Joyent, Inc. */ #include "ixgbe_sw.h" @@ -601,13 +602,13 @@ ixgbe_ring_rx(ixgbe_rx_ring_t *rx_ring, int poll_bytes) if ((status_error & IXGBE_RXDADV_ERR_FRAME_ERR_MASK) || ((!ixgbe->lro_enable) && (!(status_error & IXGBE_RXD_STAT_EOP)))) { - IXGBE_DEBUG_STAT(rx_ring->stat_frame_error); + rx_ring->stat_frame_error++; goto rx_discard; } - IXGBE_DEBUG_STAT_COND(rx_ring->stat_cksum_error, - (status_error & IXGBE_RXDADV_ERR_TCPE) || - (status_error & IXGBE_RXDADV_ERR_IPE)); + if ((status_error & IXGBE_RXDADV_ERR_TCPE) || + (status_error & IXGBE_RXDADV_ERR_IPE)) + rx_ring->stat_cksum_error++; if (ixgbe->lro_enable) { rsc_cnt = (current_rbd->wb.lower.lo_dword.data & @@ -716,7 +717,7 @@ rx_discard: * per interrupt. */ if (++pkt_num > ixgbe->rx_limit_per_intr) { - IXGBE_DEBUG_STAT(rx_ring->stat_exceed_pkt); + rx_ring->stat_exceed_pkt++; break; } diff --git a/usr/src/uts/common/io/ixgbe/ixgbe_stat.c b/usr/src/uts/common/io/ixgbe/ixgbe_stat.c index b5ed084e77..2e550a9d36 100644 --- a/usr/src/uts/common/io/ixgbe/ixgbe_stat.c +++ b/usr/src/uts/common/io/ixgbe/ixgbe_stat.c @@ -27,6 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved. + * Copyright 2017 Joyent, Inc. */ #include "ixgbe_sw.h" @@ -58,7 +59,6 @@ ixgbe_update_stats(kstat_t *ks, int rw) ixgbe_ks->reset_count.value.ui64 = ixgbe->reset_count; ixgbe_ks->lroc.value.ui64 = ixgbe->lro_pkt_count; -#ifdef IXGBE_DEBUG ixgbe_ks->rx_frame_error.value.ui64 = 0; ixgbe_ks->rx_cksum_error.value.ui64 = 0; ixgbe_ks->rx_exceed_pkt.value.ui64 = 0; @@ -88,7 +88,6 @@ ixgbe_update_stats(kstat_t *ks, int rw) ixgbe_ks->tx_reschedule.value.ui64 += ixgbe->tx_rings[i].stat_reschedule; } -#endif /* * Hardware calculated statistics. @@ -245,7 +244,6 @@ ixgbe_init_stats(ixgbe_t *ixgbe) kstat_named_init(&ixgbe_ks->reset_count, "reset_count", KSTAT_DATA_UINT64); -#ifdef IXGBE_DEBUG kstat_named_init(&ixgbe_ks->rx_frame_error, "rx_frame_error", KSTAT_DATA_UINT64); kstat_named_init(&ixgbe_ks->rx_cksum_error, "rx_cksum_error", @@ -262,7 +260,6 @@ ixgbe_init_stats(ixgbe_t *ixgbe) KSTAT_DATA_UINT64); kstat_named_init(&ixgbe_ks->tx_reschedule, "tx_reschedule", KSTAT_DATA_UINT64); -#endif kstat_named_init(&ixgbe_ks->gprc, "good_pkts_recvd", KSTAT_DATA_UINT64); diff --git a/usr/src/uts/common/io/ixgbe/ixgbe_sw.h b/usr/src/uts/common/io/ixgbe/ixgbe_sw.h index 0637643cd9..0486972aaf 100644 --- a/usr/src/uts/common/io/ixgbe/ixgbe_sw.h +++ b/usr/src/uts/common/io/ixgbe/ixgbe_sw.h @@ -27,6 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 Saso Kiselkov. All rights reserved. * Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved. + * Copyright 2017 Joyent, Inc. */ #ifndef _IXGBE_SW_H @@ -505,15 +506,16 @@ typedef struct ixgbe_tx_ring { uint32_t recycle_fail; uint32_t stall_watchdog; -#ifdef IXGBE_DEBUG - /* - * Debug statistics - */ uint32_t stat_overload; uint32_t stat_fail_no_tbd; uint32_t stat_fail_no_tcb; uint32_t stat_fail_dma_bind; uint32_t stat_reschedule; + +#ifdef IXGBE_DEBUG + /* + * Debug statistics + */ uint32_t stat_break_tbd_limit; uint32_t stat_lso_header_fail; #endif @@ -580,14 +582,10 @@ typedef struct ixgbe_rx_ring { kmutex_t rx_lock; /* Rx access lock */ -#ifdef IXGBE_DEBUG - /* - * Debug statistics - */ uint32_t stat_frame_error; uint32_t stat_cksum_error; uint32_t stat_exceed_pkt; -#endif + uint64_t stat_rbytes; uint64_t stat_ipackets; diff --git a/usr/src/uts/common/io/ixgbe/ixgbe_tx.c b/usr/src/uts/common/io/ixgbe/ixgbe_tx.c index aaa1acfb06..95e6a3b389 100644 --- a/usr/src/uts/common/io/ixgbe/ixgbe_tx.c +++ b/usr/src/uts/common/io/ixgbe/ixgbe_tx.c @@ -27,6 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved. + * Copyright 2017 Joyent, Inc. */ #include "ixgbe_sw.h" @@ -163,7 +164,7 @@ ixgbe_ring_tx(void *arg, mblk_t *mp) */ if (tx_ring->tbd_free < ixgbe->tx_overload_thresh) { tx_ring->reschedule = B_TRUE; - IXGBE_DEBUG_STAT(tx_ring->stat_overload); + tx_ring->stat_overload++; return (mp); } @@ -295,7 +296,7 @@ adjust_threshold: tcb = ixgbe_get_free_list(tx_ring); if (tcb == NULL) { - IXGBE_DEBUG_STAT(tx_ring->stat_fail_no_tcb); + tx_ring->stat_fail_no_tcb++; goto tx_failure; } @@ -447,7 +448,7 @@ adjust_threshold: tcb = ixgbe_get_free_list(tx_ring); if (tcb == NULL) { - IXGBE_DEBUG_STAT(tx_ring->stat_fail_no_tcb); + tx_ring->stat_fail_no_tcb++; goto tx_failure; } desc_num = ixgbe_tx_copy(tx_ring, tcb, pull_mp, @@ -460,7 +461,7 @@ adjust_threshold: tcb = ixgbe_get_free_list(tx_ring); if (tcb == NULL) { - IXGBE_DEBUG_STAT(tx_ring->stat_fail_no_tcb); + tx_ring->stat_fail_no_tcb++; goto tx_failure; } if ((ctx != NULL) && ctx->lso_flag) { @@ -500,7 +501,7 @@ adjust_threshold: * parallel. */ if (tx_ring->tbd_free <= (desc_total + 1)) { - IXGBE_DEBUG_STAT(tx_ring->stat_fail_no_tbd); + tx_ring->stat_fail_no_tbd++; mutex_exit(&tx_ring->tx_lock); goto tx_failure; } @@ -655,7 +656,7 @@ ixgbe_tx_bind(ixgbe_tx_ring_t *tx_ring, tx_control_block_t *tcb, mblk_t *mp, 0, &dma_cookie, &ncookies); if (status != DDI_DMA_MAPPED) { - IXGBE_DEBUG_STAT(tx_ring->stat_fail_dma_bind); + tx_ring->stat_fail_dma_bind++; return (-1); } |