Print this page
4431 igb support for I354
4616 igb has uninitialized kstats

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/igb/igb_stat.c
          +++ new/usr/src/uts/common/io/igb/igb_stat.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  
  23   23  /*
  24   24   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  25   25   * Use is subject to license terms.
  26   26   */
       27 +/*
       28 + * Copyright 2014 Pluribus Networks Inc.
       29 + */
  27   30  
  28   31  #include "igb_sw.h"
  29   32  
  30   33  /*
  31   34   * Update driver private statistics.
  32   35   */
  33   36  static int
  34   37  igb_update_stats(kstat_t *ks, int rw)
  35   38  {
  36   39          igb_t *igb;
↓ open down ↓ 9 lines elided ↑ open up ↑
  46   49  
  47   50          igb = (igb_t *)ks->ks_private;
  48   51          igb_ks = (igb_stat_t *)ks->ks_data;
  49   52          hw = &igb->hw;
  50   53  
  51   54          mutex_enter(&igb->gen_lock);
  52   55  
  53   56          /*
  54   57           * Basic information.
  55   58           */
  56      -        igb_ks->link_speed.value.ui64 = igb->link_speed;
  57   59          igb_ks->reset_count.value.ui64 = igb->reset_count;
  58   60          igb_ks->dout_sync.value.ui64 = igb->dout_sync;
  59   61  
  60   62  #ifdef IGB_DEBUG
  61   63          igb_ks->rx_frame_error.value.ui64 = 0;
  62   64          igb_ks->rx_cksum_error.value.ui64 = 0;
  63   65          igb_ks->rx_exceed_pkt.value.ui64 = 0;
  64   66          for (i = 0; i < igb->num_rx_rings; i++) {
  65   67                  igb_ks->rx_frame_error.value.ui64 +=
  66   68                      igb->rx_rings[i].stat_frame_error;
↓ open down ↓ 45 lines elided ↑ open up ↑
 112  114           * 32 bits first, then read the upper 32 bits.
 113  115           */
 114  116          val_low = E1000_READ_REG(hw, E1000_GORCL);
 115  117          val_high = E1000_READ_REG(hw, E1000_GORCH);
 116  118          igb_ks->gor.value.ui64 += (uint64_t)val_high << 32 | (uint64_t)val_low;
 117  119  
 118  120          val_low = E1000_READ_REG(hw, E1000_GOTCL);
 119  121          val_high = E1000_READ_REG(hw, E1000_GOTCH);
 120  122          igb_ks->got.value.ui64 += (uint64_t)val_high << 32 | (uint64_t)val_low;
 121  123  #endif
 122      -
 123  124          igb_ks->symerrs.value.ui64 += E1000_READ_REG(hw, E1000_SYMERRS);
 124  125          igb_ks->mpc.value.ui64 += E1000_READ_REG(hw, E1000_MPC);
 125  126          igb_ks->rlec.value.ui64 += E1000_READ_REG(hw, E1000_RLEC);
 126  127          igb_ks->fcruc.value.ui64 += E1000_READ_REG(hw, E1000_FCRUC);
 127  128          igb_ks->rfc.value.ul += E1000_READ_REG(hw, E1000_RFC);
 128  129          igb_ks->tncrs.value.ul += E1000_READ_REG(hw, E1000_TNCRS);
 129  130          igb_ks->tsctc.value.ul += E1000_READ_REG(hw, E1000_TSCTC);
 130  131          igb_ks->tsctfc.value.ul += E1000_READ_REG(hw, E1000_TSCTFC);
 131  132          igb_ks->xonrxc.value.ui64 += E1000_READ_REG(hw, E1000_XONRXC);
 132  133          igb_ks->xontxc.value.ui64 += E1000_READ_REG(hw, E1000_XONTXC);
↓ open down ↓ 32 lines elided ↑ open up ↑
 165  166                  return (IGB_FAILURE);
 166  167          }
 167  168  
 168  169          igb->igb_ks = ks;
 169  170  
 170  171          igb_ks = (igb_stat_t *)ks->ks_data;
 171  172  
 172  173          /*
 173  174           * Initialize all the statistics.
 174  175           */
 175      -        kstat_named_init(&igb_ks->link_speed, "link_speed",
 176      -            KSTAT_DATA_UINT64);
 177  176          kstat_named_init(&igb_ks->reset_count, "reset_count",
 178  177              KSTAT_DATA_UINT64);
 179  178          kstat_named_init(&igb_ks->dout_sync, "DMA_out_sync",
 180  179              KSTAT_DATA_UINT64);
 181  180  
 182  181  #ifdef IGB_DEBUG
 183  182          kstat_named_init(&igb_ks->rx_frame_error, "rx_frame_error",
 184  183              KSTAT_DATA_UINT64);
 185  184          kstat_named_init(&igb_ks->rx_cksum_error, "rx_cksum_error",
 186  185              KSTAT_DATA_UINT64);
↓ open down ↓ 136 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX