Print this page
3534 Disable EEE support in igb for I350

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/igb/igb_gld.c
          +++ new/usr/src/uts/common/io/igb/igb_gld.c
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   *
  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 + * Copyright 2013, Nexenta Systems, Inc. All rights reserved.
  28   29   */
  29   30  
  30   31  #include "igb_sw.h"
  31   32  
  32   33  int
  33   34  igb_m_stat(void *arg, uint_t stat, uint64_t *val)
  34   35  {
  35   36          igb_t *igb = (igb_t *)arg;
  36   37          struct e1000_hw *hw = &igb->hw;
  37   38          igb_stat_t *igb_ks;
↓ open down ↓ 1340 lines elided ↑ open up ↑
1378 1379  /* ARGSUSED */
1379 1380  int
1380 1381  igb_set_priv_prop(igb_t *igb, const char *pr_name,
1381 1382      uint_t pr_valsize, const void *pr_val)
1382 1383  {
1383 1384          int err = 0;
1384 1385          long result;
1385 1386          struct e1000_hw *hw = &igb->hw;
1386 1387          int i;
1387 1388  
     1389 +        if (strcmp(pr_name, "_eee_support") == 0) {
     1390 +                if (pr_val == NULL)
     1391 +                        return (EINVAL);
     1392 +                (void) ddi_strtol(pr_val, (char **)NULL, 0, &result);
     1393 +                switch (result) {
     1394 +                case 0:
     1395 +                case 1:
     1396 +                        if (hw->mac.type != e1000_i350) {
     1397 +                                /*
     1398 +                                 * For now, only supported on I350.
     1399 +                                 * Add new mac.type values (or use < instead)
     1400 +                                 * as new cards offer up EEE.
     1401 +                                 */
     1402 +                                return (ENXIO);
     1403 +                        }
     1404 +                        /* Must set this prior to the set call. */
     1405 +                        hw->dev_spec._82575.eee_disable = !result;
     1406 +                        if (e1000_set_eee_i350(hw) != E1000_SUCCESS)
     1407 +                                err = EIO;
     1408 +                        break;
     1409 +                default:
     1410 +                        err = EINVAL;
     1411 +                        /* FALLTHRU */
     1412 +                }
     1413 +                return (err);
     1414 +        }
1388 1415          if (strcmp(pr_name, "_tx_copy_thresh") == 0) {
1389 1416                  if (pr_val == NULL) {
1390 1417                          err = EINVAL;
1391 1418                          return (err);
1392 1419                  }
1393 1420                  (void) ddi_strtol(pr_val, (char **)NULL, 0, &result);
1394 1421                  if (result < MIN_TX_COPY_THRESHOLD ||
1395 1422                      result > MAX_TX_COPY_THRESHOLD)
1396 1423                          err = EINVAL;
1397 1424                  else {
↓ open down ↓ 102 lines elided ↑ open up ↑
1500 1527  int
1501 1528  igb_get_priv_prop(igb_t *igb, const char *pr_name, uint_t pr_valsize,
1502 1529      void *pr_val)
1503 1530  {
1504 1531          int value;
1505 1532  
1506 1533          if (strcmp(pr_name, "_adv_pause_cap") == 0) {
1507 1534                  value = igb->param_adv_pause_cap;
1508 1535          } else if (strcmp(pr_name, "_adv_asym_pause_cap") == 0) {
1509 1536                  value = igb->param_adv_asym_pause_cap;
     1537 +        } else if (strcmp(pr_name, "_eee_support") == 0) {
     1538 +                /*
     1539 +                 * For now, only supported on I350.  Add new mac.type values
     1540 +                 * (or use < instead) as new cards offer up EEE.
     1541 +                 */
     1542 +                value = (igb->hw.mac.type != e1000_i350) ? 0 :
     1543 +                    !(igb->hw.dev_spec._82575.eee_disable);
1510 1544          } else if (strcmp(pr_name, "_tx_copy_thresh") == 0) {
1511 1545                  value = igb->tx_copy_thresh;
1512 1546          } else if (strcmp(pr_name, "_tx_recycle_thresh") == 0) {
1513 1547                  value = igb->tx_recycle_thresh;
1514 1548          } else if (strcmp(pr_name, "_tx_overload_thresh") == 0) {
1515 1549                  value = igb->tx_overload_thresh;
1516 1550          } else if (strcmp(pr_name, "_tx_resched_thresh") == 0) {
1517 1551                  value = igb->tx_resched_thresh;
1518 1552          } else if (strcmp(pr_name, "_rx_copy_thresh") == 0) {
1519 1553                  value = igb->rx_copy_thresh;
↓ open down ↓ 43 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX