diff options
| -rw-r--r-- | drivers/net/benet/be_main.c | 4 | ||||
| -rw-r--r-- | drivers/net/igb/igb_main.c | 22 | ||||
| -rw-r--r-- | drivers/net/igbvf/igbvf.h | 1 | ||||
| -rw-r--r-- | drivers/net/igbvf/netdev.c | 8 | ||||
| -rw-r--r-- | drivers/net/usb/kaweth.c | 4 |
5 files changed, 25 insertions, 14 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 24c7d9900baa..3a1f7902c16d 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
| @@ -759,7 +759,7 @@ static void be_rx_compl_process(struct be_adapter *adapter, | |||
| 759 | 759 | ||
| 760 | /* vlanf could be wrongly set in some cards. | 760 | /* vlanf could be wrongly set in some cards. |
| 761 | * ignore if vtm is not set */ | 761 | * ignore if vtm is not set */ |
| 762 | if ((adapter->cap == 0x400) && !vtm) | 762 | if ((adapter->cap & 0x400) && !vtm) |
| 763 | vlanf = 0; | 763 | vlanf = 0; |
| 764 | 764 | ||
| 765 | skb = netdev_alloc_skb_ip_align(adapter->netdev, BE_HDR_LEN); | 765 | skb = netdev_alloc_skb_ip_align(adapter->netdev, BE_HDR_LEN); |
| @@ -816,7 +816,7 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter, | |||
| 816 | 816 | ||
| 817 | /* vlanf could be wrongly set in some cards. | 817 | /* vlanf could be wrongly set in some cards. |
| 818 | * ignore if vtm is not set */ | 818 | * ignore if vtm is not set */ |
| 819 | if ((adapter->cap == 0x400) && !vtm) | 819 | if ((adapter->cap & 0x400) && !vtm) |
| 820 | vlanf = 0; | 820 | vlanf = 0; |
| 821 | 821 | ||
| 822 | skb = napi_get_frags(&eq_obj->napi); | 822 | skb = napi_get_frags(&eq_obj->napi); |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 16349ba68736..78963a0e128d 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
| @@ -4608,8 +4608,14 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf) | |||
| 4608 | 4608 | ||
| 4609 | retval = igb_read_mbx(hw, msgbuf, E1000_VFMAILBOX_SIZE, vf); | 4609 | retval = igb_read_mbx(hw, msgbuf, E1000_VFMAILBOX_SIZE, vf); |
| 4610 | 4610 | ||
| 4611 | if (retval) | 4611 | if (retval) { |
| 4612 | /* if receive failed revoke VF CTS stats and restart init */ | ||
| 4612 | dev_err(&pdev->dev, "Error receiving message from VF\n"); | 4613 | dev_err(&pdev->dev, "Error receiving message from VF\n"); |
| 4614 | vf_data->flags &= ~IGB_VF_FLAG_CTS; | ||
| 4615 | if (!time_after(jiffies, vf_data->last_nack + (2 * HZ))) | ||
| 4616 | return; | ||
| 4617 | goto out; | ||
| 4618 | } | ||
| 4613 | 4619 | ||
| 4614 | /* this is a message we already processed, do nothing */ | 4620 | /* this is a message we already processed, do nothing */ |
| 4615 | if (msgbuf[0] & (E1000_VT_MSGTYPE_ACK | E1000_VT_MSGTYPE_NACK)) | 4621 | if (msgbuf[0] & (E1000_VT_MSGTYPE_ACK | E1000_VT_MSGTYPE_NACK)) |
| @@ -4626,12 +4632,10 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf) | |||
| 4626 | } | 4632 | } |
| 4627 | 4633 | ||
| 4628 | if (!(vf_data->flags & IGB_VF_FLAG_CTS)) { | 4634 | if (!(vf_data->flags & IGB_VF_FLAG_CTS)) { |
| 4629 | msgbuf[0] = E1000_VT_MSGTYPE_NACK; | 4635 | if (!time_after(jiffies, vf_data->last_nack + (2 * HZ))) |
| 4630 | if (time_after(jiffies, vf_data->last_nack + (2 * HZ))) { | 4636 | return; |
| 4631 | igb_write_mbx(hw, msgbuf, 1, vf); | 4637 | retval = -1; |
| 4632 | vf_data->last_nack = jiffies; | 4638 | goto out; |
| 4633 | } | ||
| 4634 | return; | ||
| 4635 | } | 4639 | } |
| 4636 | 4640 | ||
| 4637 | switch ((msgbuf[0] & 0xFFFF)) { | 4641 | switch ((msgbuf[0] & 0xFFFF)) { |
| @@ -4656,14 +4660,14 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf) | |||
| 4656 | break; | 4660 | break; |
| 4657 | } | 4661 | } |
| 4658 | 4662 | ||
| 4663 | msgbuf[0] |= E1000_VT_MSGTYPE_CTS; | ||
| 4664 | out: | ||
| 4659 | /* notify the VF of the results of what it sent us */ | 4665 | /* notify the VF of the results of what it sent us */ |
| 4660 | if (retval) | 4666 | if (retval) |
| 4661 | msgbuf[0] |= E1000_VT_MSGTYPE_NACK; | 4667 | msgbuf[0] |= E1000_VT_MSGTYPE_NACK; |
| 4662 | else | 4668 | else |
| 4663 | msgbuf[0] |= E1000_VT_MSGTYPE_ACK; | 4669 | msgbuf[0] |= E1000_VT_MSGTYPE_ACK; |
| 4664 | 4670 | ||
| 4665 | msgbuf[0] |= E1000_VT_MSGTYPE_CTS; | ||
| 4666 | |||
| 4667 | igb_write_mbx(hw, msgbuf, 1, vf); | 4671 | igb_write_mbx(hw, msgbuf, 1, vf); |
| 4668 | } | 4672 | } |
| 4669 | 4673 | ||
diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h index 3d1ee7a8478e..a1774b29d222 100644 --- a/drivers/net/igbvf/igbvf.h +++ b/drivers/net/igbvf/igbvf.h | |||
| @@ -276,6 +276,7 @@ struct igbvf_adapter { | |||
| 276 | unsigned long led_status; | 276 | unsigned long led_status; |
| 277 | 277 | ||
| 278 | unsigned int flags; | 278 | unsigned int flags; |
| 279 | unsigned long last_reset; | ||
| 279 | }; | 280 | }; |
| 280 | 281 | ||
| 281 | struct igbvf_info { | 282 | struct igbvf_info { |
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c index a127620dc653..e9dd95f136aa 100644 --- a/drivers/net/igbvf/netdev.c +++ b/drivers/net/igbvf/netdev.c | |||
| @@ -1469,6 +1469,8 @@ static void igbvf_reset(struct igbvf_adapter *adapter) | |||
| 1469 | memcpy(netdev->perm_addr, adapter->hw.mac.addr, | 1469 | memcpy(netdev->perm_addr, adapter->hw.mac.addr, |
| 1470 | netdev->addr_len); | 1470 | netdev->addr_len); |
| 1471 | } | 1471 | } |
| 1472 | |||
| 1473 | adapter->last_reset = jiffies; | ||
| 1472 | } | 1474 | } |
| 1473 | 1475 | ||
| 1474 | int igbvf_up(struct igbvf_adapter *adapter) | 1476 | int igbvf_up(struct igbvf_adapter *adapter) |
| @@ -1812,11 +1814,15 @@ static bool igbvf_has_link(struct igbvf_adapter *adapter) | |||
| 1812 | s32 ret_val = E1000_SUCCESS; | 1814 | s32 ret_val = E1000_SUCCESS; |
| 1813 | bool link_active; | 1815 | bool link_active; |
| 1814 | 1816 | ||
| 1817 | /* If interface is down, stay link down */ | ||
| 1818 | if (test_bit(__IGBVF_DOWN, &adapter->state)) | ||
| 1819 | return false; | ||
| 1820 | |||
| 1815 | ret_val = hw->mac.ops.check_for_link(hw); | 1821 | ret_val = hw->mac.ops.check_for_link(hw); |
| 1816 | link_active = !hw->mac.get_link_status; | 1822 | link_active = !hw->mac.get_link_status; |
| 1817 | 1823 | ||
| 1818 | /* if check for link returns error we will need to reset */ | 1824 | /* if check for link returns error we will need to reset */ |
| 1819 | if (ret_val) | 1825 | if (ret_val && time_after(jiffies, adapter->last_reset + (10 * HZ))) |
| 1820 | schedule_work(&adapter->reset_task); | 1826 | schedule_work(&adapter->reset_task); |
| 1821 | 1827 | ||
| 1822 | return link_active; | 1828 | return link_active; |
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index 3b80e8d2d621..f1d64ef67efa 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c | |||
| @@ -716,7 +716,7 @@ static int kaweth_open(struct net_device *net) | |||
| 716 | return 0; | 716 | return 0; |
| 717 | 717 | ||
| 718 | err_out: | 718 | err_out: |
| 719 | usb_autopm_enable(kaweth->intf); | 719 | usb_autopm_put_interface(kaweth->intf); |
| 720 | return -EIO; | 720 | return -EIO; |
| 721 | } | 721 | } |
| 722 | 722 | ||
| @@ -753,7 +753,7 @@ static int kaweth_close(struct net_device *net) | |||
| 753 | 753 | ||
| 754 | kaweth->status &= ~KAWETH_STATUS_CLOSING; | 754 | kaweth->status &= ~KAWETH_STATUS_CLOSING; |
| 755 | 755 | ||
| 756 | usb_autopm_enable(kaweth->intf); | 756 | usb_autopm_put_interface(kaweth->intf); |
| 757 | 757 | ||
| 758 | return 0; | 758 | return 0; |
| 759 | } | 759 | } |
