changeset 13995:e0554f834eb0

3667 Allow ixgbe to use unsupported SFP modules Reviewed by: Keith Wesolowski <keith.wesolowski@joyent.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Dan McDonald <danmcd@nexenta.com>
author Saso Kiselkov <skiselkov.ml@gmail.com>
date Tue, 02 Apr 2013 15:17:12 -0400
parents 29315ace9c5b
children df716869fcba
files usr/src/uts/common/io/ixgbe/ixgbe.conf usr/src/uts/common/io/ixgbe/ixgbe_main.c usr/src/uts/common/io/ixgbe/ixgbe_phy.c usr/src/uts/common/io/ixgbe/ixgbe_sw.h
diffstat 4 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/ixgbe/ixgbe.conf	Thu Mar 28 00:04:59 2013 +0400
+++ b/usr/src/uts/common/io/ixgbe/ixgbe.conf	Tue Apr 02 15:17:12 2013 -0400
@@ -24,6 +24,8 @@
 # Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright (c) 2013 Saso Kiselkov. All rights reserved.
+#
 #
 # Driver.conf file for Intel 10GbE PCIE NIC Driver (ixgbe)
 #
@@ -70,6 +72,12 @@
 #	Allowed values:	1 - 64 (for Intel 82599 10Gb ethernet controller)
 #	Default value:	1
 #
+# allow_unsupported_sfp
+#	Allow use of unsupported (non-Intel) SFP modules in adapters with
+#	pluggable optics
+#	Allowed values: 0 - 1
+#	Default value: 0
+#
 # -------- How to set parameters for a particular interface ---------
 # The example below shows how to locate the device path and set a parameter
 # for a particular ixgbe interface. (Using flow_control as an example)
--- a/usr/src/uts/common/io/ixgbe/ixgbe_main.c	Thu Mar 28 00:04:59 2013 +0400
+++ b/usr/src/uts/common/io/ixgbe/ixgbe_main.c	Tue Apr 02 15:17:12 2013 -0400
@@ -27,6 +27,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2013 Saso Kiselkov. All rights reserved.
  */
 
 #include "ixgbe_sw.h"
@@ -3172,6 +3173,9 @@
 	 */
 	if (hw->mac.type == ixgbe_mac_82599EB || hw->mac.type == ixgbe_mac_X540)
 		ixgbe->intr_throttling[0] = ixgbe->intr_throttling[0] & 0xFF8;
+
+	hw->allow_unsupported_sfp = ixgbe_get_prop(ixgbe,
+	    PROP_ALLOW_UNSUPPORTED_SFP, 0, 1, DEFAULT_ALLOW_UNSUPPORTED_SFP);
 }
 
 static void
--- a/usr/src/uts/common/io/ixgbe/ixgbe_phy.c	Thu Mar 28 00:04:59 2013 +0400
+++ b/usr/src/uts/common/io/ixgbe/ixgbe_phy.c	Tue Apr 02 15:17:12 2013 -0400
@@ -1214,7 +1214,8 @@
 					      "untested modules.\n", status);
 					status = IXGBE_SUCCESS;
 				} else {
-					DEBUGOUT("SFP+ module not supported\n");
+					EWARN(hw, "SFP+ module not supported\n",
+					      status);
 					hw->phy.type =
 						ixgbe_phy_sfp_unsupported;
 					status = IXGBE_ERR_SFP_NOT_SUPPORTED;
--- a/usr/src/uts/common/io/ixgbe/ixgbe_sw.h	Thu Mar 28 00:04:59 2013 +0400
+++ b/usr/src/uts/common/io/ixgbe/ixgbe_sw.h	Tue Apr 02 15:17:12 2013 -0400
@@ -25,6 +25,7 @@
 
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013 Saso Kiselkov. All rights reserved.
  */
 
 #ifndef	_IXGBE_SW_H
@@ -166,6 +167,7 @@
 #define	DEFAULT_MR_ENABLE		B_TRUE
 #define	DEFAULT_TX_HEAD_WB_ENABLE	B_TRUE
 #define	DEFAULT_RELAX_ORDER_ENABLE	B_TRUE
+#define	DEFAULT_ALLOW_UNSUPPORTED_SFP	B_FALSE
 
 #define	IXGBE_LSO_MAXLEN		65535
 
@@ -232,6 +234,7 @@
 #define	PROP_RX_LIMIT_PER_INTR		"rx_limit_per_intr"
 #define	PROP_INTR_THROTTLING		"intr_throttling"
 #define	PROP_FM_CAPABLE			"fm_capable"
+#define	PROP_ALLOW_UNSUPPORTED_SFP	"allow_unsupported_sfp"
 
 #define	IXGBE_LB_NONE			0
 #define	IXGBE_LB_EXTERNAL		1