diff options
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index e756e220db32..5588ef493a3d 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -563,7 +563,6 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, | |||
563 | union ixgbe_adv_rx_desc *rx_desc; | 563 | union ixgbe_adv_rx_desc *rx_desc; |
564 | struct ixgbe_rx_buffer *bi; | 564 | struct ixgbe_rx_buffer *bi; |
565 | unsigned int i; | 565 | unsigned int i; |
566 | unsigned int bufsz = rx_ring->rx_buf_len + NET_IP_ALIGN; | ||
567 | 566 | ||
568 | i = rx_ring->next_to_use; | 567 | i = rx_ring->next_to_use; |
569 | bi = &rx_ring->rx_buffer_info[i]; | 568 | bi = &rx_ring->rx_buffer_info[i]; |
@@ -593,7 +592,9 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, | |||
593 | 592 | ||
594 | if (!bi->skb) { | 593 | if (!bi->skb) { |
595 | struct sk_buff *skb; | 594 | struct sk_buff *skb; |
596 | skb = netdev_alloc_skb(adapter->netdev, bufsz); | 595 | skb = netdev_alloc_skb(adapter->netdev, |
596 | (rx_ring->rx_buf_len + | ||
597 | NET_IP_ALIGN)); | ||
597 | 598 | ||
598 | if (!skb) { | 599 | if (!skb) { |
599 | adapter->alloc_rx_buff_failed++; | 600 | adapter->alloc_rx_buff_failed++; |
@@ -608,7 +609,8 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, | |||
608 | skb_reserve(skb, NET_IP_ALIGN); | 609 | skb_reserve(skb, NET_IP_ALIGN); |
609 | 610 | ||
610 | bi->skb = skb; | 611 | bi->skb = skb; |
611 | bi->dma = pci_map_single(pdev, skb->data, bufsz, | 612 | bi->dma = pci_map_single(pdev, skb->data, |
613 | rx_ring->rx_buf_len, | ||
612 | PCI_DMA_FROMDEVICE); | 614 | PCI_DMA_FROMDEVICE); |
613 | } | 615 | } |
614 | /* Refresh the desc even if buffer_addrs didn't change because | 616 | /* 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, | |||
732 | pci_unmap_single(pdev, rx_buffer_info->dma, | 734 | pci_unmap_single(pdev, rx_buffer_info->dma, |
733 | rx_ring->rx_buf_len, | 735 | rx_ring->rx_buf_len, |
734 | PCI_DMA_FROMDEVICE); | 736 | PCI_DMA_FROMDEVICE); |
737 | rx_buffer_info->dma = 0; | ||
735 | skb_put(skb, len); | 738 | skb_put(skb, len); |
736 | } | 739 | } |
737 | 740 | ||
@@ -2701,7 +2704,10 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter) | |||
2701 | */ | 2704 | */ |
2702 | err = hw->phy.ops.identify(hw); | 2705 | err = hw->phy.ops.identify(hw); |
2703 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 2706 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
2704 | DPRINTK(PROBE, ERR, "PHY not supported on this NIC %d\n", err); | 2707 | dev_err(&adapter->pdev->dev, "failed to initialize because " |
2708 | "an unsupported SFP+ module type was detected.\n" | ||
2709 | "Reload the driver after installing a supported " | ||
2710 | "module.\n"); | ||
2705 | ixgbe_down(adapter); | 2711 | ixgbe_down(adapter); |
2706 | return err; | 2712 | return err; |
2707 | } | 2713 | } |
@@ -2812,9 +2818,11 @@ static void ixgbe_clean_rx_ring(struct ixgbe_adapter *adapter, | |||
2812 | } | 2818 | } |
2813 | if (!rx_buffer_info->page) | 2819 | if (!rx_buffer_info->page) |
2814 | continue; | 2820 | continue; |
2815 | pci_unmap_page(pdev, rx_buffer_info->page_dma, PAGE_SIZE / 2, | 2821 | if (rx_buffer_info->page_dma) { |
2816 | PCI_DMA_FROMDEVICE); | 2822 | pci_unmap_page(pdev, rx_buffer_info->page_dma, |
2817 | rx_buffer_info->page_dma = 0; | 2823 | PAGE_SIZE / 2, PCI_DMA_FROMDEVICE); |
2824 | rx_buffer_info->page_dma = 0; | ||
2825 | } | ||
2818 | put_page(rx_buffer_info->page); | 2826 | put_page(rx_buffer_info->page); |
2819 | rx_buffer_info->page = NULL; | 2827 | rx_buffer_info->page = NULL; |
2820 | rx_buffer_info->page_offset = 0; | 2828 | rx_buffer_info->page_offset = 0; |
@@ -3720,10 +3728,11 @@ static void ixgbe_sfp_task(struct work_struct *work) | |||
3720 | goto reschedule; | 3728 | goto reschedule; |
3721 | ret = hw->phy.ops.reset(hw); | 3729 | ret = hw->phy.ops.reset(hw); |
3722 | if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 3730 | if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
3723 | DPRINTK(PROBE, ERR, "failed to initialize because an " | 3731 | dev_err(&adapter->pdev->dev, "failed to initialize " |
3724 | "unsupported SFP+ module type was detected.\n" | 3732 | "because an unsupported SFP+ module type " |
3725 | "Reload the driver after installing a " | 3733 | "was detected.\n" |
3726 | "supported module.\n"); | 3734 | "Reload the driver after installing a " |
3735 | "supported module.\n"); | ||
3727 | unregister_netdev(adapter->netdev); | 3736 | unregister_netdev(adapter->netdev); |
3728 | } else { | 3737 | } else { |
3729 | DPRINTK(PROBE, INFO, "detected SFP+: %d\n", | 3738 | DPRINTK(PROBE, INFO, "detected SFP+: %d\n", |
@@ -4502,7 +4511,8 @@ static void ixgbe_multispeed_fiber_task(struct work_struct *work) | |||
4502 | u32 autoneg; | 4511 | u32 autoneg; |
4503 | 4512 | ||
4504 | adapter->flags |= IXGBE_FLAG_IN_SFP_LINK_TASK; | 4513 | adapter->flags |= IXGBE_FLAG_IN_SFP_LINK_TASK; |
4505 | if (hw->mac.ops.get_link_capabilities) | 4514 | autoneg = hw->phy.autoneg_advertised; |
4515 | if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) | ||
4506 | hw->mac.ops.get_link_capabilities(hw, &autoneg, | 4516 | hw->mac.ops.get_link_capabilities(hw, &autoneg, |
4507 | &hw->mac.autoneg); | 4517 | &hw->mac.autoneg); |
4508 | if (hw->mac.ops.setup_link_speed) | 4518 | if (hw->mac.ops.setup_link_speed) |
@@ -4526,7 +4536,10 @@ static void ixgbe_sfp_config_module_task(struct work_struct *work) | |||
4526 | adapter->flags |= IXGBE_FLAG_IN_SFP_MOD_TASK; | 4536 | adapter->flags |= IXGBE_FLAG_IN_SFP_MOD_TASK; |
4527 | err = hw->phy.ops.identify_sfp(hw); | 4537 | err = hw->phy.ops.identify_sfp(hw); |
4528 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 4538 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
4529 | DPRINTK(PROBE, ERR, "PHY not supported on this NIC %d\n", err); | 4539 | dev_err(&adapter->pdev->dev, "failed to initialize because " |
4540 | "an unsupported SFP+ module type was detected.\n" | ||
4541 | "Reload the driver after installing a supported " | ||
4542 | "module.\n"); | ||
4530 | ixgbe_down(adapter); | 4543 | ixgbe_down(adapter); |
4531 | return; | 4544 | return; |
4532 | } | 4545 | } |
@@ -5513,8 +5526,10 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
5513 | round_jiffies(jiffies + (2 * HZ))); | 5526 | round_jiffies(jiffies + (2 * HZ))); |
5514 | err = 0; | 5527 | err = 0; |
5515 | } else if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 5528 | } else if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
5516 | dev_err(&adapter->pdev->dev, "failed to load because an " | 5529 | dev_err(&adapter->pdev->dev, "failed to initialize because " |
5517 | "unsupported SFP+ module type was detected.\n"); | 5530 | "an unsupported SFP+ module type was detected.\n" |
5531 | "Reload the driver after installing a supported " | ||
5532 | "module.\n"); | ||
5518 | goto err_sw_init; | 5533 | goto err_sw_init; |
5519 | } else if (err) { | 5534 | } else if (err) { |
5520 | dev_err(&adapter->pdev->dev, "HW Init failed: %d\n", err); | 5535 | dev_err(&adapter->pdev->dev, "HW Init failed: %d\n", err); |