All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next-2.6 PATCH] ixgbe: fix link behavior for SFP+ when driver is brought down
@ 2010-12-03 13:31 Jeff Kirsher
  2010-12-03 17:42 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Kirsher @ 2010-12-03 13:31 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, bphilips, Don Skidmore, Jeff Kirsher

From: Don Skidmore <donald.c.skidmore@intel.com>

We have had several requests to have ifconfig down command disable
the SFP+ laser and thus make link go down.  Likewise on ifconfig up
the laser would be enabled and link would come up.  This patch enables
that behavior.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbe/ixgbe_82599.c |   12 +++++++++---
 drivers/net/ixgbe/ixgbe_main.c  |   26 ++++++++++++++++++--------
 2 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index 26b8ceb..743bdec 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -65,9 +65,9 @@ static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw);
 static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
 {
 	struct ixgbe_mac_info *mac = &hw->mac;
-	if (hw->phy.multispeed_fiber) {
-		/* Set up dual speed SFP+ support */
-		mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber;
+
+	/* enable the laser control functions for SFP+ fiber */
+	if (mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) {
 		mac->ops.disable_tx_laser =
 		                       &ixgbe_disable_tx_laser_multispeed_fiber;
 		mac->ops.enable_tx_laser =
@@ -77,6 +77,12 @@ static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
 		mac->ops.disable_tx_laser = NULL;
 		mac->ops.enable_tx_laser = NULL;
 		mac->ops.flap_tx_laser = NULL;
+	}
+
+	if (hw->phy.multispeed_fiber) {
+		/* Set up dual speed SFP+ support */
+		mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber;
+	} else {
 		if ((mac->ops.get_media_type(hw) ==
 		     ixgbe_media_type_backplane) &&
 		    (hw->phy.smart_speed == ixgbe_smart_speed_auto ||
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index bd64a4d..fb81418 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3793,8 +3793,11 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)
 	else
 		ixgbe_configure_msi_and_legacy(adapter);
 
-	/* enable the optics */
-	if (hw->phy.multispeed_fiber && hw->mac.ops.enable_tx_laser)
+	/* enable the optics for both mult-speed fiber and 82599 SFP+ fiber */
+	if (hw->mac.ops.enable_tx_laser &&
+	    ((hw->phy.multispeed_fiber) ||
+	     ((hw->phy.type == ixgbe_media_type_fiber) &&
+	      (hw->mac.type == ixgbe_mac_82599EB))))
 		hw->mac.ops.enable_tx_laser(hw);
 
 	clear_bit(__IXGBE_DOWN, &adapter->state);
@@ -4106,15 +4109,19 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
 		break;
 	}
 
-	/* power down the optics */
-	if (hw->phy.multispeed_fiber && hw->mac.ops.disable_tx_laser)
-		hw->mac.ops.disable_tx_laser(hw);
-
 	/* clear n-tuple filters that are cached */
 	ethtool_ntuple_flush(netdev);
 
 	if (!pci_channel_offline(adapter->pdev))
 		ixgbe_reset(adapter);
+
+	/* power down the optics for multispeed fiber and 82599 SFP+ fiber */
+	if (hw->mac.ops.disable_tx_laser &&
+	    ((hw->phy.multispeed_fiber) ||
+	     ((hw->phy.type == ixgbe_media_type_fiber) &&
+	      (hw->mac.type == ixgbe_mac_82599EB))))
+		hw->mac.ops.disable_tx_laser(hw);
+
 	ixgbe_clean_all_tx_rings(adapter);
 	ixgbe_clean_all_rx_rings(adapter);
 
@@ -7200,8 +7207,11 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
 		goto err_eeprom;
 	}
 
-	/* power down the optics */
-	if (hw->phy.multispeed_fiber && hw->mac.ops.disable_tx_laser)
+	/* power down the optics for multispeed fiber and 82599 SFP+ fiber */
+	if (hw->mac.ops.disable_tx_laser &&
+	    ((hw->phy.multispeed_fiber) ||
+	     ((hw->phy.type == ixgbe_media_type_fiber) &&
+	      (hw->mac.type == ixgbe_mac_82599EB))))
 		hw->mac.ops.disable_tx_laser(hw);
 
 	init_timer(&adapter->watchdog_timer);


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [net-next-2.6 PATCH] ixgbe: fix link behavior for SFP+ when driver is brought down
  2010-12-03 13:31 [net-next-2.6 PATCH] ixgbe: fix link behavior for SFP+ when driver is brought down Jeff Kirsher
@ 2010-12-03 17:42 ` David Miller
  2010-12-03 18:15   ` David Miller
  2010-12-03 22:44   ` Kirsher, Jeffrey T
  0 siblings, 2 replies; 5+ messages in thread
From: David Miller @ 2010-12-03 17:42 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips, donald.c.skidmore


Please number your patches so I know unambiguously in which order to
apply them.

The last patch didn't apply cleanly because ixgbe_types.h in your
tree has:

#define IXGBE_ERR_SFP_SETUP_NOT_COMPLETE        -30

but that does not exist in net-next-2.6  This doesn't exist in
net-2.6 either so it's something completely local to your trees.

I fixed all of this up and applied it all, but this sort of stuff
needs to be sorted out before I see the submission. :-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [net-next-2.6 PATCH] ixgbe: fix link behavior for SFP+ when driver is brought down
  2010-12-03 17:42 ` David Miller
@ 2010-12-03 18:15   ` David Miller
  2010-12-03 22:46     ` Kirsher, Jeffrey T
  2010-12-03 22:44   ` Kirsher, Jeffrey T
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2010-12-03 18:15 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips, donald.c.skidmore

From: David Miller <davem@davemloft.net>
Date: Fri, 03 Dec 2010 09:42:15 -0800 (PST)

> I fixed all of this up and applied it all, but this sort of stuff
> needs to be sorted out before I see the submission. :-)

These patches introduced the following new compile warnings,
please send me patches to fix them:

drivers/net/ixgbe/ixgbe_main.c: In function 'ixgbe_up_complete':
drivers/net/ixgbe/ixgbe_main.c:3803:22: warning: comparison between 'enum ixgbe_phy_type' and 'enum ixgbe_media_type'
drivers/net/ixgbe/ixgbe_main.c: In function 'ixgbe_down':
drivers/net/ixgbe/ixgbe_main.c:4125:22: warning: comparison between 'enum ixgbe_phy_type' and 'enum ixgbe_media_type'
drivers/net/ixgbe/ixgbe_main.c: In function 'ixgbe_probe':
drivers/net/ixgbe/ixgbe_main.c:7215:22: warning: comparison between 'enum ixgbe_phy_type' and 'enum ixgbe_media_type'

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [net-next-2.6 PATCH] ixgbe: fix link behavior for SFP+ when driver is brought down
  2010-12-03 17:42 ` David Miller
  2010-12-03 18:15   ` David Miller
@ 2010-12-03 22:44   ` Kirsher, Jeffrey T
  1 sibling, 0 replies; 5+ messages in thread
From: Kirsher, Jeffrey T @ 2010-12-03 22:44 UTC (permalink / raw)
  To: davem; +Cc: Skidmore, Donald C, netdev, gospo, bphilips

[-- Attachment #1: Type: text/plain, Size: 810 bytes --]

On Fri, 2010-12-03 at 09:42 -0800, David Miller wrote:
> Please number your patches so I know unambiguously in which order to
> apply them.
> 
> The last patch didn't apply cleanly because ixgbe_types.h in your
> tree has:
> 
> #define IXGBE_ERR_SFP_SETUP_NOT_COMPLETE        -30
> 
> but that does not exist in net-next-2.6  This doesn't exist in
> net-2.6 either so it's something completely local to your trees.
> 
> I fixed all of this up and applied it all, but this sort of stuff
> needs to be sorted out before I see the submission. :-)

I apologize, the missing define was in the patch

http://patchwork.ozlabs.org/patch/73942/

which I sent out earlier this week.  I was going to send you out a
summary email letting you know that the six patches I submitted were on
my tree. My fault that I did not.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 491 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [net-next-2.6 PATCH] ixgbe: fix link behavior for SFP+ when driver is brought down
  2010-12-03 18:15   ` David Miller
@ 2010-12-03 22:46     ` Kirsher, Jeffrey T
  0 siblings, 0 replies; 5+ messages in thread
From: Kirsher, Jeffrey T @ 2010-12-03 22:46 UTC (permalink / raw)
  To: davem; +Cc: Skidmore, Donald C, netdev, gospo, bphilips

[-- Attachment #1: Type: text/plain, Size: 1084 bytes --]

On Fri, 2010-12-03 at 10:15 -0800, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Fri, 03 Dec 2010 09:42:15 -0800 (PST)
> 
> > I fixed all of this up and applied it all, but this sort of stuff
> > needs to be sorted out before I see the submission. :-)
> 
> These patches introduced the following new compile warnings,
> please send me patches to fix them:
> 
> drivers/net/ixgbe/ixgbe_main.c: In function 'ixgbe_up_complete':
> drivers/net/ixgbe/ixgbe_main.c:3803:22: warning: comparison between 'enum ixgbe_phy_type' and 'enum ixgbe_media_type'
> drivers/net/ixgbe/ixgbe_main.c: In function 'ixgbe_down':
> drivers/net/ixgbe/ixgbe_main.c:4125:22: warning: comparison between 'enum ixgbe_phy_type' and 'enum ixgbe_media_type'
> drivers/net/ixgbe/ixgbe_main.c: In function 'ixgbe_probe':
> drivers/net/ixgbe/ixgbe_main.c:7215:22: warning: comparison between 'enum ixgbe_phy_type' and 'enum ixgbe_media_type'
> 
> Thanks.

Very interesting that we did not see this during our compile testing of
the patch.  Don is working on a patch right now to fix the issue.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 491 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-12-03 22:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-03 13:31 [net-next-2.6 PATCH] ixgbe: fix link behavior for SFP+ when driver is brought down Jeff Kirsher
2010-12-03 17:42 ` David Miller
2010-12-03 18:15   ` David Miller
2010-12-03 22:46     ` Kirsher, Jeffrey T
2010-12-03 22:44   ` Kirsher, Jeffrey T

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.