diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-28 08:58:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-28 08:58:19 -0400 |
commit | d5eab9152a3b4ce962c02ad0a0e4d0ec94aadd92 (patch) | |
tree | 3147f8de2805da0f026ea18103a9be46f3bc2a18 | |
parent | 6140333d3656f62ac7e6a5af87e7fe92cfb8d655 (diff) | |
parent | a051294423b015c5c89f2ed78f7fe0893b775098 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (32 commits)
tg3: Remove 5719 jumbo frames and TSO blocks
tg3: Break larger frags into 4k chunks for 5719
tg3: Add tx BD budgeting code
tg3: Consolidate code that calls tg3_tx_set_bd()
tg3: Add partial fragment unmapping code
tg3: Generalize tg3_skb_error_unmap()
tg3: Remove short DMA check for 1st fragment
tg3: Simplify tx bd assignments
tg3: Reintroduce tg3_tx_ring_info
ASIX: Use only 11 bits of header for data size
ASIX: Simplify condition in rx_fixup()
Fix cdc-phonet build
bonding: reduce noise during init
bonding: fix string comparison errors
net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
net: add IFF_SKB_TX_SHARED flag to priv_flags
net: sock_sendmsg_nosec() is static
forcedeth: fix vlans
gianfar: fix bug caused by 87c288c6e9aa31720b72e2bc2d665e24e1653c3e
gro: Only reset frag0 when skb can be pulled
...
36 files changed, 358 insertions, 245 deletions
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index 48e9cc0369b1..1f73d7f7e024 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c | |||
@@ -2532,6 +2532,9 @@ static void _isdn_setup(struct net_device *dev) | |||
2532 | 2532 | ||
2533 | /* Setup the generic properties */ | 2533 | /* Setup the generic properties */ |
2534 | dev->flags = IFF_NOARP|IFF_POINTOPOINT; | 2534 | dev->flags = IFF_NOARP|IFF_POINTOPOINT; |
2535 | |||
2536 | /* isdn prepends a header in the tx path, can't share skbs */ | ||
2537 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; | ||
2535 | dev->header_ops = NULL; | 2538 | dev->header_ops = NULL; |
2536 | dev->netdev_ops = &isdn_netdev_ops; | 2539 | dev->netdev_ops = &isdn_netdev_ops; |
2537 | 2540 | ||
diff --git a/drivers/net/Makefile b/drivers/net/Makefile index b7622c3745fa..e1eca2ab505e 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile | |||
@@ -282,6 +282,7 @@ obj-$(CONFIG_USB_HSO) += usb/ | |||
282 | obj-$(CONFIG_USB_USBNET) += usb/ | 282 | obj-$(CONFIG_USB_USBNET) += usb/ |
283 | obj-$(CONFIG_USB_ZD1201) += usb/ | 283 | obj-$(CONFIG_USB_ZD1201) += usb/ |
284 | obj-$(CONFIG_USB_IPHETH) += usb/ | 284 | obj-$(CONFIG_USB_IPHETH) += usb/ |
285 | obj-$(CONFIG_USB_CDC_PHONET) += usb/ | ||
285 | 286 | ||
286 | obj-$(CONFIG_WLAN) += wireless/ | 287 | obj-$(CONFIG_WLAN) += wireless/ |
287 | obj-$(CONFIG_NET_TULIP) += tulip/ | 288 | obj-$(CONFIG_NET_TULIP) += tulip/ |
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 536038b22710..31798f5f5d06 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c | |||
@@ -1502,13 +1502,13 @@ static int __devinit ace_init(struct net_device *dev) | |||
1502 | * firmware to wipe the ring without re-initializing it. | 1502 | * firmware to wipe the ring without re-initializing it. |
1503 | */ | 1503 | */ |
1504 | if (!test_and_set_bit(0, &ap->std_refill_busy)) | 1504 | if (!test_and_set_bit(0, &ap->std_refill_busy)) |
1505 | ace_load_std_rx_ring(ap, RX_RING_SIZE); | 1505 | ace_load_std_rx_ring(dev, RX_RING_SIZE); |
1506 | else | 1506 | else |
1507 | printk(KERN_ERR "%s: Someone is busy refilling the RX ring\n", | 1507 | printk(KERN_ERR "%s: Someone is busy refilling the RX ring\n", |
1508 | ap->name); | 1508 | ap->name); |
1509 | if (ap->version >= 2) { | 1509 | if (ap->version >= 2) { |
1510 | if (!test_and_set_bit(0, &ap->mini_refill_busy)) | 1510 | if (!test_and_set_bit(0, &ap->mini_refill_busy)) |
1511 | ace_load_mini_rx_ring(ap, RX_MINI_SIZE); | 1511 | ace_load_mini_rx_ring(dev, RX_MINI_SIZE); |
1512 | else | 1512 | else |
1513 | printk(KERN_ERR "%s: Someone is busy refilling " | 1513 | printk(KERN_ERR "%s: Someone is busy refilling " |
1514 | "the RX mini ring\n", ap->name); | 1514 | "the RX mini ring\n", ap->name); |
@@ -1584,9 +1584,10 @@ static void ace_watchdog(struct net_device *data) | |||
1584 | } | 1584 | } |
1585 | 1585 | ||
1586 | 1586 | ||
1587 | static void ace_tasklet(unsigned long dev) | 1587 | static void ace_tasklet(unsigned long arg) |
1588 | { | 1588 | { |
1589 | struct ace_private *ap = netdev_priv((struct net_device *)dev); | 1589 | struct net_device *dev = (struct net_device *) arg; |
1590 | struct ace_private *ap = netdev_priv(dev); | ||
1590 | int cur_size; | 1591 | int cur_size; |
1591 | 1592 | ||
1592 | cur_size = atomic_read(&ap->cur_rx_bufs); | 1593 | cur_size = atomic_read(&ap->cur_rx_bufs); |
@@ -1595,7 +1596,7 @@ static void ace_tasklet(unsigned long dev) | |||
1595 | #ifdef DEBUG | 1596 | #ifdef DEBUG |
1596 | printk("refilling buffers (current %i)\n", cur_size); | 1597 | printk("refilling buffers (current %i)\n", cur_size); |
1597 | #endif | 1598 | #endif |
1598 | ace_load_std_rx_ring(ap, RX_RING_SIZE - cur_size); | 1599 | ace_load_std_rx_ring(dev, RX_RING_SIZE - cur_size); |
1599 | } | 1600 | } |
1600 | 1601 | ||
1601 | if (ap->version >= 2) { | 1602 | if (ap->version >= 2) { |
@@ -1606,7 +1607,7 @@ static void ace_tasklet(unsigned long dev) | |||
1606 | printk("refilling mini buffers (current %i)\n", | 1607 | printk("refilling mini buffers (current %i)\n", |
1607 | cur_size); | 1608 | cur_size); |
1608 | #endif | 1609 | #endif |
1609 | ace_load_mini_rx_ring(ap, RX_MINI_SIZE - cur_size); | 1610 | ace_load_mini_rx_ring(dev, RX_MINI_SIZE - cur_size); |
1610 | } | 1611 | } |
1611 | } | 1612 | } |
1612 | 1613 | ||
@@ -1616,7 +1617,7 @@ static void ace_tasklet(unsigned long dev) | |||
1616 | #ifdef DEBUG | 1617 | #ifdef DEBUG |
1617 | printk("refilling jumbo buffers (current %i)\n", cur_size); | 1618 | printk("refilling jumbo buffers (current %i)\n", cur_size); |
1618 | #endif | 1619 | #endif |
1619 | ace_load_jumbo_rx_ring(ap, RX_JUMBO_SIZE - cur_size); | 1620 | ace_load_jumbo_rx_ring(dev, RX_JUMBO_SIZE - cur_size); |
1620 | } | 1621 | } |
1621 | ap->tasklet_pending = 0; | 1622 | ap->tasklet_pending = 0; |
1622 | } | 1623 | } |
@@ -1642,8 +1643,9 @@ static void ace_dump_trace(struct ace_private *ap) | |||
1642 | * done only before the device is enabled, thus no interrupts are | 1643 | * done only before the device is enabled, thus no interrupts are |
1643 | * generated and by the interrupt handler/tasklet handler. | 1644 | * generated and by the interrupt handler/tasklet handler. |
1644 | */ | 1645 | */ |
1645 | static void ace_load_std_rx_ring(struct ace_private *ap, int nr_bufs) | 1646 | static void ace_load_std_rx_ring(struct net_device *dev, int nr_bufs) |
1646 | { | 1647 | { |
1648 | struct ace_private *ap = netdev_priv(dev); | ||
1647 | struct ace_regs __iomem *regs = ap->regs; | 1649 | struct ace_regs __iomem *regs = ap->regs; |
1648 | short i, idx; | 1650 | short i, idx; |
1649 | 1651 | ||
@@ -1657,11 +1659,10 @@ static void ace_load_std_rx_ring(struct ace_private *ap, int nr_bufs) | |||
1657 | struct rx_desc *rd; | 1659 | struct rx_desc *rd; |
1658 | dma_addr_t mapping; | 1660 | dma_addr_t mapping; |
1659 | 1661 | ||
1660 | skb = dev_alloc_skb(ACE_STD_BUFSIZE + NET_IP_ALIGN); | 1662 | skb = netdev_alloc_skb_ip_align(dev, ACE_STD_BUFSIZE); |
1661 | if (!skb) | 1663 | if (!skb) |
1662 | break; | 1664 | break; |
1663 | 1665 | ||
1664 | skb_reserve(skb, NET_IP_ALIGN); | ||
1665 | mapping = pci_map_page(ap->pdev, virt_to_page(skb->data), | 1666 | mapping = pci_map_page(ap->pdev, virt_to_page(skb->data), |
1666 | offset_in_page(skb->data), | 1667 | offset_in_page(skb->data), |
1667 | ACE_STD_BUFSIZE, | 1668 | ACE_STD_BUFSIZE, |
@@ -1705,8 +1706,9 @@ static void ace_load_std_rx_ring(struct ace_private *ap, int nr_bufs) | |||
1705 | } | 1706 | } |
1706 | 1707 | ||
1707 | 1708 | ||
1708 | static void ace_load_mini_rx_ring(struct ace_private *ap, int nr_bufs) | 1709 | static void ace_load_mini_rx_ring(struct net_device *dev, int nr_bufs) |
1709 | { | 1710 | { |
1711 | struct ace_private *ap = netdev_priv(dev); | ||
1710 | struct ace_regs __iomem *regs = ap->regs; | 1712 | struct ace_regs __iomem *regs = ap->regs; |
1711 | short i, idx; | 1713 | short i, idx; |
1712 | 1714 | ||
@@ -1718,11 +1720,10 @@ static void ace_load_mini_rx_ring(struct ace_private *ap, int nr_bufs) | |||
1718 | struct rx_desc *rd; | 1720 | struct rx_desc *rd; |
1719 | dma_addr_t mapping; | 1721 | dma_addr_t mapping; |
1720 | 1722 | ||
1721 | skb = dev_alloc_skb(ACE_MINI_BUFSIZE + NET_IP_ALIGN); | 1723 | skb = netdev_alloc_skb_ip_align(dev, ACE_MINI_BUFSIZE); |
1722 | if (!skb) | 1724 | if (!skb) |
1723 | break; | 1725 | break; |
1724 | 1726 | ||
1725 | skb_reserve(skb, NET_IP_ALIGN); | ||
1726 | mapping = pci_map_page(ap->pdev, virt_to_page(skb->data), | 1727 | mapping = pci_map_page(ap->pdev, virt_to_page(skb->data), |
1727 | offset_in_page(skb->data), | 1728 | offset_in_page(skb->data), |
1728 | ACE_MINI_BUFSIZE, | 1729 | ACE_MINI_BUFSIZE, |
@@ -1762,8 +1763,9 @@ static void ace_load_mini_rx_ring(struct ace_private *ap, int nr_bufs) | |||
1762 | * Load the jumbo rx ring, this may happen at any time if the MTU | 1763 | * Load the jumbo rx ring, this may happen at any time if the MTU |
1763 | * is changed to a value > 1500. | 1764 | * is changed to a value > 1500. |
1764 | */ | 1765 | */ |
1765 | static void ace_load_jumbo_rx_ring(struct ace_private *ap, int nr_bufs) | 1766 | static void ace_load_jumbo_rx_ring(struct net_device *dev, int nr_bufs) |
1766 | { | 1767 | { |
1768 | struct ace_private *ap = netdev_priv(dev); | ||
1767 | struct ace_regs __iomem *regs = ap->regs; | 1769 | struct ace_regs __iomem *regs = ap->regs; |
1768 | short i, idx; | 1770 | short i, idx; |
1769 | 1771 | ||
@@ -1774,11 +1776,10 @@ static void ace_load_jumbo_rx_ring(struct ace_private *ap, int nr_bufs) | |||
1774 | struct rx_desc *rd; | 1776 | struct rx_desc *rd; |
1775 | dma_addr_t mapping; | 1777 | dma_addr_t mapping; |
1776 | 1778 | ||
1777 | skb = dev_alloc_skb(ACE_JUMBO_BUFSIZE + NET_IP_ALIGN); | 1779 | skb = netdev_alloc_skb_ip_align(dev, ACE_JUMBO_BUFSIZE); |
1778 | if (!skb) | 1780 | if (!skb) |
1779 | break; | 1781 | break; |
1780 | 1782 | ||
1781 | skb_reserve(skb, NET_IP_ALIGN); | ||
1782 | mapping = pci_map_page(ap->pdev, virt_to_page(skb->data), | 1783 | mapping = pci_map_page(ap->pdev, virt_to_page(skb->data), |
1783 | offset_in_page(skb->data), | 1784 | offset_in_page(skb->data), |
1784 | ACE_JUMBO_BUFSIZE, | 1785 | ACE_JUMBO_BUFSIZE, |
@@ -2196,7 +2197,7 @@ static irqreturn_t ace_interrupt(int irq, void *dev_id) | |||
2196 | #ifdef DEBUG | 2197 | #ifdef DEBUG |
2197 | printk("low on std buffers %i\n", cur_size); | 2198 | printk("low on std buffers %i\n", cur_size); |
2198 | #endif | 2199 | #endif |
2199 | ace_load_std_rx_ring(ap, | 2200 | ace_load_std_rx_ring(dev, |
2200 | RX_RING_SIZE - cur_size); | 2201 | RX_RING_SIZE - cur_size); |
2201 | } else | 2202 | } else |
2202 | run_tasklet = 1; | 2203 | run_tasklet = 1; |
@@ -2212,7 +2213,8 @@ static irqreturn_t ace_interrupt(int irq, void *dev_id) | |||
2212 | printk("low on mini buffers %i\n", | 2213 | printk("low on mini buffers %i\n", |
2213 | cur_size); | 2214 | cur_size); |
2214 | #endif | 2215 | #endif |
2215 | ace_load_mini_rx_ring(ap, RX_MINI_SIZE - cur_size); | 2216 | ace_load_mini_rx_ring(dev, |
2217 | RX_MINI_SIZE - cur_size); | ||
2216 | } else | 2218 | } else |
2217 | run_tasklet = 1; | 2219 | run_tasklet = 1; |
2218 | } | 2220 | } |
@@ -2228,7 +2230,8 @@ static irqreturn_t ace_interrupt(int irq, void *dev_id) | |||
2228 | printk("low on jumbo buffers %i\n", | 2230 | printk("low on jumbo buffers %i\n", |
2229 | cur_size); | 2231 | cur_size); |
2230 | #endif | 2232 | #endif |
2231 | ace_load_jumbo_rx_ring(ap, RX_JUMBO_SIZE - cur_size); | 2233 | ace_load_jumbo_rx_ring(dev, |
2234 | RX_JUMBO_SIZE - cur_size); | ||
2232 | } else | 2235 | } else |
2233 | run_tasklet = 1; | 2236 | run_tasklet = 1; |
2234 | } | 2237 | } |
@@ -2267,7 +2270,7 @@ static int ace_open(struct net_device *dev) | |||
2267 | 2270 | ||
2268 | if (ap->jumbo && | 2271 | if (ap->jumbo && |
2269 | !test_and_set_bit(0, &ap->jumbo_refill_busy)) | 2272 | !test_and_set_bit(0, &ap->jumbo_refill_busy)) |
2270 | ace_load_jumbo_rx_ring(ap, RX_JUMBO_SIZE); | 2273 | ace_load_jumbo_rx_ring(dev, RX_JUMBO_SIZE); |
2271 | 2274 | ||
2272 | if (dev->flags & IFF_PROMISC) { | 2275 | if (dev->flags & IFF_PROMISC) { |
2273 | cmd.evt = C_SET_PROMISC_MODE; | 2276 | cmd.evt = C_SET_PROMISC_MODE; |
@@ -2575,7 +2578,7 @@ static int ace_change_mtu(struct net_device *dev, int new_mtu) | |||
2575 | "support\n", dev->name); | 2578 | "support\n", dev->name); |
2576 | ap->jumbo = 1; | 2579 | ap->jumbo = 1; |
2577 | if (!test_and_set_bit(0, &ap->jumbo_refill_busy)) | 2580 | if (!test_and_set_bit(0, &ap->jumbo_refill_busy)) |
2578 | ace_load_jumbo_rx_ring(ap, RX_JUMBO_SIZE); | 2581 | ace_load_jumbo_rx_ring(dev, RX_JUMBO_SIZE); |
2579 | ace_set_rxtx_parms(dev, 1); | 2582 | ace_set_rxtx_parms(dev, 1); |
2580 | } | 2583 | } |
2581 | } else { | 2584 | } else { |
diff --git a/drivers/net/acenic.h b/drivers/net/acenic.h index f67dc9b0eb80..51c486cfbb8c 100644 --- a/drivers/net/acenic.h +++ b/drivers/net/acenic.h | |||
@@ -766,9 +766,9 @@ static inline void ace_unmask_irq(struct net_device *dev) | |||
766 | * Prototypes | 766 | * Prototypes |
767 | */ | 767 | */ |
768 | static int ace_init(struct net_device *dev); | 768 | static int ace_init(struct net_device *dev); |
769 | static void ace_load_std_rx_ring(struct ace_private *ap, int nr_bufs); | 769 | static void ace_load_std_rx_ring(struct net_device *dev, int nr_bufs); |
770 | static void ace_load_mini_rx_ring(struct ace_private *ap, int nr_bufs); | 770 | static void ace_load_mini_rx_ring(struct net_device *dev, int nr_bufs); |
771 | static void ace_load_jumbo_rx_ring(struct ace_private *ap, int nr_bufs); | 771 | static void ace_load_jumbo_rx_ring(struct net_device *dev, int nr_bufs); |
772 | static irqreturn_t ace_interrupt(int irq, void *dev_id); | 772 | static irqreturn_t ace_interrupt(int irq, void *dev_id); |
773 | static int ace_load_firmware(struct net_device *dev); | 773 | static int ace_load_firmware(struct net_device *dev); |
774 | static int ace_open(struct net_device *dev); | 774 | static int ace_open(struct net_device *dev); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 02842d05c11f..38a83acd502e 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1557,8 +1557,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1557 | 1557 | ||
1558 | if (slave_dev->type != ARPHRD_ETHER) | 1558 | if (slave_dev->type != ARPHRD_ETHER) |
1559 | bond_setup_by_slave(bond_dev, slave_dev); | 1559 | bond_setup_by_slave(bond_dev, slave_dev); |
1560 | else | 1560 | else { |
1561 | ether_setup(bond_dev); | 1561 | ether_setup(bond_dev); |
1562 | bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING; | ||
1563 | } | ||
1562 | 1564 | ||
1563 | netdev_bonding_change(bond_dev, | 1565 | netdev_bonding_change(bond_dev, |
1564 | NETDEV_POST_TYPE_CHANGE); | 1566 | NETDEV_POST_TYPE_CHANGE); |
@@ -4330,7 +4332,7 @@ static void bond_setup(struct net_device *bond_dev) | |||
4330 | bond_dev->tx_queue_len = 0; | 4332 | bond_dev->tx_queue_len = 0; |
4331 | bond_dev->flags |= IFF_MASTER|IFF_MULTICAST; | 4333 | bond_dev->flags |= IFF_MASTER|IFF_MULTICAST; |
4332 | bond_dev->priv_flags |= IFF_BONDING; | 4334 | bond_dev->priv_flags |= IFF_BONDING; |
4333 | bond_dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; | 4335 | bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING); |
4334 | 4336 | ||
4335 | /* At first, we block adding VLANs. That's the only way to | 4337 | /* At first, we block adding VLANs. That's the only way to |
4336 | * prevent problems that occur when adding VLANs over an | 4338 | * prevent problems that occur when adding VLANs over an |
@@ -4691,7 +4693,7 @@ static int bond_check_params(struct bond_params *params) | |||
4691 | /* miimon and arp_interval not set, we need one so things | 4693 | /* miimon and arp_interval not set, we need one so things |
4692 | * work as expected, see bonding.txt for details | 4694 | * work as expected, see bonding.txt for details |
4693 | */ | 4695 | */ |
4694 | pr_warning("Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.\n"); | 4696 | pr_debug("Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.\n"); |
4695 | } | 4697 | } |
4696 | 4698 | ||
4697 | if (primary && !USES_PRIMARY(bond_mode)) { | 4699 | if (primary && !USES_PRIMARY(bond_mode)) { |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index b60835f58650..2dfb4bf90087 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -1025,6 +1025,7 @@ static ssize_t bonding_store_primary(struct device *d, | |||
1025 | int i; | 1025 | int i; |
1026 | struct slave *slave; | 1026 | struct slave *slave; |
1027 | struct bonding *bond = to_bond(d); | 1027 | struct bonding *bond = to_bond(d); |
1028 | char ifname[IFNAMSIZ]; | ||
1028 | 1029 | ||
1029 | if (!rtnl_trylock()) | 1030 | if (!rtnl_trylock()) |
1030 | return restart_syscall(); | 1031 | return restart_syscall(); |
@@ -1035,32 +1036,33 @@ static ssize_t bonding_store_primary(struct device *d, | |||
1035 | if (!USES_PRIMARY(bond->params.mode)) { | 1036 | if (!USES_PRIMARY(bond->params.mode)) { |
1036 | pr_info("%s: Unable to set primary slave; %s is in mode %d\n", | 1037 | pr_info("%s: Unable to set primary slave; %s is in mode %d\n", |
1037 | bond->dev->name, bond->dev->name, bond->params.mode); | 1038 | bond->dev->name, bond->dev->name, bond->params.mode); |
1038 | } else { | 1039 | goto out; |
1039 | bond_for_each_slave(bond, slave, i) { | 1040 | } |
1040 | if (strnicmp | ||
1041 | (slave->dev->name, buf, | ||
1042 | strlen(slave->dev->name)) == 0) { | ||
1043 | pr_info("%s: Setting %s as primary slave.\n", | ||
1044 | bond->dev->name, slave->dev->name); | ||
1045 | bond->primary_slave = slave; | ||
1046 | strcpy(bond->params.primary, slave->dev->name); | ||
1047 | bond_select_active_slave(bond); | ||
1048 | goto out; | ||
1049 | } | ||
1050 | } | ||
1051 | 1041 | ||
1052 | /* if we got here, then we didn't match the name of any slave */ | 1042 | sscanf(buf, "%16s", ifname); /* IFNAMSIZ */ |
1053 | 1043 | ||
1054 | if (strlen(buf) == 0 || buf[0] == '\n') { | 1044 | /* check to see if we are clearing primary */ |
1055 | pr_info("%s: Setting primary slave to None.\n", | 1045 | if (!strlen(ifname) || buf[0] == '\n') { |
1056 | bond->dev->name); | 1046 | pr_info("%s: Setting primary slave to None.\n", |
1057 | bond->primary_slave = NULL; | 1047 | bond->dev->name); |
1058 | bond_select_active_slave(bond); | 1048 | bond->primary_slave = NULL; |
1059 | } else { | 1049 | bond_select_active_slave(bond); |
1060 | pr_info("%s: Unable to set %.*s as primary slave as it is not a slave.\n", | 1050 | goto out; |
1061 | bond->dev->name, (int)strlen(buf) - 1, buf); | 1051 | } |
1052 | |||
1053 | bond_for_each_slave(bond, slave, i) { | ||
1054 | if (strncmp(slave->dev->name, ifname, IFNAMSIZ) == 0) { | ||
1055 | pr_info("%s: Setting %s as primary slave.\n", | ||
1056 | bond->dev->name, slave->dev->name); | ||
1057 | bond->primary_slave = slave; | ||
1058 | strcpy(bond->params.primary, slave->dev->name); | ||
1059 | bond_select_active_slave(bond); | ||
1060 | goto out; | ||
1062 | } | 1061 | } |
1063 | } | 1062 | } |
1063 | |||
1064 | pr_info("%s: Unable to set %.*s as primary slave.\n", | ||
1065 | bond->dev->name, (int)strlen(buf) - 1, buf); | ||
1064 | out: | 1066 | out: |
1065 | write_unlock_bh(&bond->curr_slave_lock); | 1067 | write_unlock_bh(&bond->curr_slave_lock); |
1066 | read_unlock(&bond->lock); | 1068 | read_unlock(&bond->lock); |
@@ -1195,6 +1197,7 @@ static ssize_t bonding_store_active_slave(struct device *d, | |||
1195 | struct slave *old_active = NULL; | 1197 | struct slave *old_active = NULL; |
1196 | struct slave *new_active = NULL; | 1198 | struct slave *new_active = NULL; |
1197 | struct bonding *bond = to_bond(d); | 1199 | struct bonding *bond = to_bond(d); |
1200 | char ifname[IFNAMSIZ]; | ||
1198 | 1201 | ||
1199 | if (!rtnl_trylock()) | 1202 | if (!rtnl_trylock()) |
1200 | return restart_syscall(); | 1203 | return restart_syscall(); |
@@ -1203,56 +1206,62 @@ static ssize_t bonding_store_active_slave(struct device *d, | |||
1203 | read_lock(&bond->lock); | 1206 | read_lock(&bond->lock); |
1204 | write_lock_bh(&bond->curr_slave_lock); | 1207 | write_lock_bh(&bond->curr_slave_lock); |
1205 | 1208 | ||
1206 | if (!USES_PRIMARY(bond->params.mode)) | 1209 | if (!USES_PRIMARY(bond->params.mode)) { |
1207 | pr_info("%s: Unable to change active slave; %s is in mode %d\n", | 1210 | pr_info("%s: Unable to change active slave; %s is in mode %d\n", |
1208 | bond->dev->name, bond->dev->name, bond->params.mode); | 1211 | bond->dev->name, bond->dev->name, bond->params.mode); |
1209 | else { | 1212 | goto out; |
1210 | bond_for_each_slave(bond, slave, i) { | 1213 | } |
1211 | if (strnicmp | 1214 | |
1212 | (slave->dev->name, buf, | 1215 | sscanf(buf, "%16s", ifname); /* IFNAMSIZ */ |
1213 | strlen(slave->dev->name)) == 0) { | 1216 | |
1214 | old_active = bond->curr_active_slave; | 1217 | /* check to see if we are clearing active */ |
1215 | new_active = slave; | 1218 | if (!strlen(ifname) || buf[0] == '\n') { |
1216 | if (new_active == old_active) { | 1219 | pr_info("%s: Clearing current active slave.\n", |
1217 | /* do nothing */ | 1220 | bond->dev->name); |
1218 | pr_info("%s: %s is already the current active slave.\n", | 1221 | bond->curr_active_slave = NULL; |
1222 | bond_select_active_slave(bond); | ||
1223 | goto out; | ||
1224 | } | ||
1225 | |||
1226 | bond_for_each_slave(bond, slave, i) { | ||
1227 | if (strncmp(slave->dev->name, ifname, IFNAMSIZ) == 0) { | ||
1228 | old_active = bond->curr_active_slave; | ||
1229 | new_active = slave; | ||
1230 | if (new_active == old_active) { | ||
1231 | /* do nothing */ | ||
1232 | pr_info("%s: %s is already the current" | ||
1233 | " active slave.\n", | ||
1234 | bond->dev->name, | ||
1235 | slave->dev->name); | ||
1236 | goto out; | ||
1237 | } | ||
1238 | else { | ||
1239 | if ((new_active) && | ||
1240 | (old_active) && | ||
1241 | (new_active->link == BOND_LINK_UP) && | ||
1242 | IS_UP(new_active->dev)) { | ||
1243 | pr_info("%s: Setting %s as active" | ||
1244 | " slave.\n", | ||
1219 | bond->dev->name, | 1245 | bond->dev->name, |
1220 | slave->dev->name); | 1246 | slave->dev->name); |
1221 | goto out; | 1247 | bond_change_active_slave(bond, |
1248 | new_active); | ||
1222 | } | 1249 | } |
1223 | else { | 1250 | else { |
1224 | if ((new_active) && | 1251 | pr_info("%s: Could not set %s as" |
1225 | (old_active) && | 1252 | " active slave; either %s is" |
1226 | (new_active->link == BOND_LINK_UP) && | 1253 | " down or the link is down.\n", |
1227 | IS_UP(new_active->dev)) { | 1254 | bond->dev->name, |
1228 | pr_info("%s: Setting %s as active slave.\n", | 1255 | slave->dev->name, |
1229 | bond->dev->name, | 1256 | slave->dev->name); |
1230 | slave->dev->name); | ||
1231 | bond_change_active_slave(bond, new_active); | ||
1232 | } | ||
1233 | else { | ||
1234 | pr_info("%s: Could not set %s as active slave; either %s is down or the link is down.\n", | ||
1235 | bond->dev->name, | ||
1236 | slave->dev->name, | ||
1237 | slave->dev->name); | ||
1238 | } | ||
1239 | goto out; | ||
1240 | } | 1257 | } |
1258 | goto out; | ||
1241 | } | 1259 | } |
1242 | } | 1260 | } |
1243 | |||
1244 | /* if we got here, then we didn't match the name of any slave */ | ||
1245 | |||
1246 | if (strlen(buf) == 0 || buf[0] == '\n') { | ||
1247 | pr_info("%s: Setting active slave to None.\n", | ||
1248 | bond->dev->name); | ||
1249 | bond->primary_slave = NULL; | ||
1250 | bond_select_active_slave(bond); | ||
1251 | } else { | ||
1252 | pr_info("%s: Unable to set %.*s as active slave as it is not a slave.\n", | ||
1253 | bond->dev->name, (int)strlen(buf) - 1, buf); | ||
1254 | } | ||
1255 | } | 1261 | } |
1262 | |||
1263 | pr_info("%s: Unable to set %.*s as active slave.\n", | ||
1264 | bond->dev->name, (int)strlen(buf) - 1, buf); | ||
1256 | out: | 1265 | out: |
1257 | write_unlock_bh(&bond->curr_slave_lock); | 1266 | write_unlock_bh(&bond->curr_slave_lock); |
1258 | read_unlock(&bond->lock); | 1267 | read_unlock(&bond->lock); |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index e64cd9ceac3f..e55df308a3af 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -2764,7 +2764,14 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit) | |||
2764 | prefetch(skb->data); | 2764 | prefetch(skb->data); |
2765 | 2765 | ||
2766 | vlanflags = le32_to_cpu(np->get_rx.ex->buflow); | 2766 | vlanflags = le32_to_cpu(np->get_rx.ex->buflow); |
2767 | if (vlanflags & NV_RX3_VLAN_TAG_PRESENT) { | 2767 | |
2768 | /* | ||
2769 | * There's need to check for NETIF_F_HW_VLAN_RX here. | ||
2770 | * Even if vlan rx accel is disabled, | ||
2771 | * NV_RX3_VLAN_TAG_PRESENT is pseudo randomly set. | ||
2772 | */ | ||
2773 | if (dev->features & NETIF_F_HW_VLAN_RX && | ||
2774 | vlanflags & NV_RX3_VLAN_TAG_PRESENT) { | ||
2768 | u16 vid = vlanflags & NV_RX3_VLAN_TAG_MASK; | 2775 | u16 vid = vlanflags & NV_RX3_VLAN_TAG_MASK; |
2769 | 2776 | ||
2770 | __vlan_hwaccel_put_tag(skb, vid); | 2777 | __vlan_hwaccel_put_tag(skb, vid); |
@@ -5331,15 +5338,16 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
5331 | np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK; | 5338 | np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK; |
5332 | dev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_SG | | 5339 | dev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_SG | |
5333 | NETIF_F_TSO | NETIF_F_RXCSUM; | 5340 | NETIF_F_TSO | NETIF_F_RXCSUM; |
5334 | dev->features |= dev->hw_features; | ||
5335 | } | 5341 | } |
5336 | 5342 | ||
5337 | np->vlanctl_bits = 0; | 5343 | np->vlanctl_bits = 0; |
5338 | if (id->driver_data & DEV_HAS_VLAN) { | 5344 | if (id->driver_data & DEV_HAS_VLAN) { |
5339 | np->vlanctl_bits = NVREG_VLANCONTROL_ENABLE; | 5345 | np->vlanctl_bits = NVREG_VLANCONTROL_ENABLE; |
5340 | dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX; | 5346 | dev->hw_features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX; |
5341 | } | 5347 | } |
5342 | 5348 | ||
5349 | dev->features |= dev->hw_features; | ||
5350 | |||
5343 | np->pause_flags = NV_PAUSEFRAME_RX_CAPABLE | NV_PAUSEFRAME_RX_REQ | NV_PAUSEFRAME_AUTONEG; | 5351 | np->pause_flags = NV_PAUSEFRAME_RX_CAPABLE | NV_PAUSEFRAME_RX_REQ | NV_PAUSEFRAME_AUTONEG; |
5344 | if ((id->driver_data & DEV_HAS_PAUSEFRAME_TX_V1) || | 5352 | if ((id->driver_data & DEV_HAS_PAUSEFRAME_TX_V1) || |
5345 | (id->driver_data & DEV_HAS_PAUSEFRAME_TX_V2) || | 5353 | (id->driver_data & DEV_HAS_PAUSEFRAME_TX_V2) || |
@@ -5607,6 +5615,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
5607 | goto out_error; | 5615 | goto out_error; |
5608 | } | 5616 | } |
5609 | 5617 | ||
5618 | nv_vlan_mode(dev, dev->features); | ||
5619 | |||
5610 | netif_carrier_off(dev); | 5620 | netif_carrier_off(dev); |
5611 | 5621 | ||
5612 | dev_info(&pci_dev->dev, "ifname %s, PHY OUI 0x%x @ %d, addr %pM\n", | 5622 | dev_info(&pci_dev->dev, "ifname %s, PHY OUI 0x%x @ %d, addr %pM\n", |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 835cd2588148..2659daad783d 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -388,12 +388,8 @@ static void gfar_init_mac(struct net_device *ndev) | |||
388 | if (priv->hwts_rx_en) | 388 | if (priv->hwts_rx_en) |
389 | rctrl |= RCTRL_PRSDEP_INIT | RCTRL_TS_ENABLE; | 389 | rctrl |= RCTRL_PRSDEP_INIT | RCTRL_TS_ENABLE; |
390 | 390 | ||
391 | /* keep vlan related bits if it's enabled */ | ||
392 | if (ndev->features & NETIF_F_HW_VLAN_TX) | ||
393 | rctrl |= RCTRL_VLEX | RCTRL_PRSDEP_INIT; | ||
394 | |||
395 | if (ndev->features & NETIF_F_HW_VLAN_RX) | 391 | if (ndev->features & NETIF_F_HW_VLAN_RX) |
396 | tctrl |= TCTRL_VLINS; | 392 | rctrl |= RCTRL_VLEX | RCTRL_PRSDEP_INIT; |
397 | 393 | ||
398 | /* Init rctrl based on our settings */ | 394 | /* Init rctrl based on our settings */ |
399 | gfar_write(®s->rctrl, rctrl); | 395 | gfar_write(®s->rctrl, rctrl); |
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index 6e82dd32e806..46b5f5fd686b 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c | |||
@@ -183,7 +183,7 @@ static void ifb_setup(struct net_device *dev) | |||
183 | 183 | ||
184 | dev->flags |= IFF_NOARP; | 184 | dev->flags |= IFF_NOARP; |
185 | dev->flags &= ~IFF_MULTICAST; | 185 | dev->flags &= ~IFF_MULTICAST; |
186 | dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; | 186 | dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING); |
187 | random_ether_addr(dev->dev_addr); | 187 | random_ether_addr(dev->dev_addr); |
188 | } | 188 | } |
189 | 189 | ||
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index ba631fcece34..05172c39a0ce 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -572,7 +572,7 @@ void macvlan_common_setup(struct net_device *dev) | |||
572 | { | 572 | { |
573 | ether_setup(dev); | 573 | ether_setup(dev); |
574 | 574 | ||
575 | dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; | 575 | dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING); |
576 | dev->netdev_ops = &macvlan_netdev_ops; | 576 | dev->netdev_ops = &macvlan_netdev_ops; |
577 | dev->destructor = free_netdev; | 577 | dev->destructor = free_netdev; |
578 | dev->header_ops = &macvlan_hard_header_ops, | 578 | dev->header_ops = &macvlan_hard_header_ops, |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 803576568154..dc3fbf61910b 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -190,6 +190,7 @@ static inline void _tg3_flag_clear(enum TG3_FLAGS flag, unsigned long *bits) | |||
190 | 190 | ||
191 | /* minimum number of free TX descriptors required to wake up TX process */ | 191 | /* minimum number of free TX descriptors required to wake up TX process */ |
192 | #define TG3_TX_WAKEUP_THRESH(tnapi) ((tnapi)->tx_pending / 4) | 192 | #define TG3_TX_WAKEUP_THRESH(tnapi) ((tnapi)->tx_pending / 4) |
193 | #define TG3_TX_BD_DMA_MAX 4096 | ||
193 | 194 | ||
194 | #define TG3_RAW_IP_ALIGN 2 | 195 | #define TG3_RAW_IP_ALIGN 2 |
195 | 196 | ||
@@ -4824,7 +4825,7 @@ static void tg3_tx(struct tg3_napi *tnapi) | |||
4824 | txq = netdev_get_tx_queue(tp->dev, index); | 4825 | txq = netdev_get_tx_queue(tp->dev, index); |
4825 | 4826 | ||
4826 | while (sw_idx != hw_idx) { | 4827 | while (sw_idx != hw_idx) { |
4827 | struct ring_info *ri = &tnapi->tx_buffers[sw_idx]; | 4828 | struct tg3_tx_ring_info *ri = &tnapi->tx_buffers[sw_idx]; |
4828 | struct sk_buff *skb = ri->skb; | 4829 | struct sk_buff *skb = ri->skb; |
4829 | int i, tx_bug = 0; | 4830 | int i, tx_bug = 0; |
4830 | 4831 | ||
@@ -4840,6 +4841,12 @@ static void tg3_tx(struct tg3_napi *tnapi) | |||
4840 | 4841 | ||
4841 | ri->skb = NULL; | 4842 | ri->skb = NULL; |
4842 | 4843 | ||
4844 | while (ri->fragmented) { | ||
4845 | ri->fragmented = false; | ||
4846 | sw_idx = NEXT_TX(sw_idx); | ||
4847 | ri = &tnapi->tx_buffers[sw_idx]; | ||
4848 | } | ||
4849 | |||
4843 | sw_idx = NEXT_TX(sw_idx); | 4850 | sw_idx = NEXT_TX(sw_idx); |
4844 | 4851 | ||
4845 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | 4852 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { |
@@ -4851,6 +4858,13 @@ static void tg3_tx(struct tg3_napi *tnapi) | |||
4851 | dma_unmap_addr(ri, mapping), | 4858 | dma_unmap_addr(ri, mapping), |
4852 | skb_shinfo(skb)->frags[i].size, | 4859 | skb_shinfo(skb)->frags[i].size, |
4853 | PCI_DMA_TODEVICE); | 4860 | PCI_DMA_TODEVICE); |
4861 | |||
4862 | while (ri->fragmented) { | ||
4863 | ri->fragmented = false; | ||
4864 | sw_idx = NEXT_TX(sw_idx); | ||
4865 | ri = &tnapi->tx_buffers[sw_idx]; | ||
4866 | } | ||
4867 | |||
4854 | sw_idx = NEXT_TX(sw_idx); | 4868 | sw_idx = NEXT_TX(sw_idx); |
4855 | } | 4869 | } |
4856 | 4870 | ||
@@ -5901,40 +5915,100 @@ static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping, | |||
5901 | #endif | 5915 | #endif |
5902 | } | 5916 | } |
5903 | 5917 | ||
5904 | static void tg3_set_txd(struct tg3_napi *tnapi, int entry, | 5918 | static inline void tg3_tx_set_bd(struct tg3_tx_buffer_desc *txbd, |
5905 | dma_addr_t mapping, int len, u32 flags, | 5919 | dma_addr_t mapping, u32 len, u32 flags, |
5906 | u32 mss_and_is_end) | 5920 | u32 mss, u32 vlan) |
5921 | { | ||
5922 | txbd->addr_hi = ((u64) mapping >> 32); | ||
5923 | txbd->addr_lo = ((u64) mapping & 0xffffffff); | ||
5924 | txbd->len_flags = (len << TXD_LEN_SHIFT) | (flags & 0x0000ffff); | ||
5925 | txbd->vlan_tag = (mss << TXD_MSS_SHIFT) | (vlan << TXD_VLAN_TAG_SHIFT); | ||
5926 | } | ||
5927 | |||
5928 | static bool tg3_tx_frag_set(struct tg3_napi *tnapi, u32 *entry, u32 *budget, | ||
5929 | dma_addr_t map, u32 len, u32 flags, | ||
5930 | u32 mss, u32 vlan) | ||
5907 | { | 5931 | { |
5908 | struct tg3_tx_buffer_desc *txd = &tnapi->tx_ring[entry]; | 5932 | struct tg3 *tp = tnapi->tp; |
5909 | int is_end = (mss_and_is_end & 0x1); | 5933 | bool hwbug = false; |
5910 | u32 mss = (mss_and_is_end >> 1); | 5934 | |
5911 | u32 vlan_tag = 0; | 5935 | if (tg3_flag(tp, SHORT_DMA_BUG) && len <= 8) |
5936 | hwbug = 1; | ||
5937 | |||
5938 | if (tg3_4g_overflow_test(map, len)) | ||
5939 | hwbug = 1; | ||
5940 | |||
5941 | if (tg3_40bit_overflow_test(tp, map, len)) | ||
5942 | hwbug = 1; | ||
5943 | |||
5944 | if (tg3_flag(tp, 4K_FIFO_LIMIT)) { | ||
5945 | u32 tmp_flag = flags & ~TXD_FLAG_END; | ||
5946 | while (len > TG3_TX_BD_DMA_MAX) { | ||
5947 | u32 frag_len = TG3_TX_BD_DMA_MAX; | ||
5948 | len -= TG3_TX_BD_DMA_MAX; | ||
5949 | |||
5950 | if (len) { | ||
5951 | tnapi->tx_buffers[*entry].fragmented = true; | ||
5952 | /* Avoid the 8byte DMA problem */ | ||
5953 | if (len <= 8) { | ||
5954 | len += TG3_TX_BD_DMA_MAX / 2; | ||
5955 | frag_len = TG3_TX_BD_DMA_MAX / 2; | ||
5956 | } | ||
5957 | } else | ||
5958 | tmp_flag = flags; | ||
5959 | |||
5960 | if (*budget) { | ||
5961 | tg3_tx_set_bd(&tnapi->tx_ring[*entry], map, | ||
5962 | frag_len, tmp_flag, mss, vlan); | ||
5963 | (*budget)--; | ||
5964 | *entry = NEXT_TX(*entry); | ||
5965 | } else { | ||
5966 | hwbug = 1; | ||
5967 | break; | ||
5968 | } | ||
5969 | |||
5970 | map += frag_len; | ||
5971 | } | ||
5912 | 5972 | ||
5913 | if (is_end) | 5973 | if (len) { |
5914 | flags |= TXD_FLAG_END; | 5974 | if (*budget) { |
5915 | if (flags & TXD_FLAG_VLAN) { | 5975 | tg3_tx_set_bd(&tnapi->tx_ring[*entry], map, |
5916 | vlan_tag = flags >> 16; | 5976 | len, flags, mss, vlan); |
5917 | flags &= 0xffff; | 5977 | (*budget)--; |
5978 | *entry = NEXT_TX(*entry); | ||
5979 | } else { | ||
5980 | hwbug = 1; | ||
5981 | } | ||
5982 | } | ||
5983 | } else { | ||
5984 | tg3_tx_set_bd(&tnapi->tx_ring[*entry], map, | ||
5985 | len, flags, mss, vlan); | ||
5986 | *entry = NEXT_TX(*entry); | ||
5918 | } | 5987 | } |
5919 | vlan_tag |= (mss << TXD_MSS_SHIFT); | ||
5920 | 5988 | ||
5921 | txd->addr_hi = ((u64) mapping >> 32); | 5989 | return hwbug; |
5922 | txd->addr_lo = ((u64) mapping & 0xffffffff); | ||
5923 | txd->len_flags = (len << TXD_LEN_SHIFT) | flags; | ||
5924 | txd->vlan_tag = vlan_tag << TXD_VLAN_TAG_SHIFT; | ||
5925 | } | 5990 | } |
5926 | 5991 | ||
5927 | static void tg3_skb_error_unmap(struct tg3_napi *tnapi, | 5992 | static void tg3_tx_skb_unmap(struct tg3_napi *tnapi, u32 entry, int last) |
5928 | struct sk_buff *skb, int last) | ||
5929 | { | 5993 | { |
5930 | int i; | 5994 | int i; |
5931 | u32 entry = tnapi->tx_prod; | 5995 | struct sk_buff *skb; |
5932 | struct ring_info *txb = &tnapi->tx_buffers[entry]; | 5996 | struct tg3_tx_ring_info *txb = &tnapi->tx_buffers[entry]; |
5997 | |||
5998 | skb = txb->skb; | ||
5999 | txb->skb = NULL; | ||
5933 | 6000 | ||
5934 | pci_unmap_single(tnapi->tp->pdev, | 6001 | pci_unmap_single(tnapi->tp->pdev, |
5935 | dma_unmap_addr(txb, mapping), | 6002 | dma_unmap_addr(txb, mapping), |
5936 | skb_headlen(skb), | 6003 | skb_headlen(skb), |
5937 | PCI_DMA_TODEVICE); | 6004 | PCI_DMA_TODEVICE); |
6005 | |||
6006 | while (txb->fragmented) { | ||
6007 | txb->fragmented = false; | ||
6008 | entry = NEXT_TX(entry); | ||
6009 | txb = &tnapi->tx_buffers[entry]; | ||
6010 | } | ||
6011 | |||
5938 | for (i = 0; i < last; i++) { | 6012 | for (i = 0; i < last; i++) { |
5939 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; | 6013 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
5940 | 6014 | ||
@@ -5944,18 +6018,24 @@ static void tg3_skb_error_unmap(struct tg3_napi *tnapi, | |||
5944 | pci_unmap_page(tnapi->tp->pdev, | 6018 | pci_unmap_page(tnapi->tp->pdev, |
5945 | dma_unmap_addr(txb, mapping), | 6019 | dma_unmap_addr(txb, mapping), |
5946 | frag->size, PCI_DMA_TODEVICE); | 6020 | frag->size, PCI_DMA_TODEVICE); |
6021 | |||
6022 | while (txb->fragmented) { | ||
6023 | txb->fragmented = false; | ||
6024 | entry = NEXT_TX(entry); | ||
6025 | txb = &tnapi->tx_buffers[entry]; | ||
6026 | } | ||
5947 | } | 6027 | } |
5948 | } | 6028 | } |
5949 | 6029 | ||
5950 | /* Workaround 4GB and 40-bit hardware DMA bugs. */ | 6030 | /* Workaround 4GB and 40-bit hardware DMA bugs. */ |
5951 | static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, | 6031 | static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, |
5952 | struct sk_buff *skb, | 6032 | struct sk_buff *skb, |
5953 | u32 base_flags, u32 mss) | 6033 | u32 *entry, u32 *budget, |
6034 | u32 base_flags, u32 mss, u32 vlan) | ||
5954 | { | 6035 | { |
5955 | struct tg3 *tp = tnapi->tp; | 6036 | struct tg3 *tp = tnapi->tp; |
5956 | struct sk_buff *new_skb; | 6037 | struct sk_buff *new_skb; |
5957 | dma_addr_t new_addr = 0; | 6038 | dma_addr_t new_addr = 0; |
5958 | u32 entry = tnapi->tx_prod; | ||
5959 | int ret = 0; | 6039 | int ret = 0; |
5960 | 6040 | ||
5961 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) | 6041 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) |
@@ -5976,24 +6056,22 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, | |||
5976 | PCI_DMA_TODEVICE); | 6056 | PCI_DMA_TODEVICE); |
5977 | /* Make sure the mapping succeeded */ | 6057 | /* Make sure the mapping succeeded */ |
5978 | if (pci_dma_mapping_error(tp->pdev, new_addr)) { | 6058 | if (pci_dma_mapping_error(tp->pdev, new_addr)) { |
5979 | ret = -1; | ||
5980 | dev_kfree_skb(new_skb); | 6059 | dev_kfree_skb(new_skb); |
5981 | |||
5982 | /* Make sure new skb does not cross any 4G boundaries. | ||
5983 | * Drop the packet if it does. | ||
5984 | */ | ||
5985 | } else if (tg3_4g_overflow_test(new_addr, new_skb->len)) { | ||
5986 | pci_unmap_single(tp->pdev, new_addr, new_skb->len, | ||
5987 | PCI_DMA_TODEVICE); | ||
5988 | ret = -1; | 6060 | ret = -1; |
5989 | dev_kfree_skb(new_skb); | ||
5990 | } else { | 6061 | } else { |
5991 | tnapi->tx_buffers[entry].skb = new_skb; | 6062 | base_flags |= TXD_FLAG_END; |
5992 | dma_unmap_addr_set(&tnapi->tx_buffers[entry], | 6063 | |
6064 | tnapi->tx_buffers[*entry].skb = new_skb; | ||
6065 | dma_unmap_addr_set(&tnapi->tx_buffers[*entry], | ||
5993 | mapping, new_addr); | 6066 | mapping, new_addr); |
5994 | 6067 | ||
5995 | tg3_set_txd(tnapi, entry, new_addr, new_skb->len, | 6068 | if (tg3_tx_frag_set(tnapi, entry, budget, new_addr, |
5996 | base_flags, 1 | (mss << 1)); | 6069 | new_skb->len, base_flags, |
6070 | mss, vlan)) { | ||
6071 | tg3_tx_skb_unmap(tnapi, *entry, 0); | ||
6072 | dev_kfree_skb(new_skb); | ||
6073 | ret = -1; | ||
6074 | } | ||
5997 | } | 6075 | } |
5998 | } | 6076 | } |
5999 | 6077 | ||
@@ -6051,7 +6129,8 @@ tg3_tso_bug_end: | |||
6051 | static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | 6129 | static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) |
6052 | { | 6130 | { |
6053 | struct tg3 *tp = netdev_priv(dev); | 6131 | struct tg3 *tp = netdev_priv(dev); |
6054 | u32 len, entry, base_flags, mss; | 6132 | u32 len, entry, base_flags, mss, vlan = 0; |
6133 | u32 budget; | ||
6055 | int i = -1, would_hit_hwbug; | 6134 | int i = -1, would_hit_hwbug; |
6056 | dma_addr_t mapping; | 6135 | dma_addr_t mapping; |
6057 | struct tg3_napi *tnapi; | 6136 | struct tg3_napi *tnapi; |
@@ -6063,12 +6142,14 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
6063 | if (tg3_flag(tp, ENABLE_TSS)) | 6142 | if (tg3_flag(tp, ENABLE_TSS)) |
6064 | tnapi++; | 6143 | tnapi++; |
6065 | 6144 | ||
6145 | budget = tg3_tx_avail(tnapi); | ||
6146 | |||
6066 | /* We are running in BH disabled context with netif_tx_lock | 6147 | /* We are running in BH disabled context with netif_tx_lock |
6067 | * and TX reclaim runs via tp->napi.poll inside of a software | 6148 | * and TX reclaim runs via tp->napi.poll inside of a software |
6068 | * interrupt. Furthermore, IRQ processing runs lockless so we have | 6149 | * interrupt. Furthermore, IRQ processing runs lockless so we have |
6069 | * no IRQ context deadlocks to worry about either. Rejoice! | 6150 | * no IRQ context deadlocks to worry about either. Rejoice! |
6070 | */ | 6151 | */ |
6071 | if (unlikely(tg3_tx_avail(tnapi) <= (skb_shinfo(skb)->nr_frags + 1))) { | 6152 | if (unlikely(budget <= (skb_shinfo(skb)->nr_frags + 1))) { |
6072 | if (!netif_tx_queue_stopped(txq)) { | 6153 | if (!netif_tx_queue_stopped(txq)) { |
6073 | netif_tx_stop_queue(txq); | 6154 | netif_tx_stop_queue(txq); |
6074 | 6155 | ||
@@ -6153,9 +6234,12 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
6153 | } | 6234 | } |
6154 | } | 6235 | } |
6155 | 6236 | ||
6156 | if (vlan_tx_tag_present(skb)) | 6237 | #ifdef BCM_KERNEL_SUPPORTS_8021Q |
6157 | base_flags |= (TXD_FLAG_VLAN | | 6238 | if (vlan_tx_tag_present(skb)) { |
6158 | (vlan_tx_tag_get(skb) << 16)); | 6239 | base_flags |= TXD_FLAG_VLAN; |
6240 | vlan = vlan_tx_tag_get(skb); | ||
6241 | } | ||
6242 | #endif | ||
6159 | 6243 | ||
6160 | if (tg3_flag(tp, USE_JUMBO_BDFLAG) && | 6244 | if (tg3_flag(tp, USE_JUMBO_BDFLAG) && |
6161 | !mss && skb->len > VLAN_ETH_FRAME_LEN) | 6245 | !mss && skb->len > VLAN_ETH_FRAME_LEN) |
@@ -6174,25 +6258,23 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
6174 | 6258 | ||
6175 | would_hit_hwbug = 0; | 6259 | would_hit_hwbug = 0; |
6176 | 6260 | ||
6177 | if (tg3_flag(tp, SHORT_DMA_BUG) && len <= 8) | ||
6178 | would_hit_hwbug = 1; | ||
6179 | |||
6180 | if (tg3_4g_overflow_test(mapping, len)) | ||
6181 | would_hit_hwbug = 1; | ||
6182 | |||
6183 | if (tg3_40bit_overflow_test(tp, mapping, len)) | ||
6184 | would_hit_hwbug = 1; | ||
6185 | |||
6186 | if (tg3_flag(tp, 5701_DMA_BUG)) | 6261 | if (tg3_flag(tp, 5701_DMA_BUG)) |
6187 | would_hit_hwbug = 1; | 6262 | would_hit_hwbug = 1; |
6188 | 6263 | ||
6189 | tg3_set_txd(tnapi, entry, mapping, len, base_flags, | 6264 | if (tg3_tx_frag_set(tnapi, &entry, &budget, mapping, len, base_flags | |
6190 | (skb_shinfo(skb)->nr_frags == 0) | (mss << 1)); | 6265 | ((skb_shinfo(skb)->nr_frags == 0) ? TXD_FLAG_END : 0), |
6191 | 6266 | mss, vlan)) | |
6192 | entry = NEXT_TX(entry); | 6267 | would_hit_hwbug = 1; |
6193 | 6268 | ||
6194 | /* Now loop through additional data fragments, and queue them. */ | 6269 | /* Now loop through additional data fragments, and queue them. */ |
6195 | if (skb_shinfo(skb)->nr_frags > 0) { | 6270 | if (skb_shinfo(skb)->nr_frags > 0) { |
6271 | u32 tmp_mss = mss; | ||
6272 | |||
6273 | if (!tg3_flag(tp, HW_TSO_1) && | ||
6274 | !tg3_flag(tp, HW_TSO_2) && | ||
6275 | !tg3_flag(tp, HW_TSO_3)) | ||
6276 | tmp_mss = 0; | ||
6277 | |||
6196 | last = skb_shinfo(skb)->nr_frags - 1; | 6278 | last = skb_shinfo(skb)->nr_frags - 1; |
6197 | for (i = 0; i <= last; i++) { | 6279 | for (i = 0; i <= last; i++) { |
6198 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; | 6280 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
@@ -6209,39 +6291,25 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
6209 | if (pci_dma_mapping_error(tp->pdev, mapping)) | 6291 | if (pci_dma_mapping_error(tp->pdev, mapping)) |
6210 | goto dma_error; | 6292 | goto dma_error; |
6211 | 6293 | ||
6212 | if (tg3_flag(tp, SHORT_DMA_BUG) && | 6294 | if (tg3_tx_frag_set(tnapi, &entry, &budget, mapping, |
6213 | len <= 8) | 6295 | len, base_flags | |
6296 | ((i == last) ? TXD_FLAG_END : 0), | ||
6297 | tmp_mss, vlan)) | ||
6214 | would_hit_hwbug = 1; | 6298 | would_hit_hwbug = 1; |
6215 | |||
6216 | if (tg3_4g_overflow_test(mapping, len)) | ||
6217 | would_hit_hwbug = 1; | ||
6218 | |||
6219 | if (tg3_40bit_overflow_test(tp, mapping, len)) | ||
6220 | would_hit_hwbug = 1; | ||
6221 | |||
6222 | if (tg3_flag(tp, HW_TSO_1) || | ||
6223 | tg3_flag(tp, HW_TSO_2) || | ||
6224 | tg3_flag(tp, HW_TSO_3)) | ||
6225 | tg3_set_txd(tnapi, entry, mapping, len, | ||
6226 | base_flags, (i == last)|(mss << 1)); | ||
6227 | else | ||
6228 | tg3_set_txd(tnapi, entry, mapping, len, | ||
6229 | base_flags, (i == last)); | ||
6230 | |||
6231 | entry = NEXT_TX(entry); | ||
6232 | } | 6299 | } |
6233 | } | 6300 | } |
6234 | 6301 | ||
6235 | if (would_hit_hwbug) { | 6302 | if (would_hit_hwbug) { |
6236 | tg3_skb_error_unmap(tnapi, skb, i); | 6303 | tg3_tx_skb_unmap(tnapi, tnapi->tx_prod, i); |
6237 | 6304 | ||
6238 | /* If the workaround fails due to memory/mapping | 6305 | /* If the workaround fails due to memory/mapping |
6239 | * failure, silently drop this packet. | 6306 | * failure, silently drop this packet. |
6240 | */ | 6307 | */ |
6241 | if (tigon3_dma_hwbug_workaround(tnapi, skb, base_flags, mss)) | 6308 | entry = tnapi->tx_prod; |
6309 | budget = tg3_tx_avail(tnapi); | ||
6310 | if (tigon3_dma_hwbug_workaround(tnapi, skb, &entry, &budget, | ||
6311 | base_flags, mss, vlan)) | ||
6242 | goto out_unlock; | 6312 | goto out_unlock; |
6243 | |||
6244 | entry = NEXT_TX(tnapi->tx_prod); | ||
6245 | } | 6313 | } |
6246 | 6314 | ||
6247 | skb_tx_timestamp(skb); | 6315 | skb_tx_timestamp(skb); |
@@ -6269,7 +6337,7 @@ out_unlock: | |||
6269 | return NETDEV_TX_OK; | 6337 | return NETDEV_TX_OK; |
6270 | 6338 | ||
6271 | dma_error: | 6339 | dma_error: |
6272 | tg3_skb_error_unmap(tnapi, skb, i); | 6340 | tg3_tx_skb_unmap(tnapi, tnapi->tx_prod, i); |
6273 | dev_kfree_skb(skb); | 6341 | dev_kfree_skb(skb); |
6274 | tnapi->tx_buffers[tnapi->tx_prod].skb = NULL; | 6342 | tnapi->tx_buffers[tnapi->tx_prod].skb = NULL; |
6275 | return NETDEV_TX_OK; | 6343 | return NETDEV_TX_OK; |
@@ -6602,35 +6670,13 @@ static void tg3_free_rings(struct tg3 *tp) | |||
6602 | if (!tnapi->tx_buffers) | 6670 | if (!tnapi->tx_buffers) |
6603 | continue; | 6671 | continue; |
6604 | 6672 | ||
6605 | for (i = 0; i < TG3_TX_RING_SIZE; ) { | 6673 | for (i = 0; i < TG3_TX_RING_SIZE; i++) { |
6606 | struct ring_info *txp; | 6674 | struct sk_buff *skb = tnapi->tx_buffers[i].skb; |
6607 | struct sk_buff *skb; | ||
6608 | unsigned int k; | ||
6609 | |||
6610 | txp = &tnapi->tx_buffers[i]; | ||
6611 | skb = txp->skb; | ||
6612 | 6675 | ||
6613 | if (skb == NULL) { | 6676 | if (!skb) |
6614 | i++; | ||
6615 | continue; | 6677 | continue; |
6616 | } | ||
6617 | |||
6618 | pci_unmap_single(tp->pdev, | ||
6619 | dma_unmap_addr(txp, mapping), | ||
6620 | skb_headlen(skb), | ||
6621 | PCI_DMA_TODEVICE); | ||
6622 | txp->skb = NULL; | ||
6623 | 6678 | ||
6624 | i++; | 6679 | tg3_tx_skb_unmap(tnapi, i, skb_shinfo(skb)->nr_frags); |
6625 | |||
6626 | for (k = 0; k < skb_shinfo(skb)->nr_frags; k++) { | ||
6627 | txp = &tnapi->tx_buffers[i & (TG3_TX_RING_SIZE - 1)]; | ||
6628 | pci_unmap_page(tp->pdev, | ||
6629 | dma_unmap_addr(txp, mapping), | ||
6630 | skb_shinfo(skb)->frags[k].size, | ||
6631 | PCI_DMA_TODEVICE); | ||
6632 | i++; | ||
6633 | } | ||
6634 | 6680 | ||
6635 | dev_kfree_skb_any(skb); | 6681 | dev_kfree_skb_any(skb); |
6636 | } | 6682 | } |
@@ -6762,9 +6808,9 @@ static int tg3_alloc_consistent(struct tg3 *tp) | |||
6762 | */ | 6808 | */ |
6763 | if ((!i && !tg3_flag(tp, ENABLE_TSS)) || | 6809 | if ((!i && !tg3_flag(tp, ENABLE_TSS)) || |
6764 | (i && tg3_flag(tp, ENABLE_TSS))) { | 6810 | (i && tg3_flag(tp, ENABLE_TSS))) { |
6765 | tnapi->tx_buffers = kzalloc(sizeof(struct ring_info) * | 6811 | tnapi->tx_buffers = kzalloc( |
6766 | TG3_TX_RING_SIZE, | 6812 | sizeof(struct tg3_tx_ring_info) * |
6767 | GFP_KERNEL); | 6813 | TG3_TX_RING_SIZE, GFP_KERNEL); |
6768 | if (!tnapi->tx_buffers) | 6814 | if (!tnapi->tx_buffers) |
6769 | goto err_out; | 6815 | goto err_out; |
6770 | 6816 | ||
@@ -8360,7 +8406,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
8360 | /* Program the jumbo buffer descriptor ring control | 8406 | /* Program the jumbo buffer descriptor ring control |
8361 | * blocks on those devices that have them. | 8407 | * blocks on those devices that have them. |
8362 | */ | 8408 | */ |
8363 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | 8409 | if (tp->pci_chip_rev_id == CHIPREV_ID_5719_A0 || |
8364 | (tg3_flag(tp, JUMBO_CAPABLE) && !tg3_flag(tp, 5780_CLASS))) { | 8410 | (tg3_flag(tp, JUMBO_CAPABLE) && !tg3_flag(tp, 5780_CLASS))) { |
8365 | 8411 | ||
8366 | if (tg3_flag(tp, JUMBO_RING_ENABLE)) { | 8412 | if (tg3_flag(tp, JUMBO_RING_ENABLE)) { |
@@ -11204,6 +11250,7 @@ static int tg3_run_loopback(struct tg3 *tp, u32 pktsz, int loopback_mode) | |||
11204 | { | 11250 | { |
11205 | u32 mac_mode, rx_start_idx, rx_idx, tx_idx, opaque_key; | 11251 | u32 mac_mode, rx_start_idx, rx_idx, tx_idx, opaque_key; |
11206 | u32 base_flags = 0, mss = 0, desc_idx, coal_now, data_off, val; | 11252 | u32 base_flags = 0, mss = 0, desc_idx, coal_now, data_off, val; |
11253 | u32 budget; | ||
11207 | struct sk_buff *skb, *rx_skb; | 11254 | struct sk_buff *skb, *rx_skb; |
11208 | u8 *tx_data; | 11255 | u8 *tx_data; |
11209 | dma_addr_t map; | 11256 | dma_addr_t map; |
@@ -11363,6 +11410,10 @@ static int tg3_run_loopback(struct tg3 *tp, u32 pktsz, int loopback_mode) | |||
11363 | return -EIO; | 11410 | return -EIO; |
11364 | } | 11411 | } |
11365 | 11412 | ||
11413 | val = tnapi->tx_prod; | ||
11414 | tnapi->tx_buffers[val].skb = skb; | ||
11415 | dma_unmap_addr_set(&tnapi->tx_buffers[val], mapping, map); | ||
11416 | |||
11366 | tw32_f(HOSTCC_MODE, tp->coalesce_mode | HOSTCC_MODE_ENABLE | | 11417 | tw32_f(HOSTCC_MODE, tp->coalesce_mode | HOSTCC_MODE_ENABLE | |
11367 | rnapi->coal_now); | 11418 | rnapi->coal_now); |
11368 | 11419 | ||
@@ -11370,8 +11421,13 @@ static int tg3_run_loopback(struct tg3 *tp, u32 pktsz, int loopback_mode) | |||
11370 | 11421 | ||
11371 | rx_start_idx = rnapi->hw_status->idx[0].rx_producer; | 11422 | rx_start_idx = rnapi->hw_status->idx[0].rx_producer; |
11372 | 11423 | ||
11373 | tg3_set_txd(tnapi, tnapi->tx_prod, map, tx_len, | 11424 | budget = tg3_tx_avail(tnapi); |
11374 | base_flags, (mss << 1) | 1); | 11425 | if (tg3_tx_frag_set(tnapi, &val, &budget, map, tx_len, |
11426 | base_flags | TXD_FLAG_END, mss, 0)) { | ||
11427 | tnapi->tx_buffers[val].skb = NULL; | ||
11428 | dev_kfree_skb(skb); | ||
11429 | return -EIO; | ||
11430 | } | ||
11375 | 11431 | ||
11376 | tnapi->tx_prod++; | 11432 | tnapi->tx_prod++; |
11377 | 11433 | ||
@@ -11394,7 +11450,7 @@ static int tg3_run_loopback(struct tg3 *tp, u32 pktsz, int loopback_mode) | |||
11394 | break; | 11450 | break; |
11395 | } | 11451 | } |
11396 | 11452 | ||
11397 | pci_unmap_single(tp->pdev, map, tx_len, PCI_DMA_TODEVICE); | 11453 | tg3_tx_skb_unmap(tnapi, tnapi->tx_prod - 1, 0); |
11398 | dev_kfree_skb(skb); | 11454 | dev_kfree_skb(skb); |
11399 | 11455 | ||
11400 | if (tx_idx != tnapi->tx_prod) | 11456 | if (tx_idx != tnapi->tx_prod) |
@@ -13817,7 +13873,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13817 | tg3_flag_set(tp, 5705_PLUS); | 13873 | tg3_flag_set(tp, 5705_PLUS); |
13818 | 13874 | ||
13819 | /* Determine TSO capabilities */ | 13875 | /* Determine TSO capabilities */ |
13820 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) | 13876 | if (tp->pci_chip_rev_id == CHIPREV_ID_5719_A0) |
13821 | ; /* Do nothing. HW bug. */ | 13877 | ; /* Do nothing. HW bug. */ |
13822 | else if (tg3_flag(tp, 57765_PLUS)) | 13878 | else if (tg3_flag(tp, 57765_PLUS)) |
13823 | tg3_flag_set(tp, HW_TSO_3); | 13879 | tg3_flag_set(tp, HW_TSO_3); |
@@ -13880,11 +13936,14 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13880 | if (tg3_flag(tp, 5755_PLUS)) | 13936 | if (tg3_flag(tp, 5755_PLUS)) |
13881 | tg3_flag_set(tp, SHORT_DMA_BUG); | 13937 | tg3_flag_set(tp, SHORT_DMA_BUG); |
13882 | 13938 | ||
13939 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) | ||
13940 | tg3_flag_set(tp, 4K_FIFO_LIMIT); | ||
13941 | |||
13883 | if (tg3_flag(tp, 5717_PLUS)) | 13942 | if (tg3_flag(tp, 5717_PLUS)) |
13884 | tg3_flag_set(tp, LRG_PROD_RING_CAP); | 13943 | tg3_flag_set(tp, LRG_PROD_RING_CAP); |
13885 | 13944 | ||
13886 | if (tg3_flag(tp, 57765_PLUS) && | 13945 | if (tg3_flag(tp, 57765_PLUS) && |
13887 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719) | 13946 | tp->pci_chip_rev_id != CHIPREV_ID_5719_A0) |
13888 | tg3_flag_set(tp, USE_JUMBO_BDFLAG); | 13947 | tg3_flag_set(tp, USE_JUMBO_BDFLAG); |
13889 | 13948 | ||
13890 | if (!tg3_flag(tp, 5705_PLUS) || | 13949 | if (!tg3_flag(tp, 5705_PLUS) || |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index 691539ba17b3..2ea456dd5880 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -2652,6 +2652,12 @@ struct ring_info { | |||
2652 | DEFINE_DMA_UNMAP_ADDR(mapping); | 2652 | DEFINE_DMA_UNMAP_ADDR(mapping); |
2653 | }; | 2653 | }; |
2654 | 2654 | ||
2655 | struct tg3_tx_ring_info { | ||
2656 | struct sk_buff *skb; | ||
2657 | DEFINE_DMA_UNMAP_ADDR(mapping); | ||
2658 | bool fragmented; | ||
2659 | }; | ||
2660 | |||
2655 | struct tg3_link_config { | 2661 | struct tg3_link_config { |
2656 | /* Describes what we're trying to get. */ | 2662 | /* Describes what we're trying to get. */ |
2657 | u32 advertising; | 2663 | u32 advertising; |
@@ -2816,7 +2822,7 @@ struct tg3_napi { | |||
2816 | u32 last_tx_cons; | 2822 | u32 last_tx_cons; |
2817 | u32 prodmbox; | 2823 | u32 prodmbox; |
2818 | struct tg3_tx_buffer_desc *tx_ring; | 2824 | struct tg3_tx_buffer_desc *tx_ring; |
2819 | struct ring_info *tx_buffers; | 2825 | struct tg3_tx_ring_info *tx_buffers; |
2820 | 2826 | ||
2821 | dma_addr_t status_mapping; | 2827 | dma_addr_t status_mapping; |
2822 | dma_addr_t rx_rcb_mapping; | 2828 | dma_addr_t rx_rcb_mapping; |
@@ -2899,6 +2905,7 @@ enum TG3_FLAGS { | |||
2899 | TG3_FLAG_57765_PLUS, | 2905 | TG3_FLAG_57765_PLUS, |
2900 | TG3_FLAG_APE_HAS_NCSI, | 2906 | TG3_FLAG_APE_HAS_NCSI, |
2901 | TG3_FLAG_5717_PLUS, | 2907 | TG3_FLAG_5717_PLUS, |
2908 | TG3_FLAG_4K_FIFO_LIMIT, | ||
2902 | 2909 | ||
2903 | /* Add new flags before this comment and TG3_FLAG_NUMBER_OF_FLAGS */ | 2910 | /* Add new flags before this comment and TG3_FLAG_NUMBER_OF_FLAGS */ |
2904 | TG3_FLAG_NUMBER_OF_FLAGS, /* Last entry in enum TG3_FLAGS */ | 2911 | TG3_FLAG_NUMBER_OF_FLAGS, /* Last entry in enum TG3_FLAGS */ |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 9a6b3824da14..71f3d1a35b74 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -528,6 +528,7 @@ static void tun_net_init(struct net_device *dev) | |||
528 | dev->netdev_ops = &tap_netdev_ops; | 528 | dev->netdev_ops = &tap_netdev_ops; |
529 | /* Ethernet TAP Device */ | 529 | /* Ethernet TAP Device */ |
530 | ether_setup(dev); | 530 | ether_setup(dev); |
531 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; | ||
531 | 532 | ||
532 | random_ether_addr(dev->dev_addr); | 533 | random_ether_addr(dev->dev_addr); |
533 | 534 | ||
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index 52502883523e..c5c4b4def7fb 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -314,12 +314,11 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
314 | skb_pull(skb, 4); | 314 | skb_pull(skb, 4); |
315 | 315 | ||
316 | while (skb->len > 0) { | 316 | while (skb->len > 0) { |
317 | if ((short)(header & 0x0000ffff) != | 317 | if ((header & 0x07ff) != ((~header >> 16) & 0x07ff)) |
318 | ~((short)((header & 0xffff0000) >> 16))) { | ||
319 | netdev_err(dev->net, "asix_rx_fixup() Bad Header Length\n"); | 318 | netdev_err(dev->net, "asix_rx_fixup() Bad Header Length\n"); |
320 | } | 319 | |
321 | /* get the packet length */ | 320 | /* get the packet length */ |
322 | size = (u16) (header & 0x0000ffff); | 321 | size = (u16) (header & 0x000007ff); |
323 | 322 | ||
324 | if ((skb->len) - ((size + 1) & 0xfffe) == 0) { | 323 | if ((skb->len) - ((size + 1) & 0xfffe) == 0) { |
325 | u8 alignment = (unsigned long)skb->data & 0x3; | 324 | u8 alignment = (unsigned long)skb->data & 0x3; |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 7f78db7bd68d..5b23767ea817 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -263,6 +263,8 @@ static void veth_setup(struct net_device *dev) | |||
263 | { | 263 | { |
264 | ether_setup(dev); | 264 | ether_setup(dev); |
265 | 265 | ||
266 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; | ||
267 | |||
266 | dev->netdev_ops = &veth_netdev_ops; | 268 | dev->netdev_ops = &veth_netdev_ops; |
267 | dev->ethtool_ops = &veth_ethtool_ops; | 269 | dev->ethtool_ops = &veth_ethtool_ops; |
268 | dev->features |= NETIF_F_LLTX; | 270 | dev->features |= NETIF_F_LLTX; |
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index b25c9229a6a9..eb2028187fbe 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c | |||
@@ -1074,9 +1074,10 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type) | |||
1074 | 1074 | ||
1075 | used = pvc_is_used(pvc); | 1075 | used = pvc_is_used(pvc); |
1076 | 1076 | ||
1077 | if (type == ARPHRD_ETHER) | 1077 | if (type == ARPHRD_ETHER) { |
1078 | dev = alloc_netdev(0, "pvceth%d", ether_setup); | 1078 | dev = alloc_netdev(0, "pvceth%d", ether_setup); |
1079 | else | 1079 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; |
1080 | } else | ||
1080 | dev = alloc_netdev(0, "pvc%d", pvc_setup); | 1081 | dev = alloc_netdev(0, "pvc%d", pvc_setup); |
1081 | 1082 | ||
1082 | if (!dev) { | 1083 | if (!dev) { |
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 55cf71fbffe3..e1b3e3c134fd 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -2823,6 +2823,7 @@ static struct net_device *_init_airo_card( unsigned short irq, int port, | |||
2823 | dev->wireless_data = &ai->wireless_data; | 2823 | dev->wireless_data = &ai->wireless_data; |
2824 | dev->irq = irq; | 2824 | dev->irq = irq; |
2825 | dev->base_addr = port; | 2825 | dev->base_addr = port; |
2826 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; | ||
2826 | 2827 | ||
2827 | SET_NETDEV_DEV(dev, dmdev); | 2828 | SET_NETDEV_DEV(dev, dmdev); |
2828 | 2829 | ||
diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig index d2293dcc117f..3cab843afb05 100644 --- a/drivers/net/wireless/b43/Kconfig +++ b/drivers/net/wireless/b43/Kconfig | |||
@@ -28,7 +28,7 @@ config B43 | |||
28 | 28 | ||
29 | config B43_BCMA | 29 | config B43_BCMA |
30 | bool "Support for BCMA bus" | 30 | bool "Support for BCMA bus" |
31 | depends on B43 && BCMA && BROKEN | 31 | depends on B43 && BCMA |
32 | default y | 32 | default y |
33 | 33 | ||
34 | config B43_SSB | 34 | config B43_SSB |
diff --git a/drivers/net/wireless/b43/bus.c b/drivers/net/wireless/b43/bus.c index 64c3f65ff8c0..05f6c7bff6ab 100644 --- a/drivers/net/wireless/b43/bus.c +++ b/drivers/net/wireless/b43/bus.c | |||
@@ -244,10 +244,12 @@ void b43_bus_set_wldev(struct b43_bus_dev *dev, void *wldev) | |||
244 | #ifdef CONFIG_B43_BCMA | 244 | #ifdef CONFIG_B43_BCMA |
245 | case B43_BUS_BCMA: | 245 | case B43_BUS_BCMA: |
246 | bcma_set_drvdata(dev->bdev, wldev); | 246 | bcma_set_drvdata(dev->bdev, wldev); |
247 | break; | ||
247 | #endif | 248 | #endif |
248 | #ifdef CONFIG_B43_SSB | 249 | #ifdef CONFIG_B43_SSB |
249 | case B43_BUS_SSB: | 250 | case B43_BUS_SSB: |
250 | ssb_set_drvdata(dev->sdev, wldev); | 251 | ssb_set_drvdata(dev->sdev, wldev); |
252 | break; | ||
251 | #endif | 253 | #endif |
252 | } | 254 | } |
253 | } | 255 | } |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 032d46674f6b..26f1ab840cc7 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -5350,6 +5350,7 @@ static void b43_ssb_remove(struct ssb_device *sdev) | |||
5350 | { | 5350 | { |
5351 | struct b43_wl *wl = ssb_get_devtypedata(sdev); | 5351 | struct b43_wl *wl = ssb_get_devtypedata(sdev); |
5352 | struct b43_wldev *wldev = ssb_get_drvdata(sdev); | 5352 | struct b43_wldev *wldev = ssb_get_drvdata(sdev); |
5353 | struct b43_bus_dev *dev = wldev->dev; | ||
5353 | 5354 | ||
5354 | /* We must cancel any work here before unregistering from ieee80211, | 5355 | /* We must cancel any work here before unregistering from ieee80211, |
5355 | * as the ieee80211 unreg will destroy the workqueue. */ | 5356 | * as the ieee80211 unreg will destroy the workqueue. */ |
@@ -5365,14 +5366,14 @@ static void b43_ssb_remove(struct ssb_device *sdev) | |||
5365 | ieee80211_unregister_hw(wl->hw); | 5366 | ieee80211_unregister_hw(wl->hw); |
5366 | } | 5367 | } |
5367 | 5368 | ||
5368 | b43_one_core_detach(wldev->dev); | 5369 | b43_one_core_detach(dev); |
5369 | 5370 | ||
5370 | if (list_empty(&wl->devlist)) { | 5371 | if (list_empty(&wl->devlist)) { |
5371 | b43_leds_unregister(wl); | 5372 | b43_leds_unregister(wl); |
5372 | /* Last core on the chip unregistered. | 5373 | /* Last core on the chip unregistered. |
5373 | * We can destroy common struct b43_wl. | 5374 | * We can destroy common struct b43_wl. |
5374 | */ | 5375 | */ |
5375 | b43_wireless_exit(wldev->dev, wl); | 5376 | b43_wireless_exit(dev, wl); |
5376 | } | 5377 | } |
5377 | } | 5378 | } |
5378 | 5379 | ||
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index d5084829c9e5..89a116fba1de 100644 --- a/drivers/net/wireless/hostap/hostap_main.c +++ b/drivers/net/wireless/hostap/hostap_main.c | |||
@@ -855,6 +855,7 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local, | |||
855 | 855 | ||
856 | iface = netdev_priv(dev); | 856 | iface = netdev_priv(dev); |
857 | ether_setup(dev); | 857 | ether_setup(dev); |
858 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; | ||
858 | 859 | ||
859 | /* kernel callbacks */ | 860 | /* kernel callbacks */ |
860 | if (iface) { | 861 | if (iface) { |
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c index 037231540719..c77e0543e502 100644 --- a/drivers/nfc/pn533.c +++ b/drivers/nfc/pn533.c | |||
@@ -1596,7 +1596,7 @@ static void pn533_disconnect(struct usb_interface *interface) | |||
1596 | usb_free_urb(dev->out_urb); | 1596 | usb_free_urb(dev->out_urb); |
1597 | kfree(dev); | 1597 | kfree(dev); |
1598 | 1598 | ||
1599 | nfc_dev_info(&dev->interface->dev, "NXP PN533 NFC device disconnected"); | 1599 | nfc_dev_info(&interface->dev, "NXP PN533 NFC device disconnected"); |
1600 | } | 1600 | } |
1601 | 1601 | ||
1602 | static struct usb_driver pn533_driver = { | 1602 | static struct usb_driver pn533_driver = { |
diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c index 499b7a90e941..32ee39ad00df 100644 --- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c +++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c | |||
@@ -6205,6 +6205,7 @@ int ar6000_create_ap_interface(struct ar6_softc *ar, char *ap_ifname) | |||
6205 | 6205 | ||
6206 | ether_setup(dev); | 6206 | ether_setup(dev); |
6207 | init_netdev(dev, ap_ifname); | 6207 | init_netdev(dev, ap_ifname); |
6208 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; | ||
6208 | 6209 | ||
6209 | if (register_netdev(dev)) { | 6210 | if (register_netdev(dev)) { |
6210 | AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_create_ap_interface: register_netdev failed\n")); | 6211 | AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_create_ap_interface: register_netdev failed\n")); |
diff --git a/include/linux/if.h b/include/linux/if.h index 3bc63e6a02f7..03489ca92ded 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -76,6 +76,8 @@ | |||
76 | #define IFF_BRIDGE_PORT 0x4000 /* device used as bridge port */ | 76 | #define IFF_BRIDGE_PORT 0x4000 /* device used as bridge port */ |
77 | #define IFF_OVS_DATAPATH 0x8000 /* device used as Open vSwitch | 77 | #define IFF_OVS_DATAPATH 0x8000 /* device used as Open vSwitch |
78 | * datapath port */ | 78 | * datapath port */ |
79 | #define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing | ||
80 | * skbs on transmit */ | ||
79 | 81 | ||
80 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 82 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
81 | #define IF_GET_PROTO 0x0002 | 83 | #define IF_GET_PROTO 0x0002 |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 2ed0b6cf11c5..ddee79bb8f15 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1132,7 +1132,7 @@ struct net_device { | |||
1132 | spinlock_t addr_list_lock; | 1132 | spinlock_t addr_list_lock; |
1133 | struct netdev_hw_addr_list uc; /* Unicast mac addresses */ | 1133 | struct netdev_hw_addr_list uc; /* Unicast mac addresses */ |
1134 | struct netdev_hw_addr_list mc; /* Multicast mac addresses */ | 1134 | struct netdev_hw_addr_list mc; /* Multicast mac addresses */ |
1135 | int uc_promisc; | 1135 | bool uc_promisc; |
1136 | unsigned int promiscuity; | 1136 | unsigned int promiscuity; |
1137 | unsigned int allmulti; | 1137 | unsigned int allmulti; |
1138 | 1138 | ||
@@ -1679,9 +1679,12 @@ static inline int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen) | |||
1679 | static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen, | 1679 | static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen, |
1680 | unsigned int offset) | 1680 | unsigned int offset) |
1681 | { | 1681 | { |
1682 | if (!pskb_may_pull(skb, hlen)) | ||
1683 | return NULL; | ||
1684 | |||
1682 | NAPI_GRO_CB(skb)->frag0 = NULL; | 1685 | NAPI_GRO_CB(skb)->frag0 = NULL; |
1683 | NAPI_GRO_CB(skb)->frag0_len = 0; | 1686 | NAPI_GRO_CB(skb)->frag0_len = 0; |
1684 | return pskb_may_pull(skb, hlen) ? skb->data + offset : NULL; | 1687 | return skb->data + offset; |
1685 | } | 1688 | } |
1686 | 1689 | ||
1687 | static inline void *skb_gro_mac_header(struct sk_buff *skb) | 1690 | static inline void *skb_gro_mac_header(struct sk_buff *skb) |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 934e221c1d07..9d40a071d038 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -695,7 +695,7 @@ void vlan_setup(struct net_device *dev) | |||
695 | ether_setup(dev); | 695 | ether_setup(dev); |
696 | 696 | ||
697 | dev->priv_flags |= IFF_802_1Q_VLAN; | 697 | dev->priv_flags |= IFF_802_1Q_VLAN; |
698 | dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; | 698 | dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING); |
699 | dev->tx_queue_len = 0; | 699 | dev->tx_queue_len = 0; |
700 | 700 | ||
701 | dev->netdev_ops = &vlan_netdev_ops; | 701 | dev->netdev_ops = &vlan_netdev_ops; |
diff --git a/net/bluetooth/bnep/netdev.c b/net/bluetooth/bnep/netdev.c index 8c100c9dae28..d4f5dff7c955 100644 --- a/net/bluetooth/bnep/netdev.c +++ b/net/bluetooth/bnep/netdev.c | |||
@@ -231,6 +231,7 @@ void bnep_net_setup(struct net_device *dev) | |||
231 | dev->addr_len = ETH_ALEN; | 231 | dev->addr_len = ETH_ALEN; |
232 | 232 | ||
233 | ether_setup(dev); | 233 | ether_setup(dev); |
234 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; | ||
234 | dev->netdev_ops = &bnep_netdev_ops; | 235 | dev->netdev_ops = &bnep_netdev_ops; |
235 | 236 | ||
236 | dev->watchdog_timeo = HZ * 2; | 237 | dev->watchdog_timeo = HZ * 2; |
diff --git a/net/core/dev.c b/net/core/dev.c index 9444c5cb4137..17d67b579beb 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -4497,10 +4497,10 @@ void __dev_set_rx_mode(struct net_device *dev) | |||
4497 | */ | 4497 | */ |
4498 | if (!netdev_uc_empty(dev) && !dev->uc_promisc) { | 4498 | if (!netdev_uc_empty(dev) && !dev->uc_promisc) { |
4499 | __dev_set_promiscuity(dev, 1); | 4499 | __dev_set_promiscuity(dev, 1); |
4500 | dev->uc_promisc = 1; | 4500 | dev->uc_promisc = true; |
4501 | } else if (netdev_uc_empty(dev) && dev->uc_promisc) { | 4501 | } else if (netdev_uc_empty(dev) && dev->uc_promisc) { |
4502 | __dev_set_promiscuity(dev, -1); | 4502 | __dev_set_promiscuity(dev, -1); |
4503 | dev->uc_promisc = 0; | 4503 | dev->uc_promisc = false; |
4504 | } | 4504 | } |
4505 | 4505 | ||
4506 | if (ops->ndo_set_multicast_list) | 4506 | if (ops->ndo_set_multicast_list) |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index f76079cd750c..e35a6fbb8110 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -1070,7 +1070,9 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1070 | len = num_arg(&user_buffer[i], 10, &value); | 1070 | len = num_arg(&user_buffer[i], 10, &value); |
1071 | if (len < 0) | 1071 | if (len < 0) |
1072 | return len; | 1072 | return len; |
1073 | 1073 | if ((value > 0) && | |
1074 | (!(pkt_dev->odev->priv_flags & IFF_TX_SKB_SHARING))) | ||
1075 | return -ENOTSUPP; | ||
1074 | i += len; | 1076 | i += len; |
1075 | pkt_dev->clone_skb = value; | 1077 | pkt_dev->clone_skb = value; |
1076 | 1078 | ||
@@ -3555,7 +3557,6 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname) | |||
3555 | pkt_dev->min_pkt_size = ETH_ZLEN; | 3557 | pkt_dev->min_pkt_size = ETH_ZLEN; |
3556 | pkt_dev->max_pkt_size = ETH_ZLEN; | 3558 | pkt_dev->max_pkt_size = ETH_ZLEN; |
3557 | pkt_dev->nfrags = 0; | 3559 | pkt_dev->nfrags = 0; |
3558 | pkt_dev->clone_skb = pg_clone_skb_d; | ||
3559 | pkt_dev->delay = pg_delay_d; | 3560 | pkt_dev->delay = pg_delay_d; |
3560 | pkt_dev->count = pg_count_d; | 3561 | pkt_dev->count = pg_count_d; |
3561 | pkt_dev->sofar = 0; | 3562 | pkt_dev->sofar = 0; |
@@ -3563,7 +3564,6 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname) | |||
3563 | pkt_dev->udp_src_max = 9; | 3564 | pkt_dev->udp_src_max = 9; |
3564 | pkt_dev->udp_dst_min = 9; | 3565 | pkt_dev->udp_dst_min = 9; |
3565 | pkt_dev->udp_dst_max = 9; | 3566 | pkt_dev->udp_dst_max = 9; |
3566 | |||
3567 | pkt_dev->vlan_p = 0; | 3567 | pkt_dev->vlan_p = 0; |
3568 | pkt_dev->vlan_cfi = 0; | 3568 | pkt_dev->vlan_cfi = 0; |
3569 | pkt_dev->vlan_id = 0xffff; | 3569 | pkt_dev->vlan_id = 0xffff; |
@@ -3575,6 +3575,8 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname) | |||
3575 | err = pktgen_setup_dev(pkt_dev, ifname); | 3575 | err = pktgen_setup_dev(pkt_dev, ifname); |
3576 | if (err) | 3576 | if (err) |
3577 | goto out1; | 3577 | goto out1; |
3578 | if (pkt_dev->odev->priv_flags & IFF_TX_SKB_SHARING) | ||
3579 | pkt_dev->clone_skb = pg_clone_skb_d; | ||
3578 | 3580 | ||
3579 | pkt_dev->entry = proc_create_data(ifname, 0600, pg_proc_dir, | 3581 | pkt_dev->entry = proc_create_data(ifname, 0600, pg_proc_dir, |
3580 | &pktgen_if_fops, pkt_dev); | 3582 | &pktgen_if_fops, pkt_dev); |
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 5cffb63f481a..27997d35ebd3 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c | |||
@@ -231,6 +231,7 @@ EXPORT_SYMBOL(eth_header_parse); | |||
231 | * eth_header_cache - fill cache entry from neighbour | 231 | * eth_header_cache - fill cache entry from neighbour |
232 | * @neigh: source neighbour | 232 | * @neigh: source neighbour |
233 | * @hh: destination cache entry | 233 | * @hh: destination cache entry |
234 | * @type: Ethernet type field | ||
234 | * Create an Ethernet header template from the neighbour. | 235 | * Create an Ethernet header template from the neighbour. |
235 | */ | 236 | */ |
236 | int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type) | 237 | int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type) |
@@ -339,6 +340,7 @@ void ether_setup(struct net_device *dev) | |||
339 | dev->addr_len = ETH_ALEN; | 340 | dev->addr_len = ETH_ALEN; |
340 | dev->tx_queue_len = 1000; /* Ethernet wants good queues */ | 341 | dev->tx_queue_len = 1000; /* Ethernet wants good queues */ |
341 | dev->flags = IFF_BROADCAST|IFF_MULTICAST; | 342 | dev->flags = IFF_BROADCAST|IFF_MULTICAST; |
343 | dev->priv_flags = IFF_TX_SKB_SHARING; | ||
342 | 344 | ||
343 | memset(dev->broadcast, 0xFF, ETH_ALEN); | 345 | memset(dev->broadcast, 0xFF, ETH_ALEN); |
344 | 346 | ||
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 37b3c188d8b3..bc19bd06dd00 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1134,15 +1134,15 @@ static void inetdev_send_gratuitous_arp(struct net_device *dev, | |||
1134 | struct in_device *in_dev) | 1134 | struct in_device *in_dev) |
1135 | 1135 | ||
1136 | { | 1136 | { |
1137 | struct in_ifaddr *ifa = in_dev->ifa_list; | 1137 | struct in_ifaddr *ifa; |
1138 | |||
1139 | if (!ifa) | ||
1140 | return; | ||
1141 | 1138 | ||
1142 | arp_send(ARPOP_REQUEST, ETH_P_ARP, | 1139 | for (ifa = in_dev->ifa_list; ifa; |
1143 | ifa->ifa_local, dev, | 1140 | ifa = ifa->ifa_next) { |
1144 | ifa->ifa_local, NULL, | 1141 | arp_send(ARPOP_REQUEST, ETH_P_ARP, |
1145 | dev->dev_addr, NULL); | 1142 | ifa->ifa_local, dev, |
1143 | ifa->ifa_local, NULL, | ||
1144 | dev->dev_addr, NULL); | ||
1145 | } | ||
1146 | } | 1146 | } |
1147 | 1147 | ||
1148 | /* Called only under RTNL semaphore */ | 1148 | /* Called only under RTNL semaphore */ |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index a06c53c14d84..a55500cc0b29 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1481,6 +1481,8 @@ static void addrconf_join_anycast(struct inet6_ifaddr *ifp) | |||
1481 | static void addrconf_leave_anycast(struct inet6_ifaddr *ifp) | 1481 | static void addrconf_leave_anycast(struct inet6_ifaddr *ifp) |
1482 | { | 1482 | { |
1483 | struct in6_addr addr; | 1483 | struct in6_addr addr; |
1484 | if (ifp->prefix_len == 127) /* RFC 6164 */ | ||
1485 | return; | ||
1484 | ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len); | 1486 | ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len); |
1485 | if (ipv6_addr_any(&addr)) | 1487 | if (ipv6_addr_any(&addr)) |
1486 | return; | 1488 | return; |
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c index a8193f52c13c..d2726a74597d 100644 --- a/net/l2tp/l2tp_eth.c +++ b/net/l2tp/l2tp_eth.c | |||
@@ -103,7 +103,7 @@ static struct net_device_ops l2tp_eth_netdev_ops = { | |||
103 | static void l2tp_eth_dev_setup(struct net_device *dev) | 103 | static void l2tp_eth_dev_setup(struct net_device *dev) |
104 | { | 104 | { |
105 | ether_setup(dev); | 105 | ether_setup(dev); |
106 | 106 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; | |
107 | dev->netdev_ops = &l2tp_eth_netdev_ops; | 107 | dev->netdev_ops = &l2tp_eth_netdev_ops; |
108 | dev->destructor = free_netdev; | 108 | dev->destructor = free_netdev; |
109 | } | 109 | } |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index cd5fb40d3fd4..556e7e6ddf0a 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -698,6 +698,7 @@ static const struct net_device_ops ieee80211_monitorif_ops = { | |||
698 | static void ieee80211_if_setup(struct net_device *dev) | 698 | static void ieee80211_if_setup(struct net_device *dev) |
699 | { | 699 | { |
700 | ether_setup(dev); | 700 | ether_setup(dev); |
701 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; | ||
701 | dev->netdev_ops = &ieee80211_dataif_ops; | 702 | dev->netdev_ops = &ieee80211_dataif_ops; |
702 | dev->destructor = free_netdev; | 703 | dev->destructor = free_netdev; |
703 | } | 704 | } |
diff --git a/net/socket.c b/net/socket.c index 26ed35c7751e..b1cbbcd92558 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -580,7 +580,7 @@ int sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) | |||
580 | } | 580 | } |
581 | EXPORT_SYMBOL(sock_sendmsg); | 581 | EXPORT_SYMBOL(sock_sendmsg); |
582 | 582 | ||
583 | int sock_sendmsg_nosec(struct socket *sock, struct msghdr *msg, size_t size) | 583 | static int sock_sendmsg_nosec(struct socket *sock, struct msghdr *msg, size_t size) |
584 | { | 584 | { |
585 | struct kiocb iocb; | 585 | struct kiocb iocb; |
586 | struct sock_iocb siocb; | 586 | struct sock_iocb siocb; |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 1ad0f39fe091..02751dbc5a97 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -903,7 +903,7 @@ static bool ignore_reg_update(struct wiphy *wiphy, | |||
903 | initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && | 903 | initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && |
904 | !is_world_regdom(last_request->alpha2)) { | 904 | !is_world_regdom(last_request->alpha2)) { |
905 | REG_DBG_PRINT("Ignoring regulatory request %s " | 905 | REG_DBG_PRINT("Ignoring regulatory request %s " |
906 | "since the driver requires its own regulaotry " | 906 | "since the driver requires its own regulatory " |
907 | "domain to be set first", | 907 | "domain to be set first", |
908 | reg_initiator_name(initiator)); | 908 | reg_initiator_name(initiator)); |
909 | return true; | 909 | return true; |
@@ -1125,12 +1125,13 @@ void wiphy_update_regulatory(struct wiphy *wiphy, | |||
1125 | enum ieee80211_band band; | 1125 | enum ieee80211_band band; |
1126 | 1126 | ||
1127 | if (ignore_reg_update(wiphy, initiator)) | 1127 | if (ignore_reg_update(wiphy, initiator)) |
1128 | goto out; | 1128 | return; |
1129 | |||
1129 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { | 1130 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { |
1130 | if (wiphy->bands[band]) | 1131 | if (wiphy->bands[band]) |
1131 | handle_band(wiphy, band, initiator); | 1132 | handle_band(wiphy, band, initiator); |
1132 | } | 1133 | } |
1133 | out: | 1134 | |
1134 | reg_process_beacons(wiphy); | 1135 | reg_process_beacons(wiphy); |
1135 | reg_process_ht_flags(wiphy); | 1136 | reg_process_ht_flags(wiphy); |
1136 | if (wiphy->reg_notifier) | 1137 | if (wiphy->reg_notifier) |