changeset 13948:0a75a6efa936

3534 Disable EEE support in igb for I350 Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Jason King <jason.brian.king@gmail.com> Reviewed by: Marcel Telka <marcel@telka.sk> Reviewed by: Sebastien Roy <sebastien.roy@delphix.com> Approved by: Richard Lowe <richlowe@richlowe.net>
author Dan McDonald <danmcd@nexenta.com>
date Thu, 07 Feb 2013 19:27:18 -0500
parents 4ae108c6a5d7
children 4f6a155f70fe
files usr/src/uts/common/io/igb/igb_82575.c usr/src/uts/common/io/igb/igb_gld.c usr/src/uts/common/io/igb/igb_main.c
diffstat 3 files changed, 39 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/igb/igb_82575.c	Thu Feb 07 14:42:52 2013 -0800
+++ b/usr/src/uts/common/io/igb/igb_82575.c	Thu Feb 07 19:27:18 2013 -0500
@@ -25,6 +25,7 @@
 
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Nexenta Systems, Inc. All rights reserved.
  */
 
 /* IntelVersion: 1.146.2.2 v3_3_14_3_BHSW1 */
@@ -307,8 +308,8 @@
 		mac->rar_entry_count = E1000_RAR_ENTRIES_82580;
 	if (mac->type == e1000_i350) {
 		mac->rar_entry_count = E1000_RAR_ENTRIES_I350;
-		/* Enable EEE default settings for i350 */
-		dev_spec->eee_disable = B_FALSE;
+		/* Disable EEE default settings for i350 */
+		dev_spec->eee_disable = B_TRUE;
 	}
 	/* Set if part includes ASF firmware */
 	mac->asf_firmware_present = true;
--- a/usr/src/uts/common/io/igb/igb_gld.c	Thu Feb 07 14:42:52 2013 -0800
+++ b/usr/src/uts/common/io/igb/igb_gld.c	Thu Feb 07 19:27:18 2013 -0500
@@ -25,6 +25,7 @@
 
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Nexenta Systems, Inc. All rights reserved.
  */
 
 #include "igb_sw.h"
@@ -1385,6 +1386,32 @@
 	struct e1000_hw *hw = &igb->hw;
 	int i;
 
+	if (strcmp(pr_name, "_eee_support") == 0) {
+		if (pr_val == NULL)
+			return (EINVAL);
+		(void) ddi_strtol(pr_val, (char **)NULL, 0, &result);
+		switch (result) {
+		case 0:
+		case 1:
+			if (hw->mac.type != e1000_i350) {
+				/*
+				 * For now, only supported on I350.
+				 * Add new mac.type values (or use < instead)
+				 * as new cards offer up EEE.
+				 */
+				return (ENXIO);
+			}
+			/* Must set this prior to the set call. */
+			hw->dev_spec._82575.eee_disable = !result;
+			if (e1000_set_eee_i350(hw) != E1000_SUCCESS)
+				err = EIO;
+			break;
+		default:
+			err = EINVAL;
+			/* FALLTHRU */
+		}
+		return (err);
+	}
 	if (strcmp(pr_name, "_tx_copy_thresh") == 0) {
 		if (pr_val == NULL) {
 			err = EINVAL;
@@ -1507,6 +1534,13 @@
 		value = igb->param_adv_pause_cap;
 	} else if (strcmp(pr_name, "_adv_asym_pause_cap") == 0) {
 		value = igb->param_adv_asym_pause_cap;
+	} else if (strcmp(pr_name, "_eee_support") == 0) {
+		/*
+		 * For now, only supported on I350.  Add new mac.type values
+		 * (or use < instead) as new cards offer up EEE.
+		 */
+		value = (igb->hw.mac.type != e1000_i350) ? 0 :
+		    !(igb->hw.dev_spec._82575.eee_disable);
 	} else if (strcmp(pr_name, "_tx_copy_thresh") == 0) {
 		value = igb->tx_copy_thresh;
 	} else if (strcmp(pr_name, "_tx_recycle_thresh") == 0) {
--- a/usr/src/uts/common/io/igb/igb_main.c	Thu Feb 07 14:42:52 2013 -0800
+++ b/usr/src/uts/common/io/igb/igb_main.c	Thu Feb 07 19:27:18 2013 -0500
@@ -25,6 +25,7 @@
 
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Nexenta Systems, Inc. All rights reserved.
  */
 
 #include "igb_sw.h"
@@ -123,6 +124,7 @@
 static void igb_release_multicast(igb_t *);
 
 char *igb_priv_props[] = {
+	"_eee_support",
 	"_tx_copy_thresh",
 	"_tx_recycle_thresh",
 	"_tx_overload_thresh",