Print this page
6064 ixgbe needs X550 support

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ixgbe/ixgbe_stat.c
          +++ new/usr/src/uts/common/io/ixgbe/ixgbe_stat.c
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright(c) 2007-2010 Intel Corporation. All rights reserved.
  24   24   */
  25   25  
  26   26  /*
  27   27   * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  28   28   * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
       29 + * Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved.
  29   30   */
  30   31  
  31   32  #include "ixgbe_sw.h"
  32   33  
  33   34  /*
  34   35   * Update driver private statistics.
  35   36   */
  36   37  static int
  37   38  ixgbe_update_stats(kstat_t *ks, int rw)
  38   39  {
↓ open down ↓ 68 lines elided ↑ open up ↑
 107  108                      IXGBE_READ_REG(hw, IXGBE_QBRC(i));
 108  109                  ixgbe_ks->tor.value.ui64 += ixgbe_ks->qbrc[i].value.ui64;
 109  110                  switch (hw->mac.type) {
 110  111                  case ixgbe_mac_82598EB:
 111  112                          ixgbe_ks->qbtc[i].value.ui64 +=
 112  113                              IXGBE_READ_REG(hw, IXGBE_QBTC(i));
 113  114                          break;
 114  115  
 115  116                  case ixgbe_mac_82599EB:
 116  117                  case ixgbe_mac_X540:
      118 +                case ixgbe_mac_X550:
      119 +                case ixgbe_mac_X550EM_x:
 117  120                          ixgbe_ks->qbtc[i].value.ui64 +=
 118  121                              IXGBE_READ_REG(hw, IXGBE_QBTC_L(i));
 119  122                          ixgbe_ks->qbtc[i].value.ui64 +=
 120  123                              ((uint64_t)((IXGBE_READ_REG(hw,
 121  124                              IXGBE_QBTC_H(i))) & 0xF) << 32);
 122  125                          break;
 123  126  
 124  127                  default:
 125  128                          break;
 126  129                  }
↓ open down ↓ 34 lines elided ↑ open up ↑
 161  164          ixgbe_ks->rlec.value.ui64 += IXGBE_READ_REG(hw, IXGBE_RLEC);
 162  165          ixgbe_ks->lxontxc.value.ui64 += IXGBE_READ_REG(hw, IXGBE_LXONTXC);
 163  166          switch (hw->mac.type) {
 164  167          case ixgbe_mac_82598EB:
 165  168                  ixgbe_ks->lxonrxc.value.ui64 += IXGBE_READ_REG(hw,
 166  169                      IXGBE_LXONRXC);
 167  170                  break;
 168  171  
 169  172          case ixgbe_mac_82599EB:
 170  173          case ixgbe_mac_X540:
      174 +        case ixgbe_mac_X550:
      175 +        case ixgbe_mac_X550EM_x:
 171  176                  ixgbe_ks->lxonrxc.value.ui64 += IXGBE_READ_REG(hw,
 172  177                      IXGBE_LXONRXCNT);
 173  178                  break;
 174  179  
 175  180          default:
 176  181                  break;
 177  182          }
 178  183          ixgbe_ks->lxofftxc.value.ui64 += IXGBE_READ_REG(hw, IXGBE_LXOFFTXC);
 179  184          switch (hw->mac.type) {
 180  185          case ixgbe_mac_82598EB:
 181  186                  ixgbe_ks->lxoffrxc.value.ui64 += IXGBE_READ_REG(hw,
 182  187                      IXGBE_LXOFFRXC);
 183  188                  break;
 184  189  
 185  190          case ixgbe_mac_82599EB:
 186  191          case ixgbe_mac_X540:
      192 +        case ixgbe_mac_X550:
      193 +        case ixgbe_mac_X550EM_x:
 187  194                  ixgbe_ks->lxoffrxc.value.ui64 += IXGBE_READ_REG(hw,
 188  195                      IXGBE_LXOFFRXCNT);
 189  196                  break;
 190  197  
 191  198          default:
 192  199                  break;
 193  200          }
 194  201          ixgbe_ks->ruc.value.ui64 += IXGBE_READ_REG(hw, IXGBE_RUC);
 195  202          ixgbe_ks->rfc.value.ui64 += IXGBE_READ_REG(hw, IXGBE_RFC);
 196  203          ixgbe_ks->roc.value.ui64 += IXGBE_READ_REG(hw, IXGBE_ROC);
↓ open down ↓ 273 lines elided ↑ open up ↑
 470  477  /*
 471  478   * Retrieve a value for one of the statistics.
 472  479   */
 473  480  int
 474  481  ixgbe_m_stat(void *arg, uint_t stat, uint64_t *val)
 475  482  {
 476  483          ixgbe_t *ixgbe = (ixgbe_t *)arg;
 477  484          struct ixgbe_hw *hw = &ixgbe->hw;
 478  485          ixgbe_stat_t *ixgbe_ks;
 479  486          int i;
      487 +        ixgbe_link_speed speeds = 0;
 480  488  
 481  489          ixgbe_ks = (ixgbe_stat_t *)ixgbe->ixgbe_ks->ks_data;
 482  490  
 483  491          mutex_enter(&ixgbe->gen_lock);
 484  492  
      493 +        /*
      494 +         * We cannot always rely on the common code maintaining
      495 +         * hw->phy.speeds_supported, therefore we fall back to use the recorded
      496 +         * supported speeds which were obtained during instance init in
      497 +         * ixgbe_init_params().
      498 +         */
      499 +        speeds = hw->phy.speeds_supported;
      500 +        if (speeds == 0)
      501 +                speeds = ixgbe->speeds_supported;
      502 +
 485  503          if (ixgbe->ixgbe_state & IXGBE_SUSPENDED) {
 486  504                  mutex_exit(&ixgbe->gen_lock);
 487  505                  return (ECANCELED);
 488  506          }
 489  507  
 490  508          switch (stat) {
 491  509          case MAC_STAT_IFSPEED:
 492  510                  *val = ixgbe->link_speed * 1000000ull;
 493  511                  break;
 494  512  
↓ open down ↓ 59 lines elided ↑ open up ↑
 554  572                  ixgbe_ks->tot.value.ui64 = 0;
 555  573                  for (i = 0; i < 16; i++) {
 556  574                          switch (hw->mac.type) {
 557  575                          case ixgbe_mac_82598EB:
 558  576                                  ixgbe_ks->qbtc[i].value.ui64 +=
 559  577                                      IXGBE_READ_REG(hw, IXGBE_QBTC(i));
 560  578                                  break;
 561  579  
 562  580                          case ixgbe_mac_82599EB:
 563  581                          case ixgbe_mac_X540:
      582 +                        case ixgbe_mac_X550:
      583 +                        case ixgbe_mac_X550EM_x:
 564  584                                  ixgbe_ks->qbtc[i].value.ui64 +=
 565  585                                      IXGBE_READ_REG(hw, IXGBE_QBTC_L(i));
 566  586                                  ixgbe_ks->qbtc[i].value.ui64 +=
 567  587                                      ((uint64_t)((IXGBE_READ_REG(hw,
 568  588                                      IXGBE_QBTC_H(i))) & 0xF) << 32);
 569  589                                  break;
 570  590  
 571  591                          default:
 572  592                                  break;
 573  593                          }
↓ open down ↓ 64 lines elided ↑ open up ↑
 638  658                          *val = (hw->phy.media_type == ixgbe_media_type_copper) ?
 639  659                              XCVR_100T2 : XCVR_100X;
 640  660                          break;
 641  661                  default:
 642  662                          *val = XCVR_NONE;
 643  663                          break;
 644  664                  }
 645  665                  break;
 646  666  
 647  667          case ETHER_STAT_CAP_10GFDX:
 648      -                *val = 1;
      668 +                *val = (speeds & IXGBE_LINK_SPEED_10GB_FULL) ? 1 : 0;
 649  669                  break;
 650  670  
      671 +        case ETHER_STAT_CAP_5000FDX:
      672 +                *val = (speeds & IXGBE_LINK_SPEED_5GB_FULL) ? 1 : 0;
      673 +                break;
      674 +
      675 +        case ETHER_STAT_CAP_2500FDX:
      676 +                *val = (speeds & IXGBE_LINK_SPEED_2_5GB_FULL) ? 1 : 0;
      677 +                break;
      678 +
 651  679          case ETHER_STAT_CAP_1000FDX:
 652      -                *val = 1;
      680 +                *val = (speeds & IXGBE_LINK_SPEED_1GB_FULL) ? 1 : 0;
 653  681                  break;
 654  682  
 655  683          case ETHER_STAT_CAP_100FDX:
 656      -                *val = 1;
      684 +                *val = (speeds & IXGBE_LINK_SPEED_100_FULL) ? 1 : 0;
 657  685                  break;
 658  686  
 659  687          case ETHER_STAT_CAP_ASMPAUSE:
 660  688                  *val = ixgbe->param_asym_pause_cap;
 661  689                  break;
 662  690  
 663  691          case ETHER_STAT_CAP_PAUSE:
 664  692                  *val = ixgbe->param_pause_cap;
 665  693                  break;
 666  694  
 667  695          case ETHER_STAT_CAP_AUTONEG:
 668  696                  *val = 1;
 669  697                  break;
 670  698  
 671  699          case ETHER_STAT_ADV_CAP_10GFDX:
 672  700                  *val = ixgbe->param_adv_10000fdx_cap;
 673  701                  break;
 674  702  
      703 +        case ETHER_STAT_ADV_CAP_5000FDX:
      704 +                *val = ixgbe->param_adv_5000fdx_cap;
      705 +                break;
      706 +
      707 +        case ETHER_STAT_ADV_CAP_2500FDX:
      708 +                *val = ixgbe->param_adv_2500fdx_cap;
      709 +                break;
      710 +
 675  711          case ETHER_STAT_ADV_CAP_1000FDX:
 676  712                  *val = ixgbe->param_adv_1000fdx_cap;
 677  713                  break;
 678  714  
 679  715          case ETHER_STAT_ADV_CAP_100FDX:
 680  716                  *val = ixgbe->param_adv_100fdx_cap;
 681  717                  break;
 682  718  
 683  719          case ETHER_STAT_ADV_CAP_ASMPAUSE:
 684  720                  *val = ixgbe->param_adv_asym_pause_cap;
↓ open down ↓ 4 lines elided ↑ open up ↑
 689  725                  break;
 690  726  
 691  727          case ETHER_STAT_ADV_CAP_AUTONEG:
 692  728                  *val = ixgbe->param_adv_autoneg_cap;
 693  729                  break;
 694  730  
 695  731          case ETHER_STAT_LP_CAP_10GFDX:
 696  732                  *val = ixgbe->param_lp_10000fdx_cap;
 697  733                  break;
 698  734  
      735 +        case ETHER_STAT_LP_CAP_5000FDX:
      736 +                *val = ixgbe->param_lp_5000fdx_cap;
      737 +                break;
      738 +
      739 +        case ETHER_STAT_LP_CAP_2500FDX:
      740 +                *val = ixgbe->param_lp_2500fdx_cap;
      741 +                break;
      742 +
 699  743          case ETHER_STAT_LP_CAP_1000FDX:
 700  744                  *val = ixgbe->param_lp_1000fdx_cap;
 701  745                  break;
 702  746  
 703  747          case ETHER_STAT_LP_CAP_100FDX:
 704  748                  *val = ixgbe->param_lp_100fdx_cap;
 705  749                  break;
 706  750  
 707  751          case ETHER_STAT_LP_CAP_ASMPAUSE:
 708  752                  *val = ixgbe->param_lp_asym_pause_cap;
↓ open down ↓ 124 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX