Commit bdec41963890f8ed9ad89f8b418959ab3cdc2aa3
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Just a pile of random fixes, including: 1) Do not apply TSO limits to non-TSO packets, fix from Herbert Xu. 2) MDI{,X} eeprom check in e100 driver is reversed, from John W. Linville. 3) Missing error return assignments in several ethernet drivers, from Julia Lawall. 4) Altera TSE device doesn't come back up after ifconfig down/up sequence, fix from Kostya Belezko. 5) Add more cases to the check for whether the qmi_wwan device has a bogus MAC address and needs to be assigned a random one. From Kristian Evensen. 6) Fix interrupt hangs in CPSW, from Felipe Balbi. 7) Implement ndo_features_check in r8152 so that the stack doesn't feed GSO packets which are outside of the chip's capabilities. From Hayes Wang" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (26 commits) qla3xxx: don't allow never end busy loop xen-netback: fixing the propagation of the transmit shaper timeout r8152: support ndo_features_check batman-adv: fix potential TT client + orig-node memory leak batman-adv: fix multicast counter when purging originators batman-adv: fix counter for multicast supporting nodes batman-adv: fix lock class for decoding hash in network-coding.c batman-adv: fix delayed foreign originator recognition batman-adv: fix and simplify condition when bonding should be used Revert "mac80211: Fix accounting of the tailroom-needed counter" net: ethernet: cpsw: fix hangs with interrupts enic: free all rq buffs when allocation fails qmi_wwan: Set random MAC on devices with buggy fw openvswitch: Consistently include VLAN header in flow and port stats. tcp: Do not apply TSO segment limit to non-TSO packets Altera TSE: Add missing phydev net/mlx4_core: Fix error flow in mlx4_init_hca() net/mlx4_core: Correcly update the mtt's offset in the MR re-reg flow qlcnic: Fix return value in qlcnic_probe() net: axienet: fix error return code ...
Showing 27 changed files Side-by-side Diff
- drivers/net/ethernet/allwinner/sun4i-emac.c
- drivers/net/ethernet/altera/altera_tse_main.c
- drivers/net/ethernet/cisco/enic/enic_main.c
- drivers/net/ethernet/intel/e100.c
- drivers/net/ethernet/intel/i40e/i40e_debugfs.c
- drivers/net/ethernet/intel/igb/e1000_82575.c
- drivers/net/ethernet/mellanox/mlx4/main.c
- drivers/net/ethernet/mellanox/mlx4/mr.c
- drivers/net/ethernet/myricom/myri10ge/myri10ge.c
- drivers/net/ethernet/qlogic/qla3xxx.c
- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
- drivers/net/ethernet/ti/cpsw.c
- drivers/net/ethernet/xilinx/ll_temac_main.c
- drivers/net/ethernet/xilinx/xilinx_axienet_main.c
- drivers/net/ethernet/xilinx/xilinx_emaclite.c
- drivers/net/usb/qmi_wwan.c
- drivers/net/usb/r8152.c
- drivers/net/xen-netback/xenbus.c
- include/net/mac80211.h
- net/batman-adv/multicast.c
- net/batman-adv/network-coding.c
- net/batman-adv/originator.c
- net/batman-adv/routing.c
- net/ipv4/tcp_output.c
- net/mac80211/key.c
- net/openvswitch/flow.c
- net/openvswitch/vport.c
drivers/net/ethernet/allwinner/sun4i-emac.c
drivers/net/ethernet/altera/altera_tse_main.c
... | ... | @@ -1170,10 +1170,6 @@ |
1170 | 1170 | init_error: |
1171 | 1171 | free_skbufs(dev); |
1172 | 1172 | alloc_skbuf_error: |
1173 | - if (priv->phydev) { | |
1174 | - phy_disconnect(priv->phydev); | |
1175 | - priv->phydev = NULL; | |
1176 | - } | |
1177 | 1173 | phy_error: |
1178 | 1174 | return ret; |
1179 | 1175 | } |
1180 | 1176 | |
... | ... | @@ -1186,12 +1182,9 @@ |
1186 | 1182 | int ret; |
1187 | 1183 | unsigned long int flags; |
1188 | 1184 | |
1189 | - /* Stop and disconnect the PHY */ | |
1190 | - if (priv->phydev) { | |
1185 | + /* Stop the PHY */ | |
1186 | + if (priv->phydev) | |
1191 | 1187 | phy_stop(priv->phydev); |
1192 | - phy_disconnect(priv->phydev); | |
1193 | - priv->phydev = NULL; | |
1194 | - } | |
1195 | 1188 | |
1196 | 1189 | netif_stop_queue(dev); |
1197 | 1190 | napi_disable(&priv->napi); |
... | ... | @@ -1525,6 +1518,10 @@ |
1525 | 1518 | static int altera_tse_remove(struct platform_device *pdev) |
1526 | 1519 | { |
1527 | 1520 | struct net_device *ndev = platform_get_drvdata(pdev); |
1521 | + struct altera_tse_private *priv = netdev_priv(ndev); | |
1522 | + | |
1523 | + if (priv->phydev) | |
1524 | + phy_disconnect(priv->phydev); | |
1528 | 1525 | |
1529 | 1526 | platform_set_drvdata(pdev, NULL); |
1530 | 1527 | altera_tse_mdio_destroy(ndev); |
drivers/net/ethernet/cisco/enic/enic_main.c
... | ... | @@ -1616,7 +1616,7 @@ |
1616 | 1616 | if (vnic_rq_desc_used(&enic->rq[i]) == 0) { |
1617 | 1617 | netdev_err(netdev, "Unable to alloc receive buffers\n"); |
1618 | 1618 | err = -ENOMEM; |
1619 | - goto err_out_notify_unset; | |
1619 | + goto err_out_free_rq; | |
1620 | 1620 | } |
1621 | 1621 | } |
1622 | 1622 | |
... | ... | @@ -1649,7 +1649,9 @@ |
1649 | 1649 | |
1650 | 1650 | return 0; |
1651 | 1651 | |
1652 | -err_out_notify_unset: | |
1652 | +err_out_free_rq: | |
1653 | + for (i = 0; i < enic->rq_count; i++) | |
1654 | + vnic_rq_clean(&enic->rq[i], enic_free_rq_buf); | |
1653 | 1655 | enic_dev_notify_unset(enic); |
1654 | 1656 | err_out_free_intr: |
1655 | 1657 | enic_free_intr(enic); |
drivers/net/ethernet/intel/e100.c
... | ... | @@ -1543,7 +1543,7 @@ |
1543 | 1543 | mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr); |
1544 | 1544 | } else if ((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && |
1545 | 1545 | (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) && |
1546 | - !(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) { | |
1546 | + (nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) { | |
1547 | 1547 | /* enable/disable MDI/MDI-X auto-switching. */ |
1548 | 1548 | mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, |
1549 | 1549 | nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH); |
drivers/net/ethernet/intel/i40e/i40e_debugfs.c
... | ... | @@ -829,7 +829,7 @@ |
829 | 829 | if (desc_n >= ring->count || desc_n < 0) { |
830 | 830 | dev_info(&pf->pdev->dev, |
831 | 831 | "descriptor %d not found\n", desc_n); |
832 | - return; | |
832 | + goto out; | |
833 | 833 | } |
834 | 834 | if (!is_rx_ring) { |
835 | 835 | txd = I40E_TX_DESC(ring, desc_n); |
... | ... | @@ -855,6 +855,8 @@ |
855 | 855 | } else { |
856 | 856 | dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n"); |
857 | 857 | } |
858 | + | |
859 | +out: | |
858 | 860 | kfree(ring); |
859 | 861 | } |
860 | 862 |
drivers/net/ethernet/intel/igb/e1000_82575.c
... | ... | @@ -1125,7 +1125,7 @@ |
1125 | 1125 | u32 swmask = mask; |
1126 | 1126 | u32 fwmask = mask << 16; |
1127 | 1127 | s32 ret_val = 0; |
1128 | - s32 i = 0, timeout = 200; /* FIXME: find real value to use here */ | |
1128 | + s32 i = 0, timeout = 200; | |
1129 | 1129 | |
1130 | 1130 | while (i < timeout) { |
1131 | 1131 | if (igb_get_hw_semaphore(hw)) { |
drivers/net/ethernet/mellanox/mlx4/main.c
... | ... | @@ -1829,7 +1829,7 @@ |
1829 | 1829 | err = mlx4_dev_cap(dev, &dev_cap); |
1830 | 1830 | if (err) { |
1831 | 1831 | mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n"); |
1832 | - goto err_stop_fw; | |
1832 | + return err; | |
1833 | 1833 | } |
1834 | 1834 | |
1835 | 1835 | choose_steering_mode(dev, &dev_cap); |
... | ... | @@ -1860,7 +1860,7 @@ |
1860 | 1860 | &init_hca); |
1861 | 1861 | if ((long long) icm_size < 0) { |
1862 | 1862 | err = icm_size; |
1863 | - goto err_stop_fw; | |
1863 | + return err; | |
1864 | 1864 | } |
1865 | 1865 | |
1866 | 1866 | dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1; |
... | ... | @@ -1874,7 +1874,7 @@ |
1874 | 1874 | |
1875 | 1875 | err = mlx4_init_icm(dev, &dev_cap, &init_hca, icm_size); |
1876 | 1876 | if (err) |
1877 | - goto err_stop_fw; | |
1877 | + return err; | |
1878 | 1878 | |
1879 | 1879 | err = mlx4_INIT_HCA(dev, &init_hca); |
1880 | 1880 | if (err) { |
... | ... | @@ -1886,7 +1886,7 @@ |
1886 | 1886 | err = mlx4_query_func(dev, &dev_cap); |
1887 | 1887 | if (err < 0) { |
1888 | 1888 | mlx4_err(dev, "QUERY_FUNC command failed, aborting.\n"); |
1889 | - goto err_stop_fw; | |
1889 | + goto err_close; | |
1890 | 1890 | } else if (err & MLX4_QUERY_FUNC_NUM_SYS_EQS) { |
1891 | 1891 | dev->caps.num_eqs = dev_cap.max_eqs; |
1892 | 1892 | dev->caps.reserved_eqs = dev_cap.reserved_eqs; |
... | ... | @@ -2006,11 +2006,6 @@ |
2006 | 2006 | if (!mlx4_is_slave(dev)) |
2007 | 2007 | mlx4_free_icms(dev); |
2008 | 2008 | |
2009 | -err_stop_fw: | |
2010 | - if (!mlx4_is_slave(dev)) { | |
2011 | - mlx4_UNMAP_FA(dev); | |
2012 | - mlx4_free_icm(dev, priv->fw.fw_icm, 0); | |
2013 | - } | |
2014 | 2009 | return err; |
2015 | 2010 | } |
2016 | 2011 |
drivers/net/ethernet/mellanox/mlx4/mr.c
... | ... | @@ -584,6 +584,7 @@ |
584 | 584 | void mlx4_mr_rereg_mem_cleanup(struct mlx4_dev *dev, struct mlx4_mr *mr) |
585 | 585 | { |
586 | 586 | mlx4_mtt_cleanup(dev, &mr->mtt); |
587 | + mr->mtt.order = -1; | |
587 | 588 | } |
588 | 589 | EXPORT_SYMBOL_GPL(mlx4_mr_rereg_mem_cleanup); |
589 | 590 | |
590 | 591 | |
... | ... | @@ -593,13 +594,13 @@ |
593 | 594 | { |
594 | 595 | int err; |
595 | 596 | |
596 | - mpt_entry->start = cpu_to_be64(iova); | |
597 | - mpt_entry->length = cpu_to_be64(size); | |
598 | - mpt_entry->entity_size = cpu_to_be32(page_shift); | |
599 | - | |
600 | 597 | err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); |
601 | 598 | if (err) |
602 | 599 | return err; |
600 | + | |
601 | + mpt_entry->start = cpu_to_be64(mr->iova); | |
602 | + mpt_entry->length = cpu_to_be64(mr->size); | |
603 | + mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift); | |
603 | 604 | |
604 | 605 | mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK | |
605 | 606 | MLX4_MPT_PD_FLAG_EN_INV); |
drivers/net/ethernet/myricom/myri10ge/myri10ge.c
... | ... | @@ -4033,8 +4033,10 @@ |
4033 | 4033 | (void)pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); |
4034 | 4034 | mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), |
4035 | 4035 | &mgp->cmd_bus, GFP_KERNEL); |
4036 | - if (mgp->cmd == NULL) | |
4036 | + if (!mgp->cmd) { | |
4037 | + status = -ENOMEM; | |
4037 | 4038 | goto abort_with_enabled; |
4039 | + } | |
4038 | 4040 | |
4039 | 4041 | mgp->board_span = pci_resource_len(pdev, 0); |
4040 | 4042 | mgp->iomem_base = pci_resource_start(pdev, 0); |
drivers/net/ethernet/qlogic/qla3xxx.c
... | ... | @@ -146,10 +146,7 @@ |
146 | 146 | { |
147 | 147 | int i = 0; |
148 | 148 | |
149 | - while (i < 10) { | |
150 | - if (i) | |
151 | - ssleep(1); | |
152 | - | |
149 | + do { | |
153 | 150 | if (ql_sem_lock(qdev, |
154 | 151 | QL_DRVR_SEM_MASK, |
155 | 152 | (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) |
... | ... | @@ -158,7 +155,8 @@ |
158 | 155 | "driver lock acquired\n"); |
159 | 156 | return 1; |
160 | 157 | } |
161 | - } | |
158 | + ssleep(1); | |
159 | + } while (++i < 10); | |
162 | 160 | |
163 | 161 | netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n"); |
164 | 162 | return 0; |
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
drivers/net/ethernet/ti/cpsw.c
... | ... | @@ -757,7 +757,15 @@ |
757 | 757 | static irqreturn_t cpsw_interrupt(int irq, void *dev_id) |
758 | 758 | { |
759 | 759 | struct cpsw_priv *priv = dev_id; |
760 | + int value = irq - priv->irqs_table[0]; | |
760 | 761 | |
762 | + /* NOTICE: Ending IRQ here. The trick with the 'value' variable above | |
763 | + * is to make sure we will always write the correct value to the EOI | |
764 | + * register. Namely 0 for RX_THRESH Interrupt, 1 for RX Interrupt, 2 | |
765 | + * for TX Interrupt and 3 for MISC Interrupt. | |
766 | + */ | |
767 | + cpdma_ctlr_eoi(priv->dma, value); | |
768 | + | |
761 | 769 | cpsw_intr_disable(priv); |
762 | 770 | if (priv->irq_enabled == true) { |
763 | 771 | cpsw_disable_irq(priv); |
... | ... | @@ -786,8 +794,6 @@ |
786 | 794 | int num_tx, num_rx; |
787 | 795 | |
788 | 796 | num_tx = cpdma_chan_process(priv->txch, 128); |
789 | - if (num_tx) | |
790 | - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | |
791 | 797 | |
792 | 798 | num_rx = cpdma_chan_process(priv->rxch, budget); |
793 | 799 | if (num_rx < budget) { |
... | ... | @@ -795,7 +801,6 @@ |
795 | 801 | |
796 | 802 | napi_complete(napi); |
797 | 803 | cpsw_intr_enable(priv); |
798 | - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | |
799 | 804 | prim_cpsw = cpsw_get_slave_priv(priv, 0); |
800 | 805 | if (prim_cpsw->irq_enabled == false) { |
801 | 806 | prim_cpsw->irq_enabled = true; |
... | ... | @@ -1310,8 +1315,6 @@ |
1310 | 1315 | napi_enable(&priv->napi); |
1311 | 1316 | cpdma_ctlr_start(priv->dma); |
1312 | 1317 | cpsw_intr_enable(priv); |
1313 | - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | |
1314 | - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | |
1315 | 1318 | |
1316 | 1319 | prim_cpsw = cpsw_get_slave_priv(priv, 0); |
1317 | 1320 | if (prim_cpsw->irq_enabled == false) { |
... | ... | @@ -1578,9 +1581,6 @@ |
1578 | 1581 | cpdma_chan_start(priv->txch); |
1579 | 1582 | cpdma_ctlr_int_ctrl(priv->dma, true); |
1580 | 1583 | cpsw_intr_enable(priv); |
1581 | - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | |
1582 | - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | |
1583 | - | |
1584 | 1584 | } |
1585 | 1585 | |
1586 | 1586 | static int cpsw_ndo_set_mac_address(struct net_device *ndev, void *p) |
... | ... | @@ -1620,9 +1620,6 @@ |
1620 | 1620 | cpsw_interrupt(ndev->irq, priv); |
1621 | 1621 | cpdma_ctlr_int_ctrl(priv->dma, true); |
1622 | 1622 | cpsw_intr_enable(priv); |
1623 | - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | |
1624 | - cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | |
1625 | - | |
1626 | 1623 | } |
1627 | 1624 | #endif |
1628 | 1625 |
drivers/net/ethernet/xilinx/ll_temac_main.c
... | ... | @@ -1043,6 +1043,7 @@ |
1043 | 1043 | lp->regs = of_iomap(op->dev.of_node, 0); |
1044 | 1044 | if (!lp->regs) { |
1045 | 1045 | dev_err(&op->dev, "could not map temac regs.\n"); |
1046 | + rc = -ENOMEM; | |
1046 | 1047 | goto nodev; |
1047 | 1048 | } |
1048 | 1049 | |
... | ... | @@ -1062,6 +1063,7 @@ |
1062 | 1063 | np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); |
1063 | 1064 | if (!np) { |
1064 | 1065 | dev_err(&op->dev, "could not find DMA node\n"); |
1066 | + rc = -ENODEV; | |
1065 | 1067 | goto err_iounmap; |
1066 | 1068 | } |
1067 | 1069 |
drivers/net/ethernet/xilinx/xilinx_axienet_main.c
... | ... | @@ -1501,6 +1501,7 @@ |
1501 | 1501 | lp->regs = of_iomap(op->dev.of_node, 0); |
1502 | 1502 | if (!lp->regs) { |
1503 | 1503 | dev_err(&op->dev, "could not map Axi Ethernet regs.\n"); |
1504 | + ret = -ENOMEM; | |
1504 | 1505 | goto nodev; |
1505 | 1506 | } |
1506 | 1507 | /* Setup checksum offload, but default to off if not specified */ |
... | ... | @@ -1563,6 +1564,7 @@ |
1563 | 1564 | np = of_parse_phandle(op->dev.of_node, "axistream-connected", 0); |
1564 | 1565 | if (!np) { |
1565 | 1566 | dev_err(&op->dev, "could not find DMA node\n"); |
1567 | + ret = -ENODEV; | |
1566 | 1568 | goto err_iounmap; |
1567 | 1569 | } |
1568 | 1570 | lp->dma_regs = of_iomap(np, 0); |
drivers/net/ethernet/xilinx/xilinx_emaclite.c
drivers/net/usb/qmi_wwan.c
... | ... | @@ -56,6 +56,8 @@ |
56 | 56 | /* default ethernet address used by the modem */ |
57 | 57 | static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3}; |
58 | 58 | |
59 | +static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00}; | |
60 | + | |
59 | 61 | /* Make up an ethernet header if the packet doesn't have one. |
60 | 62 | * |
61 | 63 | * A firmware bug common among several devices cause them to send raw |
62 | 64 | |
... | ... | @@ -332,10 +334,12 @@ |
332 | 334 | usb_driver_release_interface(driver, info->data); |
333 | 335 | } |
334 | 336 | |
335 | - /* Never use the same address on both ends of the link, even | |
336 | - * if the buggy firmware told us to. | |
337 | + /* Never use the same address on both ends of the link, even if the | |
338 | + * buggy firmware told us to. Or, if device is assigned the well-known | |
339 | + * buggy firmware MAC address, replace it with a random address, | |
337 | 340 | */ |
338 | - if (ether_addr_equal(dev->net->dev_addr, default_modem_addr)) | |
341 | + if (ether_addr_equal(dev->net->dev_addr, default_modem_addr) || | |
342 | + ether_addr_equal(dev->net->dev_addr, buggy_fw_addr)) | |
339 | 343 | eth_hw_addr_random(dev->net); |
340 | 344 | |
341 | 345 | /* make MAC addr easily distinguishable from an IP header */ |
drivers/net/usb/r8152.c
... | ... | @@ -1897,6 +1897,22 @@ |
1897 | 1897 | netif_wake_queue(netdev); |
1898 | 1898 | } |
1899 | 1899 | |
1900 | +static netdev_features_t | |
1901 | +rtl8152_features_check(struct sk_buff *skb, struct net_device *dev, | |
1902 | + netdev_features_t features) | |
1903 | +{ | |
1904 | + u32 mss = skb_shinfo(skb)->gso_size; | |
1905 | + int max_offset = mss ? GTTCPHO_MAX : TCPHO_MAX; | |
1906 | + int offset = skb_transport_offset(skb); | |
1907 | + | |
1908 | + if ((mss || skb->ip_summed == CHECKSUM_PARTIAL) && offset > max_offset) | |
1909 | + features &= ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK); | |
1910 | + else if ((skb->len + sizeof(struct tx_desc)) > agg_buf_sz) | |
1911 | + features &= ~NETIF_F_GSO_MASK; | |
1912 | + | |
1913 | + return features; | |
1914 | +} | |
1915 | + | |
1900 | 1916 | static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb, |
1901 | 1917 | struct net_device *netdev) |
1902 | 1918 | { |
... | ... | @@ -3706,6 +3722,7 @@ |
3706 | 3722 | .ndo_set_mac_address = rtl8152_set_mac_address, |
3707 | 3723 | .ndo_change_mtu = rtl8152_change_mtu, |
3708 | 3724 | .ndo_validate_addr = eth_validate_addr, |
3725 | + .ndo_features_check = rtl8152_features_check, | |
3709 | 3726 | }; |
3710 | 3727 | |
3711 | 3728 | static void r8152b_get_version(struct r8152 *tp) |
drivers/net/xen-netback/xenbus.c
include/net/mac80211.h
... | ... | @@ -1270,8 +1270,7 @@ |
1270 | 1270 | * |
1271 | 1271 | * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the |
1272 | 1272 | * driver to indicate that it requires IV generation for this |
1273 | - * particular key. Setting this flag does not necessarily mean that SKBs | |
1274 | - * will have sufficient tailroom for ICV or MIC. | |
1273 | + * particular key. | |
1275 | 1274 | * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by |
1276 | 1275 | * the driver for a TKIP key if it requires Michael MIC |
1277 | 1276 | * generation in software. |
... | ... | @@ -1283,9 +1282,7 @@ |
1283 | 1282 | * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver |
1284 | 1283 | * if space should be prepared for the IV, but the IV |
1285 | 1284 | * itself should not be generated. Do not set together with |
1286 | - * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. Setting this flag does | |
1287 | - * not necessarily mean that SKBs will have sufficient tailroom for ICV or | |
1288 | - * MIC. | |
1285 | + * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. | |
1289 | 1286 | * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received |
1290 | 1287 | * management frames. The flag can help drivers that have a hardware |
1291 | 1288 | * crypto implementation that doesn't deal with management frames |
net/batman-adv/multicast.c
... | ... | @@ -685,11 +685,13 @@ |
685 | 685 | if (orig_initialized) |
686 | 686 | atomic_dec(&bat_priv->mcast.num_disabled); |
687 | 687 | orig->capabilities |= BATADV_ORIG_CAPA_HAS_MCAST; |
688 | - /* If mcast support is being switched off increase the disabled | |
689 | - * mcast node counter. | |
688 | + /* If mcast support is being switched off or if this is an initial | |
689 | + * OGM without mcast support then increase the disabled mcast | |
690 | + * node counter. | |
690 | 691 | */ |
691 | 692 | } else if (!orig_mcast_enabled && |
692 | - orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) { | |
693 | + (orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST || | |
694 | + !orig_initialized)) { | |
693 | 695 | atomic_inc(&bat_priv->mcast.num_disabled); |
694 | 696 | orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_MCAST; |
695 | 697 | } |
... | ... | @@ -738,7 +740,8 @@ |
738 | 740 | { |
739 | 741 | struct batadv_priv *bat_priv = orig->bat_priv; |
740 | 742 | |
741 | - if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST)) | |
743 | + if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) && | |
744 | + orig->capa_initialized & BATADV_ORIG_CAPA_HAS_MCAST) | |
742 | 745 | atomic_dec(&bat_priv->mcast.num_disabled); |
743 | 746 | |
744 | 747 | batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS); |
net/batman-adv/network-coding.c
... | ... | @@ -133,7 +133,7 @@ |
133 | 133 | if (!bat_priv->nc.decoding_hash) |
134 | 134 | goto err; |
135 | 135 | |
136 | - batadv_hash_set_lock_class(bat_priv->nc.coding_hash, | |
136 | + batadv_hash_set_lock_class(bat_priv->nc.decoding_hash, | |
137 | 137 | &batadv_nc_decoding_hash_lock_class_key); |
138 | 138 | |
139 | 139 | INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker); |
net/batman-adv/originator.c
... | ... | @@ -570,9 +570,6 @@ |
570 | 570 | |
571 | 571 | batadv_frag_purge_orig(orig_node, NULL); |
572 | 572 | |
573 | - batadv_tt_global_del_orig(orig_node->bat_priv, orig_node, -1, | |
574 | - "originator timed out"); | |
575 | - | |
576 | 573 | if (orig_node->bat_priv->bat_algo_ops->bat_orig_free) |
577 | 574 | orig_node->bat_priv->bat_algo_ops->bat_orig_free(orig_node); |
578 | 575 | |
... | ... | @@ -678,6 +675,7 @@ |
678 | 675 | atomic_set(&orig_node->last_ttvn, 0); |
679 | 676 | orig_node->tt_buff = NULL; |
680 | 677 | orig_node->tt_buff_len = 0; |
678 | + orig_node->last_seen = jiffies; | |
681 | 679 | reset_time = jiffies - 1 - msecs_to_jiffies(BATADV_RESET_PROTECTION_MS); |
682 | 680 | orig_node->bcast_seqno_reset = reset_time; |
683 | 681 | #ifdef CONFIG_BATMAN_ADV_MCAST |
... | ... | @@ -977,6 +975,9 @@ |
977 | 975 | if (batadv_purge_orig_node(bat_priv, orig_node)) { |
978 | 976 | batadv_gw_node_delete(bat_priv, orig_node); |
979 | 977 | hlist_del_rcu(&orig_node->hash_entry); |
978 | + batadv_tt_global_del_orig(orig_node->bat_priv, | |
979 | + orig_node, -1, | |
980 | + "originator timed out"); | |
980 | 981 | batadv_orig_node_free_ref(orig_node); |
981 | 982 | continue; |
982 | 983 | } |
net/batman-adv/routing.c
... | ... | @@ -443,11 +443,13 @@ |
443 | 443 | |
444 | 444 | router = batadv_orig_router_get(orig_node, recv_if); |
445 | 445 | |
446 | + if (!router) | |
447 | + return router; | |
448 | + | |
446 | 449 | /* only consider bonding for recv_if == BATADV_IF_DEFAULT (first hop) |
447 | 450 | * and if activated. |
448 | 451 | */ |
449 | - if (recv_if == BATADV_IF_DEFAULT || !atomic_read(&bat_priv->bonding) || | |
450 | - !router) | |
452 | + if (!(recv_if == BATADV_IF_DEFAULT && atomic_read(&bat_priv->bonding))) | |
451 | 453 | return router; |
452 | 454 | |
453 | 455 | /* bonding: loop through the list of possible routers found |
net/ipv4/tcp_output.c
... | ... | @@ -2019,7 +2019,7 @@ |
2019 | 2019 | if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now))) |
2020 | 2020 | break; |
2021 | 2021 | |
2022 | - if (tso_segs == 1) { | |
2022 | + if (tso_segs == 1 || !max_segs) { | |
2023 | 2023 | if (unlikely(!tcp_nagle_test(tp, skb, mss_now, |
2024 | 2024 | (tcp_skb_is_last(sk, skb) ? |
2025 | 2025 | nonagle : TCP_NAGLE_PUSH)))) |
... | ... | @@ -2032,7 +2032,7 @@ |
2032 | 2032 | } |
2033 | 2033 | |
2034 | 2034 | limit = mss_now; |
2035 | - if (tso_segs > 1 && !tcp_urg_mode(tp)) | |
2035 | + if (tso_segs > 1 && max_segs && !tcp_urg_mode(tp)) | |
2036 | 2036 | limit = tcp_mss_split_point(sk, skb, mss_now, |
2037 | 2037 | min_t(unsigned int, |
2038 | 2038 | cwnd_quota, |
net/mac80211/key.c
... | ... | @@ -140,7 +140,9 @@ |
140 | 140 | if (!ret) { |
141 | 141 | key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; |
142 | 142 | |
143 | - if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) | |
143 | + if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || | |
144 | + (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) || | |
145 | + (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE))) | |
144 | 146 | sdata->crypto_tx_tailroom_needed_cnt--; |
145 | 147 | |
146 | 148 | WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) && |
... | ... | @@ -188,7 +190,9 @@ |
188 | 190 | sta = key->sta; |
189 | 191 | sdata = key->sdata; |
190 | 192 | |
191 | - if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) | |
193 | + if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || | |
194 | + (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) || | |
195 | + (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE))) | |
192 | 196 | increment_tailroom_need_count(sdata); |
193 | 197 | |
194 | 198 | ret = drv_set_key(key->local, DISABLE_KEY, sdata, |
... | ... | @@ -884,7 +888,9 @@ |
884 | 888 | if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) { |
885 | 889 | key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; |
886 | 890 | |
887 | - if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) | |
891 | + if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || | |
892 | + (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) || | |
893 | + (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE))) | |
888 | 894 | increment_tailroom_need_count(key->sdata); |
889 | 895 | } |
890 | 896 |
net/openvswitch/flow.c
... | ... | @@ -70,6 +70,7 @@ |
70 | 70 | { |
71 | 71 | struct flow_stats *stats; |
72 | 72 | int node = numa_node_id(); |
73 | + int len = skb->len + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0); | |
73 | 74 | |
74 | 75 | stats = rcu_dereference(flow->stats[node]); |
75 | 76 | |
... | ... | @@ -105,7 +106,7 @@ |
105 | 106 | if (likely(new_stats)) { |
106 | 107 | new_stats->used = jiffies; |
107 | 108 | new_stats->packet_count = 1; |
108 | - new_stats->byte_count = skb->len; | |
109 | + new_stats->byte_count = len; | |
109 | 110 | new_stats->tcp_flags = tcp_flags; |
110 | 111 | spin_lock_init(&new_stats->lock); |
111 | 112 | |
... | ... | @@ -120,7 +121,7 @@ |
120 | 121 | |
121 | 122 | stats->used = jiffies; |
122 | 123 | stats->packet_count++; |
123 | - stats->byte_count += skb->len; | |
124 | + stats->byte_count += len; | |
124 | 125 | stats->tcp_flags |= tcp_flags; |
125 | 126 | unlock: |
126 | 127 | spin_unlock(&stats->lock); |
net/openvswitch/vport.c
... | ... | @@ -480,7 +480,7 @@ |
480 | 480 | stats = this_cpu_ptr(vport->percpu_stats); |
481 | 481 | u64_stats_update_begin(&stats->syncp); |
482 | 482 | stats->rx_packets++; |
483 | - stats->rx_bytes += skb->len; | |
483 | + stats->rx_bytes += skb->len + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0); | |
484 | 484 | u64_stats_update_end(&stats->syncp); |
485 | 485 | |
486 | 486 | OVS_CB(skb)->input_vport = vport; |