ixgbe: Fix SFP log messages
Subsystems (2)
PATCH 1/4 ixgbe: Fix SFP log messages
From: Don Skidmore <[email protected]>
We had a wide range of log messages for the same sort of SFP failure. This patch makes them all more similar and less confusing along with converting them to dev_err.
---
drivers/net/ixgbe/ixgbe_main.c | 25 +++++++++++++++++-------- 1 files changed, 17 insertions(+), 8 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +17 -8
@@ -2701,7 +2701,10 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)*/ err = hw->phy.ops.identify (hw);if (err ==IXGBE_ERR_SFP_NOT_SUPPORTED ) { -DPRINTK (PROBE ,ERR ,"PHY not supported on this NIC %d\n" , err); +dev_err (&adapter->pdev->dev,"failed to initialize because " +"an unsupported SFP+ module type was detected.\n" +"Reload the driver after installing a supported " +"module.\n" );ixgbe_down (adapter);return err; }
@@ -3720,10 +3723,11 @@ static void ixgbe_sfp_task(struct work_struct *work) goto reschedule; ret = hw->phy.ops.reset (hw);if (ret ==IXGBE_ERR_SFP_NOT_SUPPORTED ) { -DPRINTK (PROBE ,ERR ,"failed to initialize because an " -"unsupported SFP+ module type was detected.\n" -"Reload the driver after installing a " -"supported module.\n" ); +dev_err (&adapter->pdev->dev,"failed to initialize " +"because an unsupported SFP+ module type " +"was detected.\n" +"Reload the driver after installing a " +"supported module.\n" );unregister_netdev (adapter->netdev); }else { DPRINTK(PROBE, INFO, "detected SFP+: %d\n",
@@ -4526,7 +4530,10 @@ static void ixgbe_sfp_config_module_task(struct work_struct *work) adapter->flags |=IXGBE_FLAG_IN_SFP_MOD_TASK ; err = hw->phy.ops.identify_sfp (hw);if (err ==IXGBE_ERR_SFP_NOT_SUPPORTED ) { -DPRINTK (PROBE ,ERR ,"PHY not supported on this NIC %d\n" , err); +dev_err (&adapter->pdev->dev,"failed to initialize because " +"an unsupported SFP+ module type was detected.\n" +"Reload the driver after installing a supported " +"module.\n" );ixgbe_down (adapter);return ; }
@@ -5513,8 +5520,10 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, round_jiffies(jiffies + (2 * HZ))); err =0 ; }else if (err ==IXGBE_ERR_SFP_NOT_SUPPORTED ) { -dev_err (&adapter->pdev->dev,"failed to load because an " -"unsupported SFP+ module type was detected.\n" ); +dev_err (&adapter->pdev->dev,"failed to initialize because " +"an unsupported SFP+ module type was detected.\n" +"Reload the driver after installing a supported " +"module.\n" ); goto err_sw_init; }else if (err) {dev_err (&adapter->pdev->dev,"HW Init failed: %d\n" , err);
PATCH 2/4 ixgbe: Fix device capabilities of 82599 single speed fiber NICs.
From: Mallikarjuna R Chilakala <[email protected]>
82599 single speed fiber modules only support 10G/Full. Return proper device capabilities while querrying the adapter and error while changing device advertisement/speed/duplex capabilities.
---
drivers/net/ixgbe/ixgbe_ethtool.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/ixgbe/ixgbe_ethtool.c +3 -2
@@ -139,7 +139,7 @@ static int ixgbe_get_settings(struct net_device *netdev, ecmd->autoneg =AUTONEG_ENABLE ; ecmd->transceiver =XCVR_EXTERNAL ;if ((hw->phy.media_type == ixgbe_media_type_copper) || - (hw->mac.type == ixgbe_mac_82599EB)) { + (hw->phy.multispeed_fiber)) { ecmd->supported |= (SUPPORTED_1000baseT_Full | SUPPORTED_Autoneg);
@@ -217,7 +217,7 @@ static int ixgbe_set_settings(struct net_device *netdev,s32 err =0 ;if ((hw->phy.media_type == ixgbe_media_type_copper) || - (hw->mac.type == ixgbe_mac_82599EB)) { + (hw->phy.multispeed_fiber)) {/* 10000/copper and 1000/copper must autoneg * this function does not support any duplex forcing, but can * limit the advertising of the adapter to only 10000 or 1000 */
@@ -245,6 +245,7 @@ static int ixgbe_set_settings(struct net_device *netdev, }else {/* in this case we currently only support 10Gb/FULL */ if ((ecmd->autoneg ==AUTONEG_ENABLE ) || + (ecmd->advertising != ADVERTISED_10000baseT_Full) || (ecmd->speed + ecmd->duplex !=SPEED_10000 +DUPLEX_FULL ))return -EINVAL ; }
Re: [net-2.6 PATCH 2/4] ixgbe: Fix device capabilities of 82599 single speed fiber NICs.
From: Jeff Kirsher <[email protected]>
Date: Tue, 30 Jun 2009 14:44:16 -0700
Quoted 8 lines
From: Mallikarjuna R Chilakala <[email protected]>
82599 single speed fiber modules only support 10G/Full. Return proper device capabilities while querrying the adapter and error while changing device advertisement/speed/duplex capabilities.
Signed-off-by Mallikarjuna R Chilakala <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
PATCH 3/4 ixgbe: Fix link capabilities during adapter resets
In reply to Jeff KirsherFrom: Mallikarjuna R Chilakala <[email protected]>
Adapter link advertisement capabilities were not persistent during adapter resets. While configuring multispeed fiber link check for phy autoneg_advertised settings before overwriting with default link capabilities
---
drivers/net/ixgbe/ixgbe_main.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +2 -1
@@ -4506,7 +4506,8 @@ static void ixgbe_multispeed_fiber_task(struct work_struct *work)u32 autoneg; adapter->flags |=IXGBE_FLAG_IN_SFP_LINK_TASK ; -if (hw->mac.ops.get_link_capabilities) + autoneg = hw->phy.autoneg_advertised; +if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) hw->mac.ops.get_link_capabilities (hw, &autoneg, &hw->mac.autoneg);if (hw->mac.ops.setup_link_speed)
Re: [net-2.6 PATCH 3/4] ixgbe: Fix link capabilities during adapter resets
From: Jeff Kirsher <[email protected]>
Date: Tue, 30 Jun 2009 14:44:36 -0700
Quoted 9 lines
From: Mallikarjuna R Chilakala <[email protected]>
Adapter link advertisement capabilities were not persistent during adapter resets. While configuring multispeed fiber link check for phy
autoneg_advertisedsettings before overwriting with default link capabilitiesSigned-off-by Mallikarjuna R Chilakala <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
PATCH 4/4 ixgbe: fix unmap length bug
In reply to Jeff KirsherFrom: Jesse Brandeburg <[email protected]>
This patch addresses three WARN_ON statements from DMA-API debug code
ixgbe is mapping more than it unmaps, reduce the length of the map call and remove the "used once" local variable.
found by Joerg Roedel <[email protected]> in 2.6.30, so is a candidate for -stable.
in addition, fix missing ->dma = 0 after unmap to prevent double free with pci_unmap_single
and lastly, don't unmap (half) pages that aren't mapped.
---
drivers/net/ixgbe/ixgbe_main.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +11 -6
@@ -563,7 +563,6 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,union ixgbe_adv_rx_desc *rx_desc;struct ixgbe_rx_buffer *bi;unsigned int i; -unsigned int bufsz = rx_ring->rx_buf_len +NET_IP_ALIGN ; i = rx_ring->next_to_use; bi = &rx_ring->rx_buffer_info[i];
@@ -593,7 +592,9 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,if (!bi->skb) {struct sk_buff *skb; - skb =netdev_alloc_skb (adapter->netdev, bufsz); + skb =netdev_alloc_skb (adapter->netdev, + (rx_ring->rx_buf_len + +NET_IP_ALIGN ));if (!skb) { adapter->alloc_rx_buff_failed++;
@@ -608,7 +609,8 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,skb_reserve (skb,NET_IP_ALIGN ); bi->skb = skb; - bi->dma =pci_map_single (pdev, skb->data, bufsz, + bi->dma =pci_map_single (pdev, skb->data, + rx_ring->rx_buf_len,PCI_DMA_FROMDEVICE ); }/* Refresh the desc even if buffer_addrs didn't change because
@@ -732,6 +734,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,pci_unmap_single (pdev, rx_buffer_info->dma, rx_ring->rx_buf_len,PCI_DMA_FROMDEVICE ); + rx_buffer_info->dma =0 ;skb_put (skb, len); }
@@ -2815,9 +2818,11 @@ static void ixgbe_clean_rx_ring(struct ixgbe_adapter *adapter, }if (!rx_buffer_info->page)continue ; -pci_unmap_page (pdev, rx_buffer_info->page_dma,PAGE_SIZE /2 , -PCI_DMA_FROMDEVICE ); - rx_buffer_info->page_dma =0 ; +if (rx_buffer_info->page_dma) { +pci_unmap_page (pdev, rx_buffer_info->page_dma, +PAGE_SIZE /2 ,PCI_DMA_FROMDEVICE ); + rx_buffer_info->page_dma =0 ; + }put_page (rx_buffer_info->page); rx_buffer_info->page =NULL ; rx_buffer_info->page_offset =0 ;
Re: [net-2.6 PATCH 4/4] ixgbe: fix unmap length bug
From: Jeff Kirsher <[email protected]>
Date: Tue, 30 Jun 2009 14:44:56 -0700
Quoted 10 lines
From: Jesse Brandeburg <[email protected]>
This patch addresses three
WARN_ONstatements from DMA-API debug codeixgbe is mapping more than it unmaps, reduce the length of the map call and remove the "used once" local variable.
found by Joerg Roedel <[email protected]> in 2.6.30, so is a candidate for -stable.
Quoted 8 lines
in addition, fix missing ->dma = 0 after unmap to prevent double free with
pci_unmap_singleand lastly, don't unmap (half) pages that aren't mapped.
Signed-off-by Jesse Brandeburg <[email protected]>CC Joerg Roedel <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
From: Jeff Kirsher <[email protected]>
Date: Tue, 30 Jun 2009 14:43:55 -0700
Quoted 8 lines
From: Don Skidmore <[email protected]>
We had a wide range of log messages for the same sort of SFP failure. This patch makes them all more similar and less confusing along with converting them to
dev_err.Signed-off-by Don Skidmore <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.