diff options
author | David S. Miller <davem@davemloft.net> | 2010-07-07 18:59:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-07 18:59:38 -0400 |
commit | 597e608a8492d662736c9bc6aa507dbf1cadc17d (patch) | |
tree | 6c330cdd0a4809f67dd191b37e34f5b4318cef78 /drivers/net | |
parent | acbc0f039ff4b93da737c91937b7c70018ded39f (diff) | |
parent | 33b665eeeb85956ccbdf31c4c31a4e2a31133c44 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bonding/bond_alb.c | 3 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 33 | ||||
-rw-r--r-- | drivers/net/cpmac.c | 3 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 17 | ||||
-rw-r--r-- | drivers/net/ll_temac_main.c | 18 | ||||
-rw-r--r-- | drivers/net/mv643xx_eth.c | 9 | ||||
-rw-r--r-- | drivers/net/ne.c | 4 | ||||
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 18 | ||||
-rw-r--r-- | drivers/net/phy/lxt.c | 1 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_main.c | 11 | ||||
-rw-r--r-- | drivers/net/s2io.c | 101 | ||||
-rw-r--r-- | drivers/net/s2io.h | 4 | ||||
-rw-r--r-- | drivers/net/sb1250-mac.c | 1 | ||||
-rw-r--r-- | drivers/net/usb/rndis_host.c | 18 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 5 | ||||
-rw-r--r-- | drivers/net/virtio_net.c | 28 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-main.c | 33 |
17 files changed, 190 insertions, 117 deletions
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 25c14c6236f5..3662d6e446a9 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -333,7 +333,8 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp) | |||
333 | 333 | ||
334 | if ((client_info->assigned) && | 334 | if ((client_info->assigned) && |
335 | (client_info->ip_src == arp->ip_dst) && | 335 | (client_info->ip_src == arp->ip_dst) && |
336 | (client_info->ip_dst == arp->ip_src)) { | 336 | (client_info->ip_dst == arp->ip_src) && |
337 | (compare_ether_addr_64bits(client_info->mac_dst, arp->mac_src))) { | ||
337 | /* update the clients MAC address */ | 338 | /* update the clients MAC address */ |
338 | memcpy(client_info->mac_dst, arp->mac_src, ETH_ALEN); | 339 | memcpy(client_info->mac_dst, arp->mac_src, ETH_ALEN); |
339 | client_info->ntt = 1; | 340 | client_info->ntt = 1; |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 9bb9bfa225b6..822808810a13 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -176,7 +176,7 @@ static int arp_ip_count; | |||
176 | static int bond_mode = BOND_MODE_ROUNDROBIN; | 176 | static int bond_mode = BOND_MODE_ROUNDROBIN; |
177 | static int xmit_hashtype = BOND_XMIT_POLICY_LAYER2; | 177 | static int xmit_hashtype = BOND_XMIT_POLICY_LAYER2; |
178 | static int lacp_fast; | 178 | static int lacp_fast; |
179 | 179 | static int disable_netpoll = 1; | |
180 | 180 | ||
181 | const struct bond_parm_tbl bond_lacp_tbl[] = { | 181 | const struct bond_parm_tbl bond_lacp_tbl[] = { |
182 | { "slow", AD_LACP_SLOW}, | 182 | { "slow", AD_LACP_SLOW}, |
@@ -1766,15 +1766,23 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1766 | bond_set_carrier(bond); | 1766 | bond_set_carrier(bond); |
1767 | 1767 | ||
1768 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1768 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1769 | if (slaves_support_netpoll(bond_dev)) { | 1769 | /* |
1770 | bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL; | 1770 | * Netpoll and bonding is broken, make sure it is not initialized |
1771 | if (bond_dev->npinfo) | 1771 | * until it is fixed. |
1772 | slave_dev->npinfo = bond_dev->npinfo; | 1772 | */ |
1773 | } else if (!(bond_dev->priv_flags & IFF_DISABLE_NETPOLL)) { | 1773 | if (disable_netpoll) { |
1774 | bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; | 1774 | bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; |
1775 | pr_info("New slave device %s does not support netpoll\n", | 1775 | } else { |
1776 | slave_dev->name); | 1776 | if (slaves_support_netpoll(bond_dev)) { |
1777 | pr_info("Disabling netpoll support for %s\n", bond_dev->name); | 1777 | bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL; |
1778 | if (bond_dev->npinfo) | ||
1779 | slave_dev->npinfo = bond_dev->npinfo; | ||
1780 | } else if (!(bond_dev->priv_flags & IFF_DISABLE_NETPOLL)) { | ||
1781 | bond_dev->priv_flags |= IFF_DISABLE_NETPOLL; | ||
1782 | pr_info("New slave device %s does not support netpoll\n", | ||
1783 | slave_dev->name); | ||
1784 | pr_info("Disabling netpoll support for %s\n", bond_dev->name); | ||
1785 | } | ||
1778 | } | 1786 | } |
1779 | #endif | 1787 | #endif |
1780 | read_unlock(&bond->lock); | 1788 | read_unlock(&bond->lock); |
@@ -1977,8 +1985,11 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1977 | 1985 | ||
1978 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1986 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1979 | read_lock_bh(&bond->lock); | 1987 | read_lock_bh(&bond->lock); |
1980 | if (slaves_support_netpoll(bond_dev)) | 1988 | |
1981 | bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL; | 1989 | /* Make sure netpoll over stays disabled until fixed. */ |
1990 | if (!disable_netpoll) | ||
1991 | if (slaves_support_netpoll(bond_dev)) | ||
1992 | bond_dev->priv_flags &= ~IFF_DISABLE_NETPOLL; | ||
1982 | read_unlock_bh(&bond->lock); | 1993 | read_unlock_bh(&bond->lock); |
1983 | if (slave_dev->netdev_ops->ndo_netpoll_cleanup) | 1994 | if (slave_dev->netdev_ops->ndo_netpoll_cleanup) |
1984 | slave_dev->netdev_ops->ndo_netpoll_cleanup(slave_dev); | 1995 | slave_dev->netdev_ops->ndo_netpoll_cleanup(slave_dev); |
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index 1756d28250d4..38de1a4f825f 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c | |||
@@ -1181,7 +1181,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev) | |||
1181 | if (netif_msg_drv(priv)) | 1181 | if (netif_msg_drv(priv)) |
1182 | printk(KERN_ERR "%s: Could not attach to PHY\n", | 1182 | printk(KERN_ERR "%s: Could not attach to PHY\n", |
1183 | dev->name); | 1183 | dev->name); |
1184 | return PTR_ERR(priv->phy); | 1184 | rc = PTR_ERR(priv->phy); |
1185 | goto fail; | ||
1185 | } | 1186 | } |
1186 | 1187 | ||
1187 | if ((rc = register_netdev(dev))) { | 1188 | if ((rc = register_netdev(dev))) { |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 55099a50cca4..b235aa16290f 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -3741,10 +3741,6 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
3741 | /* signal that we are down to the interrupt handler */ | 3741 | /* signal that we are down to the interrupt handler */ |
3742 | set_bit(__IXGBE_DOWN, &adapter->state); | 3742 | set_bit(__IXGBE_DOWN, &adapter->state); |
3743 | 3743 | ||
3744 | /* power down the optics */ | ||
3745 | if (hw->phy.multispeed_fiber) | ||
3746 | hw->mac.ops.disable_tx_laser(hw); | ||
3747 | |||
3748 | /* disable receive for all VFs and wait one second */ | 3744 | /* disable receive for all VFs and wait one second */ |
3749 | if (adapter->num_vfs) { | 3745 | if (adapter->num_vfs) { |
3750 | /* ping all the active vfs to let them know we are going down */ | 3746 | /* ping all the active vfs to let them know we are going down */ |
@@ -3799,6 +3795,10 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
3799 | (IXGBE_READ_REG(hw, IXGBE_DMATXCTL) & | 3795 | (IXGBE_READ_REG(hw, IXGBE_DMATXCTL) & |
3800 | ~IXGBE_DMATXCTL_TE)); | 3796 | ~IXGBE_DMATXCTL_TE)); |
3801 | 3797 | ||
3798 | /* power down the optics */ | ||
3799 | if (hw->phy.multispeed_fiber) | ||
3800 | hw->mac.ops.disable_tx_laser(hw); | ||
3801 | |||
3802 | /* clear n-tuple filters that are cached */ | 3802 | /* clear n-tuple filters that are cached */ |
3803 | ethtool_ntuple_flush(netdev); | 3803 | ethtool_ntuple_flush(netdev); |
3804 | 3804 | ||
@@ -4058,7 +4058,7 @@ static void ixgbe_set_num_queues(struct ixgbe_adapter *adapter) | |||
4058 | 4058 | ||
4059 | done: | 4059 | done: |
4060 | /* Notify the stack of the (possibly) reduced Tx Queue count. */ | 4060 | /* Notify the stack of the (possibly) reduced Tx Queue count. */ |
4061 | adapter->netdev->real_num_tx_queues = adapter->num_tx_queues; | 4061 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); |
4062 | } | 4062 | } |
4063 | 4063 | ||
4064 | static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter, | 4064 | static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter, |
@@ -5246,7 +5246,6 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) | |||
5246 | ixgbe_free_all_tx_resources(adapter); | 5246 | ixgbe_free_all_tx_resources(adapter); |
5247 | ixgbe_free_all_rx_resources(adapter); | 5247 | ixgbe_free_all_rx_resources(adapter); |
5248 | } | 5248 | } |
5249 | ixgbe_clear_interrupt_scheme(adapter); | ||
5250 | 5249 | ||
5251 | #ifdef CONFIG_PM | 5250 | #ifdef CONFIG_PM |
5252 | retval = pci_save_state(pdev); | 5251 | retval = pci_save_state(pdev); |
@@ -5281,6 +5280,8 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) | |||
5281 | 5280 | ||
5282 | *enable_wake = !!wufc; | 5281 | *enable_wake = !!wufc; |
5283 | 5282 | ||
5283 | ixgbe_clear_interrupt_scheme(adapter); | ||
5284 | |||
5284 | ixgbe_release_hw_control(adapter); | 5285 | ixgbe_release_hw_control(adapter); |
5285 | 5286 | ||
5286 | pci_disable_device(pdev); | 5287 | pci_disable_device(pdev); |
@@ -6071,7 +6072,6 @@ static void ixgbe_tx_queue(struct ixgbe_adapter *adapter, | |||
6071 | static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb, | 6072 | static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb, |
6072 | int queue, u32 tx_flags) | 6073 | int queue, u32 tx_flags) |
6073 | { | 6074 | { |
6074 | /* Right now, we support IPv4 only */ | ||
6075 | struct ixgbe_atr_input atr_input; | 6075 | struct ixgbe_atr_input atr_input; |
6076 | struct tcphdr *th; | 6076 | struct tcphdr *th; |
6077 | struct iphdr *iph = ip_hdr(skb); | 6077 | struct iphdr *iph = ip_hdr(skb); |
@@ -6080,6 +6080,9 @@ static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb, | |||
6080 | u32 src_ipv4_addr, dst_ipv4_addr; | 6080 | u32 src_ipv4_addr, dst_ipv4_addr; |
6081 | u8 l4type = 0; | 6081 | u8 l4type = 0; |
6082 | 6082 | ||
6083 | /* Right now, we support IPv4 only */ | ||
6084 | if (skb->protocol != htons(ETH_P_IP)) | ||
6085 | return; | ||
6083 | /* check if we're UDP or TCP */ | 6086 | /* check if we're UDP or TCP */ |
6084 | if (iph->protocol == IPPROTO_TCP) { | 6087 | if (iph->protocol == IPPROTO_TCP) { |
6085 | th = tcp_hdr(skb); | 6088 | th = tcp_hdr(skb); |
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c index 7b12d0e8f4bd..fa303c881a48 100644 --- a/drivers/net/ll_temac_main.c +++ b/drivers/net/ll_temac_main.c | |||
@@ -985,7 +985,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
985 | np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); | 985 | np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); |
986 | if (!np) { | 986 | if (!np) { |
987 | dev_err(&op->dev, "could not find DMA node\n"); | 987 | dev_err(&op->dev, "could not find DMA node\n"); |
988 | goto nodev; | 988 | goto err_iounmap; |
989 | } | 989 | } |
990 | 990 | ||
991 | /* Setup the DMA register accesses, could be DCR or memory mapped */ | 991 | /* Setup the DMA register accesses, could be DCR or memory mapped */ |
@@ -999,7 +999,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
999 | dev_dbg(&op->dev, "MEM base: %p\n", lp->sdma_regs); | 999 | dev_dbg(&op->dev, "MEM base: %p\n", lp->sdma_regs); |
1000 | } else { | 1000 | } else { |
1001 | dev_err(&op->dev, "unable to map DMA registers\n"); | 1001 | dev_err(&op->dev, "unable to map DMA registers\n"); |
1002 | goto nodev; | 1002 | goto err_iounmap; |
1003 | } | 1003 | } |
1004 | } | 1004 | } |
1005 | 1005 | ||
@@ -1008,7 +1008,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1008 | if ((lp->rx_irq == NO_IRQ) || (lp->tx_irq == NO_IRQ)) { | 1008 | if ((lp->rx_irq == NO_IRQ) || (lp->tx_irq == NO_IRQ)) { |
1009 | dev_err(&op->dev, "could not determine irqs\n"); | 1009 | dev_err(&op->dev, "could not determine irqs\n"); |
1010 | rc = -ENOMEM; | 1010 | rc = -ENOMEM; |
1011 | goto nodev; | 1011 | goto err_iounmap_2; |
1012 | } | 1012 | } |
1013 | 1013 | ||
1014 | of_node_put(np); /* Finished with the DMA node; drop the reference */ | 1014 | of_node_put(np); /* Finished with the DMA node; drop the reference */ |
@@ -1018,7 +1018,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1018 | if ((!addr) || (size != 6)) { | 1018 | if ((!addr) || (size != 6)) { |
1019 | dev_err(&op->dev, "could not find MAC address\n"); | 1019 | dev_err(&op->dev, "could not find MAC address\n"); |
1020 | rc = -ENODEV; | 1020 | rc = -ENODEV; |
1021 | goto nodev; | 1021 | goto err_iounmap_2; |
1022 | } | 1022 | } |
1023 | temac_set_mac_address(ndev, (void *)addr); | 1023 | temac_set_mac_address(ndev, (void *)addr); |
1024 | 1024 | ||
@@ -1034,7 +1034,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1034 | rc = sysfs_create_group(&lp->dev->kobj, &temac_attr_group); | 1034 | rc = sysfs_create_group(&lp->dev->kobj, &temac_attr_group); |
1035 | if (rc) { | 1035 | if (rc) { |
1036 | dev_err(lp->dev, "Error creating sysfs files\n"); | 1036 | dev_err(lp->dev, "Error creating sysfs files\n"); |
1037 | goto nodev; | 1037 | goto err_iounmap_2; |
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | rc = register_netdev(lp->ndev); | 1040 | rc = register_netdev(lp->ndev); |
@@ -1047,6 +1047,11 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1047 | 1047 | ||
1048 | err_register_ndev: | 1048 | err_register_ndev: |
1049 | sysfs_remove_group(&lp->dev->kobj, &temac_attr_group); | 1049 | sysfs_remove_group(&lp->dev->kobj, &temac_attr_group); |
1050 | err_iounmap_2: | ||
1051 | if (lp->sdma_regs) | ||
1052 | iounmap(lp->sdma_regs); | ||
1053 | err_iounmap: | ||
1054 | iounmap(lp->regs); | ||
1050 | nodev: | 1055 | nodev: |
1051 | free_netdev(ndev); | 1056 | free_netdev(ndev); |
1052 | ndev = NULL; | 1057 | ndev = NULL; |
@@ -1065,6 +1070,9 @@ static int __devexit temac_of_remove(struct of_device *op) | |||
1065 | of_node_put(lp->phy_node); | 1070 | of_node_put(lp->phy_node); |
1066 | lp->phy_node = NULL; | 1071 | lp->phy_node = NULL; |
1067 | dev_set_drvdata(&op->dev, NULL); | 1072 | dev_set_drvdata(&op->dev, NULL); |
1073 | iounmap(lp->regs); | ||
1074 | if (lp->sdma_regs) | ||
1075 | iounmap(lp->sdma_regs); | ||
1068 | free_netdev(ndev); | 1076 | free_netdev(ndev); |
1069 | return 0; | 1077 | return 0; |
1070 | } | 1078 | } |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 82b720f29c75..af075af20e0c 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -289,6 +289,7 @@ struct mv643xx_eth_shared_private { | |||
289 | unsigned int t_clk; | 289 | unsigned int t_clk; |
290 | int extended_rx_coal_limit; | 290 | int extended_rx_coal_limit; |
291 | int tx_bw_control; | 291 | int tx_bw_control; |
292 | int tx_csum_limit; | ||
292 | }; | 293 | }; |
293 | 294 | ||
294 | #define TX_BW_CONTROL_ABSENT 0 | 295 | #define TX_BW_CONTROL_ABSENT 0 |
@@ -776,13 +777,16 @@ static int txq_submit_skb(struct tx_queue *txq, struct sk_buff *skb) | |||
776 | l4i_chk = 0; | 777 | l4i_chk = 0; |
777 | 778 | ||
778 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 779 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
780 | int hdr_len; | ||
779 | int tag_bytes; | 781 | int tag_bytes; |
780 | 782 | ||
781 | BUG_ON(skb->protocol != htons(ETH_P_IP) && | 783 | BUG_ON(skb->protocol != htons(ETH_P_IP) && |
782 | skb->protocol != htons(ETH_P_8021Q)); | 784 | skb->protocol != htons(ETH_P_8021Q)); |
783 | 785 | ||
784 | tag_bytes = (void *)ip_hdr(skb) - (void *)skb->data - ETH_HLEN; | 786 | hdr_len = (void *)ip_hdr(skb) - (void *)skb->data; |
785 | if (unlikely(tag_bytes & ~12)) { | 787 | tag_bytes = hdr_len - ETH_HLEN; |
788 | if (skb->len - hdr_len > mp->shared->tx_csum_limit || | ||
789 | unlikely(tag_bytes & ~12)) { | ||
786 | if (skb_checksum_help(skb) == 0) | 790 | if (skb_checksum_help(skb) == 0) |
787 | goto no_csum; | 791 | goto no_csum; |
788 | kfree_skb(skb); | 792 | kfree_skb(skb); |
@@ -2671,6 +2675,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) | |||
2671 | * Detect hardware parameters. | 2675 | * Detect hardware parameters. |
2672 | */ | 2676 | */ |
2673 | msp->t_clk = (pd != NULL && pd->t_clk != 0) ? pd->t_clk : 133000000; | 2677 | msp->t_clk = (pd != NULL && pd->t_clk != 0) ? pd->t_clk : 133000000; |
2678 | msp->tx_csum_limit = pd->tx_csum_limit ? pd->tx_csum_limit : 9 * 1024; | ||
2674 | infer_hw_params(msp); | 2679 | infer_hw_params(msp); |
2675 | 2680 | ||
2676 | platform_set_drvdata(pdev, msp); | 2681 | platform_set_drvdata(pdev, msp); |
diff --git a/drivers/net/ne.c b/drivers/net/ne.c index b8e2923a1d69..1063093b3afc 100644 --- a/drivers/net/ne.c +++ b/drivers/net/ne.c | |||
@@ -806,8 +806,10 @@ static int __init ne_drv_probe(struct platform_device *pdev) | |||
806 | dev->base_addr = res->start; | 806 | dev->base_addr = res->start; |
807 | dev->irq = platform_get_irq(pdev, 0); | 807 | dev->irq = platform_get_irq(pdev, 0); |
808 | } else { | 808 | } else { |
809 | if (this_dev < 0 || this_dev >= MAX_NE_CARDS) | 809 | if (this_dev < 0 || this_dev >= MAX_NE_CARDS) { |
810 | free_netdev(dev); | ||
810 | return -EINVAL; | 811 | return -EINVAL; |
812 | } | ||
811 | dev->base_addr = io[this_dev]; | 813 | dev->base_addr = io[this_dev]; |
812 | dev->irq = irq[this_dev]; | 814 | dev->irq = irq[this_dev]; |
813 | dev->mem_end = bad[this_dev]; | 815 | dev->mem_end = bad[this_dev]; |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 64e6a84bbbbe..307cd1721e91 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -1505,12 +1505,20 @@ irq_done: | |||
1505 | writeb(cor & ~COR_IREQ_ENA, smc->base + MOT_LAN + CISREG_COR); | 1505 | writeb(cor & ~COR_IREQ_ENA, smc->base + MOT_LAN + CISREG_COR); |
1506 | writeb(cor, smc->base + MOT_LAN + CISREG_COR); | 1506 | writeb(cor, smc->base + MOT_LAN + CISREG_COR); |
1507 | } | 1507 | } |
1508 | #ifdef DOES_NOT_WORK | 1508 | |
1509 | if (smc->base != NULL) { /* Megahertz MFC's */ | 1509 | if ((smc->base != NULL) && /* Megahertz MFC's */ |
1510 | readb(smc->base+MEGAHERTZ_ISR); | 1510 | (smc->manfid == MANFID_MEGAHERTZ) && |
1511 | readb(smc->base+MEGAHERTZ_ISR); | 1511 | (smc->cardid == PRODID_MEGAHERTZ_EM3288)) { |
1512 | |||
1513 | u_char tmp; | ||
1514 | tmp = readb(smc->base+MEGAHERTZ_ISR); | ||
1515 | tmp = readb(smc->base+MEGAHERTZ_ISR); | ||
1516 | |||
1517 | /* Retrigger interrupt if needed */ | ||
1518 | writeb(tmp, smc->base + MEGAHERTZ_ISR); | ||
1519 | writeb(tmp, smc->base + MEGAHERTZ_ISR); | ||
1512 | } | 1520 | } |
1513 | #endif | 1521 | |
1514 | spin_unlock(&smc->lock); | 1522 | spin_unlock(&smc->lock); |
1515 | return IRQ_RETVAL(handled); | 1523 | return IRQ_RETVAL(handled); |
1516 | } | 1524 | } |
diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c index dbd003453737..29c39ff85de5 100644 --- a/drivers/net/phy/lxt.c +++ b/drivers/net/phy/lxt.c | |||
@@ -226,6 +226,7 @@ module_exit(lxt_exit); | |||
226 | static struct mdio_device_id lxt_tbl[] = { | 226 | static struct mdio_device_id lxt_tbl[] = { |
227 | { 0x78100000, 0xfffffff0 }, | 227 | { 0x78100000, 0xfffffff0 }, |
228 | { 0x001378e0, 0xfffffff0 }, | 228 | { 0x001378e0, 0xfffffff0 }, |
229 | { 0x00137a10, 0xfffffff0 }, | ||
229 | { } | 230 | { } |
230 | }; | 231 | }; |
231 | 232 | ||
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index dd9e86ca7c5a..8d63f69b27d9 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -4642,8 +4642,7 @@ static void ql_timer(unsigned long data) | |||
4642 | return; | 4642 | return; |
4643 | } | 4643 | } |
4644 | 4644 | ||
4645 | qdev->timer.expires = jiffies + (5*HZ); | 4645 | mod_timer(&qdev->timer, jiffies + (5*HZ)); |
4646 | add_timer(&qdev->timer); | ||
4647 | } | 4646 | } |
4648 | 4647 | ||
4649 | static int __devinit qlge_probe(struct pci_dev *pdev, | 4648 | static int __devinit qlge_probe(struct pci_dev *pdev, |
@@ -4744,6 +4743,8 @@ static void ql_eeh_close(struct net_device *ndev) | |||
4744 | netif_stop_queue(ndev); | 4743 | netif_stop_queue(ndev); |
4745 | } | 4744 | } |
4746 | 4745 | ||
4746 | /* Disabling the timer */ | ||
4747 | del_timer_sync(&qdev->timer); | ||
4747 | if (test_bit(QL_ADAPTER_UP, &qdev->flags)) | 4748 | if (test_bit(QL_ADAPTER_UP, &qdev->flags)) |
4748 | cancel_delayed_work_sync(&qdev->asic_reset_work); | 4749 | cancel_delayed_work_sync(&qdev->asic_reset_work); |
4749 | cancel_delayed_work_sync(&qdev->mpi_reset_work); | 4750 | cancel_delayed_work_sync(&qdev->mpi_reset_work); |
@@ -4839,8 +4840,7 @@ static void qlge_io_resume(struct pci_dev *pdev) | |||
4839 | netif_err(qdev, ifup, qdev->ndev, | 4840 | netif_err(qdev, ifup, qdev->ndev, |
4840 | "Device was not running prior to EEH.\n"); | 4841 | "Device was not running prior to EEH.\n"); |
4841 | } | 4842 | } |
4842 | qdev->timer.expires = jiffies + (5*HZ); | 4843 | mod_timer(&qdev->timer, jiffies + (5*HZ)); |
4843 | add_timer(&qdev->timer); | ||
4844 | netif_device_attach(ndev); | 4844 | netif_device_attach(ndev); |
4845 | } | 4845 | } |
4846 | 4846 | ||
@@ -4902,8 +4902,7 @@ static int qlge_resume(struct pci_dev *pdev) | |||
4902 | return err; | 4902 | return err; |
4903 | } | 4903 | } |
4904 | 4904 | ||
4905 | qdev->timer.expires = jiffies + (5*HZ); | 4905 | mod_timer(&qdev->timer, jiffies + (5*HZ)); |
4906 | add_timer(&qdev->timer); | ||
4907 | netif_device_attach(ndev); | 4906 | netif_device_attach(ndev); |
4908 | 4907 | ||
4909 | return 0; | 4908 | return 0; |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 22371f1dca58..d0af924ddd67 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -3129,7 +3129,6 @@ static void tx_intr_handler(struct fifo_info *fifo_data) | |||
3129 | pkt_cnt++; | 3129 | pkt_cnt++; |
3130 | 3130 | ||
3131 | /* Updating the statistics block */ | 3131 | /* Updating the statistics block */ |
3132 | nic->dev->stats.tx_bytes += skb->len; | ||
3133 | swstats->mem_freed += skb->truesize; | 3132 | swstats->mem_freed += skb->truesize; |
3134 | dev_kfree_skb_irq(skb); | 3133 | dev_kfree_skb_irq(skb); |
3135 | 3134 | ||
@@ -4900,48 +4899,81 @@ static void s2io_updt_stats(struct s2io_nic *sp) | |||
4900 | * Return value: | 4899 | * Return value: |
4901 | * pointer to the updated net_device_stats structure. | 4900 | * pointer to the updated net_device_stats structure. |
4902 | */ | 4901 | */ |
4903 | |||
4904 | static struct net_device_stats *s2io_get_stats(struct net_device *dev) | 4902 | static struct net_device_stats *s2io_get_stats(struct net_device *dev) |
4905 | { | 4903 | { |
4906 | struct s2io_nic *sp = netdev_priv(dev); | 4904 | struct s2io_nic *sp = netdev_priv(dev); |
4907 | struct config_param *config = &sp->config; | ||
4908 | struct mac_info *mac_control = &sp->mac_control; | 4905 | struct mac_info *mac_control = &sp->mac_control; |
4909 | struct stat_block *stats = mac_control->stats_info; | 4906 | struct stat_block *stats = mac_control->stats_info; |
4910 | int i; | 4907 | u64 delta; |
4911 | 4908 | ||
4912 | /* Configure Stats for immediate updt */ | 4909 | /* Configure Stats for immediate updt */ |
4913 | s2io_updt_stats(sp); | 4910 | s2io_updt_stats(sp); |
4914 | 4911 | ||
4915 | /* Using sp->stats as a staging area, because reset (due to mtu | 4912 | /* A device reset will cause the on-adapter statistics to be zero'ed. |
4916 | change, for example) will clear some hardware counters */ | 4913 | * This can be done while running by changing the MTU. To prevent the |
4917 | dev->stats.tx_packets += le32_to_cpu(stats->tmac_frms) - | 4914 | * system from having the stats zero'ed, the driver keeps a copy of the |
4918 | sp->stats.tx_packets; | 4915 | * last update to the system (which is also zero'ed on reset). This |
4919 | sp->stats.tx_packets = le32_to_cpu(stats->tmac_frms); | 4916 | * enables the driver to accurately know the delta between the last |
4920 | 4917 | * update and the current update. | |
4921 | dev->stats.tx_errors += le32_to_cpu(stats->tmac_any_err_frms) - | 4918 | */ |
4922 | sp->stats.tx_errors; | 4919 | delta = ((u64) le32_to_cpu(stats->rmac_vld_frms_oflow) << 32 | |
4923 | sp->stats.tx_errors = le32_to_cpu(stats->tmac_any_err_frms); | 4920 | le32_to_cpu(stats->rmac_vld_frms)) - sp->stats.rx_packets; |
4924 | 4921 | sp->stats.rx_packets += delta; | |
4925 | dev->stats.rx_errors += le64_to_cpu(stats->rmac_drop_frms) - | 4922 | dev->stats.rx_packets += delta; |
4926 | sp->stats.rx_errors; | 4923 | |
4927 | sp->stats.rx_errors = le64_to_cpu(stats->rmac_drop_frms); | 4924 | delta = ((u64) le32_to_cpu(stats->tmac_frms_oflow) << 32 | |
4928 | 4925 | le32_to_cpu(stats->tmac_frms)) - sp->stats.tx_packets; | |
4929 | dev->stats.multicast = le32_to_cpu(stats->rmac_vld_mcst_frms) - | 4926 | sp->stats.tx_packets += delta; |
4930 | sp->stats.multicast; | 4927 | dev->stats.tx_packets += delta; |
4931 | sp->stats.multicast = le32_to_cpu(stats->rmac_vld_mcst_frms); | 4928 | |
4932 | 4929 | delta = ((u64) le32_to_cpu(stats->rmac_data_octets_oflow) << 32 | | |
4933 | dev->stats.rx_length_errors = le64_to_cpu(stats->rmac_long_frms) - | 4930 | le32_to_cpu(stats->rmac_data_octets)) - sp->stats.rx_bytes; |
4934 | sp->stats.rx_length_errors; | 4931 | sp->stats.rx_bytes += delta; |
4935 | sp->stats.rx_length_errors = le64_to_cpu(stats->rmac_long_frms); | 4932 | dev->stats.rx_bytes += delta; |
4933 | |||
4934 | delta = ((u64) le32_to_cpu(stats->tmac_data_octets_oflow) << 32 | | ||
4935 | le32_to_cpu(stats->tmac_data_octets)) - sp->stats.tx_bytes; | ||
4936 | sp->stats.tx_bytes += delta; | ||
4937 | dev->stats.tx_bytes += delta; | ||
4938 | |||
4939 | delta = le64_to_cpu(stats->rmac_drop_frms) - sp->stats.rx_errors; | ||
4940 | sp->stats.rx_errors += delta; | ||
4941 | dev->stats.rx_errors += delta; | ||
4942 | |||
4943 | delta = ((u64) le32_to_cpu(stats->tmac_any_err_frms_oflow) << 32 | | ||
4944 | le32_to_cpu(stats->tmac_any_err_frms)) - sp->stats.tx_errors; | ||
4945 | sp->stats.tx_errors += delta; | ||
4946 | dev->stats.tx_errors += delta; | ||
4947 | |||
4948 | delta = le64_to_cpu(stats->rmac_drop_frms) - sp->stats.rx_dropped; | ||
4949 | sp->stats.rx_dropped += delta; | ||
4950 | dev->stats.rx_dropped += delta; | ||
4951 | |||
4952 | delta = le64_to_cpu(stats->tmac_drop_frms) - sp->stats.tx_dropped; | ||
4953 | sp->stats.tx_dropped += delta; | ||
4954 | dev->stats.tx_dropped += delta; | ||
4955 | |||
4956 | /* The adapter MAC interprets pause frames as multicast packets, but | ||
4957 | * does not pass them up. This erroneously increases the multicast | ||
4958 | * packet count and needs to be deducted when the multicast frame count | ||
4959 | * is queried. | ||
4960 | */ | ||
4961 | delta = (u64) le32_to_cpu(stats->rmac_vld_mcst_frms_oflow) << 32 | | ||
4962 | le32_to_cpu(stats->rmac_vld_mcst_frms); | ||
4963 | delta -= le64_to_cpu(stats->rmac_pause_ctrl_frms); | ||
4964 | delta -= sp->stats.multicast; | ||
4965 | sp->stats.multicast += delta; | ||
4966 | dev->stats.multicast += delta; | ||
4936 | 4967 | ||
4937 | /* collect per-ring rx_packets and rx_bytes */ | 4968 | delta = ((u64) le32_to_cpu(stats->rmac_usized_frms_oflow) << 32 | |
4938 | dev->stats.rx_packets = dev->stats.rx_bytes = 0; | 4969 | le32_to_cpu(stats->rmac_usized_frms)) + |
4939 | for (i = 0; i < config->rx_ring_num; i++) { | 4970 | le64_to_cpu(stats->rmac_long_frms) - sp->stats.rx_length_errors; |
4940 | struct ring_info *ring = &mac_control->rings[i]; | 4971 | sp->stats.rx_length_errors += delta; |
4972 | dev->stats.rx_length_errors += delta; | ||
4941 | 4973 | ||
4942 | dev->stats.rx_packets += ring->rx_packets; | 4974 | delta = le64_to_cpu(stats->rmac_fcs_err_frms) - sp->stats.rx_crc_errors; |
4943 | dev->stats.rx_bytes += ring->rx_bytes; | 4975 | sp->stats.rx_crc_errors += delta; |
4944 | } | 4976 | dev->stats.rx_crc_errors += delta; |
4945 | 4977 | ||
4946 | return &dev->stats; | 4978 | return &dev->stats; |
4947 | } | 4979 | } |
@@ -7494,15 +7526,11 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp) | |||
7494 | } | 7526 | } |
7495 | } | 7527 | } |
7496 | 7528 | ||
7497 | /* Updating statistics */ | ||
7498 | ring_data->rx_packets++; | ||
7499 | rxdp->Host_Control = 0; | 7529 | rxdp->Host_Control = 0; |
7500 | if (sp->rxd_mode == RXD_MODE_1) { | 7530 | if (sp->rxd_mode == RXD_MODE_1) { |
7501 | int len = RXD_GET_BUFFER0_SIZE_1(rxdp->Control_2); | 7531 | int len = RXD_GET_BUFFER0_SIZE_1(rxdp->Control_2); |
7502 | 7532 | ||
7503 | ring_data->rx_bytes += len; | ||
7504 | skb_put(skb, len); | 7533 | skb_put(skb, len); |
7505 | |||
7506 | } else if (sp->rxd_mode == RXD_MODE_3B) { | 7534 | } else if (sp->rxd_mode == RXD_MODE_3B) { |
7507 | int get_block = ring_data->rx_curr_get_info.block_index; | 7535 | int get_block = ring_data->rx_curr_get_info.block_index; |
7508 | int get_off = ring_data->rx_curr_get_info.offset; | 7536 | int get_off = ring_data->rx_curr_get_info.offset; |
@@ -7511,7 +7539,6 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp) | |||
7511 | unsigned char *buff = skb_push(skb, buf0_len); | 7539 | unsigned char *buff = skb_push(skb, buf0_len); |
7512 | 7540 | ||
7513 | struct buffAdd *ba = &ring_data->ba[get_block][get_off]; | 7541 | struct buffAdd *ba = &ring_data->ba[get_block][get_off]; |
7514 | ring_data->rx_bytes += buf0_len + buf2_len; | ||
7515 | memcpy(buff, ba->ba_0, buf0_len); | 7542 | memcpy(buff, ba->ba_0, buf0_len); |
7516 | skb_put(skb, buf2_len); | 7543 | skb_put(skb, buf2_len); |
7517 | } | 7544 | } |
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 47c36e0994f5..5e52c75892df 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -745,10 +745,6 @@ struct ring_info { | |||
745 | 745 | ||
746 | /* Buffer Address store. */ | 746 | /* Buffer Address store. */ |
747 | struct buffAdd **ba; | 747 | struct buffAdd **ba; |
748 | |||
749 | /* per-Ring statistics */ | ||
750 | unsigned long rx_packets; | ||
751 | unsigned long rx_bytes; | ||
752 | } ____cacheline_aligned; | 748 | } ____cacheline_aligned; |
753 | 749 | ||
754 | /* Fifo specific structure */ | 750 | /* Fifo specific structure */ |
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c index 1f3acc3a5dfd..79eee3062083 100644 --- a/drivers/net/sb1250-mac.c +++ b/drivers/net/sb1250-mac.c | |||
@@ -2671,6 +2671,7 @@ static struct platform_driver sbmac_driver = { | |||
2671 | .remove = __exit_p(sbmac_remove), | 2671 | .remove = __exit_p(sbmac_remove), |
2672 | .driver = { | 2672 | .driver = { |
2673 | .name = sbmac_string, | 2673 | .name = sbmac_string, |
2674 | .owner = THIS_MODULE, | ||
2674 | }, | 2675 | }, |
2675 | }; | 2676 | }; |
2676 | 2677 | ||
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 28d3ee175e7b..dd8a4adf48ca 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -104,10 +104,8 @@ static void rndis_msg_indicate(struct usbnet *dev, struct rndis_indicate *msg, | |||
104 | int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) | 104 | int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) |
105 | { | 105 | { |
106 | struct cdc_state *info = (void *) &dev->data; | 106 | struct cdc_state *info = (void *) &dev->data; |
107 | struct usb_cdc_notification notification; | ||
108 | int master_ifnum; | 107 | int master_ifnum; |
109 | int retval; | 108 | int retval; |
110 | int partial; | ||
111 | unsigned count; | 109 | unsigned count; |
112 | __le32 rsp; | 110 | __le32 rsp; |
113 | u32 xid = 0, msg_len, request_id; | 111 | u32 xid = 0, msg_len, request_id; |
@@ -135,17 +133,13 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) | |||
135 | if (unlikely(retval < 0 || xid == 0)) | 133 | if (unlikely(retval < 0 || xid == 0)) |
136 | return retval; | 134 | return retval; |
137 | 135 | ||
138 | /* Some devices don't respond on the control channel until | 136 | // FIXME Seems like some devices discard responses when |
139 | * polled on the status channel, so do that first. */ | 137 | // we time out and cancel our "get response" requests... |
140 | retval = usb_interrupt_msg( | 138 | // so, this is fragile. Probably need to poll for status. |
141 | dev->udev, | ||
142 | usb_rcvintpipe(dev->udev, dev->status->desc.bEndpointAddress), | ||
143 | ¬ification, sizeof(notification), &partial, | ||
144 | RNDIS_CONTROL_TIMEOUT_MS); | ||
145 | if (unlikely(retval < 0)) | ||
146 | return retval; | ||
147 | 139 | ||
148 | /* Poll the control channel; the request probably completed immediately */ | 140 | /* ignore status endpoint, just poll the control channel; |
141 | * the request probably completed immediately | ||
142 | */ | ||
149 | rsp = buf->msg_type | RNDIS_MSG_COMPLETION; | 143 | rsp = buf->msg_type | RNDIS_MSG_COMPLETION; |
150 | for (count = 0; count < 10; count++) { | 144 | for (count = 0; count < 10; count++) { |
151 | memset(buf, 0, CONTROL_BUFFER_SIZE); | 145 | memset(buf, 0, CONTROL_BUFFER_SIZE); |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 44115eea57f9..7eab4071ea26 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1293,6 +1293,9 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1293 | goto out; | 1293 | goto out; |
1294 | } | 1294 | } |
1295 | 1295 | ||
1296 | /* netdev_printk() needs this so do it as early as possible */ | ||
1297 | SET_NETDEV_DEV(net, &udev->dev); | ||
1298 | |||
1296 | dev = netdev_priv(net); | 1299 | dev = netdev_priv(net); |
1297 | dev->udev = xdev; | 1300 | dev->udev = xdev; |
1298 | dev->intf = udev; | 1301 | dev->intf = udev; |
@@ -1377,8 +1380,6 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1377 | dev->rx_urb_size = dev->hard_mtu; | 1380 | dev->rx_urb_size = dev->hard_mtu; |
1378 | dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1); | 1381 | dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1); |
1379 | 1382 | ||
1380 | SET_NETDEV_DEV(net, &udev->dev); | ||
1381 | |||
1382 | if ((dev->driver_info->flags & FLAG_WLAN) != 0) | 1383 | if ((dev->driver_info->flags & FLAG_WLAN) != 0) |
1383 | SET_NETDEV_DEVTYPE(net, &wlan_type); | 1384 | SET_NETDEV_DEVTYPE(net, &wlan_type); |
1384 | if ((dev->driver_info->flags & FLAG_WWAN) != 0) | 1385 | if ((dev->driver_info->flags & FLAG_WWAN) != 0) |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 1edb7a61983c..bb6b67f6b0cc 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -415,7 +415,7 @@ static int add_recvbuf_mergeable(struct virtnet_info *vi, gfp_t gfp) | |||
415 | static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) | 415 | static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) |
416 | { | 416 | { |
417 | int err; | 417 | int err; |
418 | bool oom = false; | 418 | bool oom; |
419 | 419 | ||
420 | do { | 420 | do { |
421 | if (vi->mergeable_rx_bufs) | 421 | if (vi->mergeable_rx_bufs) |
@@ -425,10 +425,9 @@ static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) | |||
425 | else | 425 | else |
426 | err = add_recvbuf_small(vi, gfp); | 426 | err = add_recvbuf_small(vi, gfp); |
427 | 427 | ||
428 | if (err < 0) { | 428 | oom = err == -ENOMEM; |
429 | oom = true; | 429 | if (err < 0) |
430 | break; | 430 | break; |
431 | } | ||
432 | ++vi->num; | 431 | ++vi->num; |
433 | } while (err > 0); | 432 | } while (err > 0); |
434 | if (unlikely(vi->num > vi->max)) | 433 | if (unlikely(vi->num > vi->max)) |
@@ -563,7 +562,6 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
563 | struct virtnet_info *vi = netdev_priv(dev); | 562 | struct virtnet_info *vi = netdev_priv(dev); |
564 | int capacity; | 563 | int capacity; |
565 | 564 | ||
566 | again: | ||
567 | /* Free up any pending old buffers before queueing new ones. */ | 565 | /* Free up any pending old buffers before queueing new ones. */ |
568 | free_old_xmit_skbs(vi); | 566 | free_old_xmit_skbs(vi); |
569 | 567 | ||
@@ -572,14 +570,20 @@ again: | |||
572 | 570 | ||
573 | /* This can happen with OOM and indirect buffers. */ | 571 | /* This can happen with OOM and indirect buffers. */ |
574 | if (unlikely(capacity < 0)) { | 572 | if (unlikely(capacity < 0)) { |
575 | netif_stop_queue(dev); | 573 | if (net_ratelimit()) { |
576 | dev_warn(&dev->dev, "Unexpected full queue\n"); | 574 | if (likely(capacity == -ENOMEM)) { |
577 | if (unlikely(!virtqueue_enable_cb(vi->svq))) { | 575 | dev_warn(&dev->dev, |
578 | virtqueue_disable_cb(vi->svq); | 576 | "TX queue failure: out of memory\n"); |
579 | netif_start_queue(dev); | 577 | } else { |
580 | goto again; | 578 | dev->stats.tx_fifo_errors++; |
579 | dev_warn(&dev->dev, | ||
580 | "Unexpected TX queue failure: %d\n", | ||
581 | capacity); | ||
582 | } | ||
581 | } | 583 | } |
582 | return NETDEV_TX_BUSY; | 584 | dev->stats.tx_dropped++; |
585 | kfree_skb(skb); | ||
586 | return NETDEV_TX_OK; | ||
583 | } | 587 | } |
584 | virtqueue_kick(vi->svq); | 588 | virtqueue_kick(vi->svq); |
585 | 589 | ||
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c index 45c5dc225631..ed1786598c9e 100644 --- a/drivers/net/vxge/vxge-main.c +++ b/drivers/net/vxge/vxge-main.c | |||
@@ -2262,7 +2262,8 @@ start: | |||
2262 | vxge_debug_init(VXGE_ERR, | 2262 | vxge_debug_init(VXGE_ERR, |
2263 | "%s: memory allocation failed", | 2263 | "%s: memory allocation failed", |
2264 | VXGE_DRIVER_NAME); | 2264 | VXGE_DRIVER_NAME); |
2265 | return -ENOMEM; | 2265 | ret = -ENOMEM; |
2266 | goto alloc_entries_failed; | ||
2266 | } | 2267 | } |
2267 | 2268 | ||
2268 | vdev->vxge_entries = | 2269 | vdev->vxge_entries = |
@@ -2271,8 +2272,8 @@ start: | |||
2271 | if (!vdev->vxge_entries) { | 2272 | if (!vdev->vxge_entries) { |
2272 | vxge_debug_init(VXGE_ERR, "%s: memory allocation failed", | 2273 | vxge_debug_init(VXGE_ERR, "%s: memory allocation failed", |
2273 | VXGE_DRIVER_NAME); | 2274 | VXGE_DRIVER_NAME); |
2274 | kfree(vdev->entries); | 2275 | ret = -ENOMEM; |
2275 | return -ENOMEM; | 2276 | goto alloc_vxge_entries_failed; |
2276 | } | 2277 | } |
2277 | 2278 | ||
2278 | for (i = 0, j = 0; i < vdev->no_of_vpath; i++) { | 2279 | for (i = 0, j = 0; i < vdev->no_of_vpath; i++) { |
@@ -2303,22 +2304,32 @@ start: | |||
2303 | vxge_debug_init(VXGE_ERR, | 2304 | vxge_debug_init(VXGE_ERR, |
2304 | "%s: MSI-X enable failed for %d vectors, ret: %d", | 2305 | "%s: MSI-X enable failed for %d vectors, ret: %d", |
2305 | VXGE_DRIVER_NAME, vdev->intr_cnt, ret); | 2306 | VXGE_DRIVER_NAME, vdev->intr_cnt, ret); |
2307 | if ((max_config_vpath != VXGE_USE_DEFAULT) || (ret < 3)) { | ||
2308 | ret = -ENODEV; | ||
2309 | goto enable_msix_failed; | ||
2310 | } | ||
2311 | |||
2306 | kfree(vdev->entries); | 2312 | kfree(vdev->entries); |
2307 | kfree(vdev->vxge_entries); | 2313 | kfree(vdev->vxge_entries); |
2308 | vdev->entries = NULL; | 2314 | vdev->entries = NULL; |
2309 | vdev->vxge_entries = NULL; | 2315 | vdev->vxge_entries = NULL; |
2310 | |||
2311 | if ((max_config_vpath != VXGE_USE_DEFAULT) || (ret < 3)) | ||
2312 | return -ENODEV; | ||
2313 | /* Try with less no of vector by reducing no of vpaths count */ | 2316 | /* Try with less no of vector by reducing no of vpaths count */ |
2314 | temp = (ret - 1)/2; | 2317 | temp = (ret - 1)/2; |
2315 | vxge_close_vpaths(vdev, temp); | 2318 | vxge_close_vpaths(vdev, temp); |
2316 | vdev->no_of_vpath = temp; | 2319 | vdev->no_of_vpath = temp; |
2317 | goto start; | 2320 | goto start; |
2318 | } else if (ret < 0) | 2321 | } else if (ret < 0) { |
2319 | return -ENODEV; | 2322 | ret = -ENODEV; |
2320 | 2323 | goto enable_msix_failed; | |
2324 | } | ||
2321 | return 0; | 2325 | return 0; |
2326 | |||
2327 | enable_msix_failed: | ||
2328 | kfree(vdev->vxge_entries); | ||
2329 | alloc_vxge_entries_failed: | ||
2330 | kfree(vdev->entries); | ||
2331 | alloc_entries_failed: | ||
2332 | return ret; | ||
2322 | } | 2333 | } |
2323 | 2334 | ||
2324 | static int vxge_enable_msix(struct vxgedev *vdev) | 2335 | static int vxge_enable_msix(struct vxgedev *vdev) |
@@ -4515,9 +4526,9 @@ vxge_starter(void) | |||
4515 | char version[32]; | 4526 | char version[32]; |
4516 | snprintf(version, 32, "%s", DRV_VERSION); | 4527 | snprintf(version, 32, "%s", DRV_VERSION); |
4517 | 4528 | ||
4518 | printk(KERN_CRIT "%s: Copyright(c) 2002-2009 Neterion Inc\n", | 4529 | printk(KERN_INFO "%s: Copyright(c) 2002-2009 Neterion Inc\n", |
4519 | VXGE_DRIVER_NAME); | 4530 | VXGE_DRIVER_NAME); |
4520 | printk(KERN_CRIT "%s: Driver version: %s\n", | 4531 | printk(KERN_INFO "%s: Driver version: %s\n", |
4521 | VXGE_DRIVER_NAME, version); | 4532 | VXGE_DRIVER_NAME, version); |
4522 | 4533 | ||
4523 | verify_bandwidth(); | 4534 | verify_bandwidth(); |