aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/allwinner/sun4i-emac.c4
-rw-r--r--drivers/net/ethernet/altera/altera_tse_main.c15
-rw-r--r--drivers/net/ethernet/cisco/enic/enic_main.c6
-rw-r--r--drivers/net/ethernet/intel/e100.c2
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_debugfs.c4
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_82575.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c13
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mr.c9
-rw-r--r--drivers/net/ethernet/myricom/myri10ge/myri10ge.c4
-rw-r--r--drivers/net/ethernet/qlogic/qla3xxx.c8
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c1
-rw-r--r--drivers/net/ethernet/ti/cpsw.c19
-rw-r--r--drivers/net/ethernet/xilinx/ll_temac_main.c2
-rw-r--r--drivers/net/ethernet/xilinx/xilinx_axienet_main.c2
-rw-r--r--drivers/net/ethernet/xilinx/xilinx_emaclite.c1
-rw-r--r--drivers/net/usb/qmi_wwan.c10
-rw-r--r--drivers/net/usb/r8152.c17
-rw-r--r--drivers/net/xen-netback/xenbus.c1
-rw-r--r--include/net/mac80211.h7
-rw-r--r--net/batman-adv/multicast.c11
-rw-r--r--net/batman-adv/network-coding.c2
-rw-r--r--net/batman-adv/originator.c7
-rw-r--r--net/batman-adv/routing.c6
-rw-r--r--net/ipv4/tcp_output.c4
-rw-r--r--net/mac80211/key.c12
-rw-r--r--net/openvswitch/flow.c5
-rw-r--r--net/openvswitch/vport.c2
27 files changed, 105 insertions, 71 deletions
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
index 1fcd5568a352..f3470d96837a 100644
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
@@ -850,8 +850,10 @@ static int emac_probe(struct platform_device *pdev)
850 } 850 }
851 851
852 db->clk = devm_clk_get(&pdev->dev, NULL); 852 db->clk = devm_clk_get(&pdev->dev, NULL);
853 if (IS_ERR(db->clk)) 853 if (IS_ERR(db->clk)) {
854 ret = PTR_ERR(db->clk);
854 goto out; 855 goto out;
856 }
855 857
856 clk_prepare_enable(db->clk); 858 clk_prepare_enable(db->clk);
857 859
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index 3498760dc22a..760c72c6e2ac 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -1170,10 +1170,6 @@ tx_request_irq_error:
1170init_error: 1170init_error:
1171 free_skbufs(dev); 1171 free_skbufs(dev);
1172alloc_skbuf_error: 1172alloc_skbuf_error:
1173 if (priv->phydev) {
1174 phy_disconnect(priv->phydev);
1175 priv->phydev = NULL;
1176 }
1177phy_error: 1173phy_error:
1178 return ret; 1174 return ret;
1179} 1175}
@@ -1186,12 +1182,9 @@ static int tse_shutdown(struct net_device *dev)
1186 int ret; 1182 int ret;
1187 unsigned long int flags; 1183 unsigned long int flags;
1188 1184
1189 /* Stop and disconnect the PHY */ 1185 /* Stop the PHY */
1190 if (priv->phydev) { 1186 if (priv->phydev)
1191 phy_stop(priv->phydev); 1187 phy_stop(priv->phydev);
1192 phy_disconnect(priv->phydev);
1193 priv->phydev = NULL;
1194 }
1195 1188
1196 netif_stop_queue(dev); 1189 netif_stop_queue(dev);
1197 napi_disable(&priv->napi); 1190 napi_disable(&priv->napi);
@@ -1525,6 +1518,10 @@ err_free_netdev:
1525static int altera_tse_remove(struct platform_device *pdev) 1518static int altera_tse_remove(struct platform_device *pdev)
1526{ 1519{
1527 struct net_device *ndev = platform_get_drvdata(pdev); 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 platform_set_drvdata(pdev, NULL); 1526 platform_set_drvdata(pdev, NULL);
1530 altera_tse_mdio_destroy(ndev); 1527 altera_tse_mdio_destroy(ndev);
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 705f334ebb85..b29e027c476e 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -1616,7 +1616,7 @@ static int enic_open(struct net_device *netdev)
1616 if (vnic_rq_desc_used(&enic->rq[i]) == 0) { 1616 if (vnic_rq_desc_used(&enic->rq[i]) == 0) {
1617 netdev_err(netdev, "Unable to alloc receive buffers\n"); 1617 netdev_err(netdev, "Unable to alloc receive buffers\n");
1618 err = -ENOMEM; 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 @@ static int enic_open(struct net_device *netdev)
1649 1649
1650 return 0; 1650 return 0;
1651 1651
1652err_out_notify_unset: 1652err_out_free_rq:
1653 for (i = 0; i < enic->rq_count; i++)
1654 vnic_rq_clean(&enic->rq[i], enic_free_rq_buf);
1653 enic_dev_notify_unset(enic); 1655 enic_dev_notify_unset(enic);
1654err_out_free_intr: 1656err_out_free_intr:
1655 enic_free_intr(enic); 1657 enic_free_intr(enic);
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 781065eb5431..e9c3a87e5b11 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -1543,7 +1543,7 @@ static int e100_phy_init(struct nic *nic)
1543 mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr); 1543 mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr);
1544 } else if ((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && 1544 } else if ((nic->mac >= mac_82550_D102) || ((nic->flags & ich) &&
1545 (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) && 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 /* enable/disable MDI/MDI-X auto-switching. */ 1547 /* enable/disable MDI/MDI-X auto-switching. */
1548 mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, 1548 mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG,
1549 nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH); 1549 nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
index 433a55886ad2..cb0de455683e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
@@ -829,7 +829,7 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
829 if (desc_n >= ring->count || desc_n < 0) { 829 if (desc_n >= ring->count || desc_n < 0) {
830 dev_info(&pf->pdev->dev, 830 dev_info(&pf->pdev->dev,
831 "descriptor %d not found\n", desc_n); 831 "descriptor %d not found\n", desc_n);
832 return; 832 goto out;
833 } 833 }
834 if (!is_rx_ring) { 834 if (!is_rx_ring) {
835 txd = I40E_TX_DESC(ring, desc_n); 835 txd = I40E_TX_DESC(ring, desc_n);
@@ -855,6 +855,8 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
855 } else { 855 } else {
856 dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n"); 856 dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n");
857 } 857 }
858
859out:
858 kfree(ring); 860 kfree(ring);
859} 861}
860 862
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index 051ea94bdcd3..0f69ef81751a 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -1125,7 +1125,7 @@ static s32 igb_acquire_swfw_sync_82575(struct e1000_hw *hw, u16 mask)
1125 u32 swmask = mask; 1125 u32 swmask = mask;
1126 u32 fwmask = mask << 16; 1126 u32 fwmask = mask << 16;
1127 s32 ret_val = 0; 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 while (i < timeout) { 1130 while (i < timeout) {
1131 if (igb_get_hw_semaphore(hw)) { 1131 if (igb_get_hw_semaphore(hw)) {
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 943cbd47d832..03e9eb0dc761 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -1829,7 +1829,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
1829 err = mlx4_dev_cap(dev, &dev_cap); 1829 err = mlx4_dev_cap(dev, &dev_cap);
1830 if (err) { 1830 if (err) {
1831 mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n"); 1831 mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n");
1832 goto err_stop_fw; 1832 return err;
1833 } 1833 }
1834 1834
1835 choose_steering_mode(dev, &dev_cap); 1835 choose_steering_mode(dev, &dev_cap);
@@ -1860,7 +1860,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
1860 &init_hca); 1860 &init_hca);
1861 if ((long long) icm_size < 0) { 1861 if ((long long) icm_size < 0) {
1862 err = icm_size; 1862 err = icm_size;
1863 goto err_stop_fw; 1863 return err;
1864 } 1864 }
1865 1865
1866 dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1; 1866 dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1;
@@ -1874,7 +1874,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
1874 1874
1875 err = mlx4_init_icm(dev, &dev_cap, &init_hca, icm_size); 1875 err = mlx4_init_icm(dev, &dev_cap, &init_hca, icm_size);
1876 if (err) 1876 if (err)
1877 goto err_stop_fw; 1877 return err;
1878 1878
1879 err = mlx4_INIT_HCA(dev, &init_hca); 1879 err = mlx4_INIT_HCA(dev, &init_hca);
1880 if (err) { 1880 if (err) {
@@ -1886,7 +1886,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
1886 err = mlx4_query_func(dev, &dev_cap); 1886 err = mlx4_query_func(dev, &dev_cap);
1887 if (err < 0) { 1887 if (err < 0) {
1888 mlx4_err(dev, "QUERY_FUNC command failed, aborting.\n"); 1888 mlx4_err(dev, "QUERY_FUNC command failed, aborting.\n");
1889 goto err_stop_fw; 1889 goto err_close;
1890 } else if (err & MLX4_QUERY_FUNC_NUM_SYS_EQS) { 1890 } else if (err & MLX4_QUERY_FUNC_NUM_SYS_EQS) {
1891 dev->caps.num_eqs = dev_cap.max_eqs; 1891 dev->caps.num_eqs = dev_cap.max_eqs;
1892 dev->caps.reserved_eqs = dev_cap.reserved_eqs; 1892 dev->caps.reserved_eqs = dev_cap.reserved_eqs;
@@ -2006,11 +2006,6 @@ err_free_icm:
2006 if (!mlx4_is_slave(dev)) 2006 if (!mlx4_is_slave(dev))
2007 mlx4_free_icms(dev); 2007 mlx4_free_icms(dev);
2008 2008
2009err_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 return err; 2009 return err;
2015} 2010}
2016 2011
diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c
index d6f549685c0f..7094a9c70fd5 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mr.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mr.c
@@ -584,6 +584,7 @@ EXPORT_SYMBOL_GPL(mlx4_mr_free);
584void mlx4_mr_rereg_mem_cleanup(struct mlx4_dev *dev, struct mlx4_mr *mr) 584void mlx4_mr_rereg_mem_cleanup(struct mlx4_dev *dev, struct mlx4_mr *mr)
585{ 585{
586 mlx4_mtt_cleanup(dev, &mr->mtt); 586 mlx4_mtt_cleanup(dev, &mr->mtt);
587 mr->mtt.order = -1;
587} 588}
588EXPORT_SYMBOL_GPL(mlx4_mr_rereg_mem_cleanup); 589EXPORT_SYMBOL_GPL(mlx4_mr_rereg_mem_cleanup);
589 590
@@ -593,14 +594,14 @@ int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr,
593{ 594{
594 int err; 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 err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); 597 err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt);
601 if (err) 598 if (err)
602 return err; 599 return err;
603 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);
604
604 mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK | 605 mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK |
605 MLX4_MPT_PD_FLAG_EN_INV); 606 MLX4_MPT_PD_FLAG_EN_INV);
606 mpt_entry->flags &= cpu_to_be32(MLX4_MPT_FLAG_FREE | 607 mpt_entry->flags &= cpu_to_be32(MLX4_MPT_FLAG_FREE |
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index af099057f0e9..71af98bb72cb 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -4033,8 +4033,10 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
4033 (void)pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); 4033 (void)pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
4034 mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), 4034 mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd),
4035 &mgp->cmd_bus, GFP_KERNEL); 4035 &mgp->cmd_bus, GFP_KERNEL);
4036 if (mgp->cmd == NULL) 4036 if (!mgp->cmd) {
4037 status = -ENOMEM;
4037 goto abort_with_enabled; 4038 goto abort_with_enabled;
4039 }
4038 4040
4039 mgp->board_span = pci_resource_len(pdev, 0); 4041 mgp->board_span = pci_resource_len(pdev, 0);
4040 mgp->iomem_base = pci_resource_start(pdev, 0); 4042 mgp->iomem_base = pci_resource_start(pdev, 0);
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
index c2f09af5c25b..4847713211ca 100644
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
@@ -146,10 +146,7 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev)
146{ 146{
147 int i = 0; 147 int i = 0;
148 148
149 while (i < 10) { 149 do {
150 if (i)
151 ssleep(1);
152
153 if (ql_sem_lock(qdev, 150 if (ql_sem_lock(qdev,
154 QL_DRVR_SEM_MASK, 151 QL_DRVR_SEM_MASK,
155 (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) 152 (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index)
@@ -158,7 +155,8 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev)
158 "driver lock acquired\n"); 155 "driver lock acquired\n");
159 return 1; 156 return 1;
160 } 157 }
161 } 158 ssleep(1);
159 } while (++i < 10);
162 160
163 netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n"); 161 netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n");
164 return 0; 162 return 0;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 9929b97cfb36..2528c3fb6b90 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2605,6 +2605,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2605 } else { 2605 } else {
2606 dev_err(&pdev->dev, 2606 dev_err(&pdev->dev,
2607 "%s: failed. Please Reboot\n", __func__); 2607 "%s: failed. Please Reboot\n", __func__);
2608 err = -ENODEV;
2608 goto err_out_free_hw; 2609 goto err_out_free_hw;
2609 } 2610 }
2610 2611
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index c560f9aeb55d..e61ee8351272 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -757,6 +757,14 @@ requeue:
757static irqreturn_t cpsw_interrupt(int irq, void *dev_id) 757static irqreturn_t cpsw_interrupt(int irq, void *dev_id)
758{ 758{
759 struct cpsw_priv *priv = dev_id; 759 struct cpsw_priv *priv = dev_id;
760 int value = irq - priv->irqs_table[0];
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);
760 768
761 cpsw_intr_disable(priv); 769 cpsw_intr_disable(priv);
762 if (priv->irq_enabled == true) { 770 if (priv->irq_enabled == true) {
@@ -786,8 +794,6 @@ static int cpsw_poll(struct napi_struct *napi, int budget)
786 int num_tx, num_rx; 794 int num_tx, num_rx;
787 795
788 num_tx = cpdma_chan_process(priv->txch, 128); 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 num_rx = cpdma_chan_process(priv->rxch, budget); 798 num_rx = cpdma_chan_process(priv->rxch, budget);
793 if (num_rx < budget) { 799 if (num_rx < budget) {
@@ -795,7 +801,6 @@ static int cpsw_poll(struct napi_struct *napi, int budget)
795 801
796 napi_complete(napi); 802 napi_complete(napi);
797 cpsw_intr_enable(priv); 803 cpsw_intr_enable(priv);
798 cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
799 prim_cpsw = cpsw_get_slave_priv(priv, 0); 804 prim_cpsw = cpsw_get_slave_priv(priv, 0);
800 if (prim_cpsw->irq_enabled == false) { 805 if (prim_cpsw->irq_enabled == false) {
801 prim_cpsw->irq_enabled = true; 806 prim_cpsw->irq_enabled = true;
@@ -1310,8 +1315,6 @@ static int cpsw_ndo_open(struct net_device *ndev)
1310 napi_enable(&priv->napi); 1315 napi_enable(&priv->napi);
1311 cpdma_ctlr_start(priv->dma); 1316 cpdma_ctlr_start(priv->dma);
1312 cpsw_intr_enable(priv); 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 prim_cpsw = cpsw_get_slave_priv(priv, 0); 1319 prim_cpsw = cpsw_get_slave_priv(priv, 0);
1317 if (prim_cpsw->irq_enabled == false) { 1320 if (prim_cpsw->irq_enabled == false) {
@@ -1578,9 +1581,6 @@ static void cpsw_ndo_tx_timeout(struct net_device *ndev)
1578 cpdma_chan_start(priv->txch); 1581 cpdma_chan_start(priv->txch);
1579 cpdma_ctlr_int_ctrl(priv->dma, true); 1582 cpdma_ctlr_int_ctrl(priv->dma, true);
1580 cpsw_intr_enable(priv); 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
1586static int cpsw_ndo_set_mac_address(struct net_device *ndev, void *p) 1586static int cpsw_ndo_set_mac_address(struct net_device *ndev, void *p)
@@ -1620,9 +1620,6 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev)
1620 cpsw_interrupt(ndev->irq, priv); 1620 cpsw_interrupt(ndev->irq, priv);
1621 cpdma_ctlr_int_ctrl(priv->dma, true); 1621 cpdma_ctlr_int_ctrl(priv->dma, true);
1622 cpsw_intr_enable(priv); 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#endif 1624#endif
1628 1625
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 9c2d91ea0af4..dbcbf0c5bcfa 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -1043,6 +1043,7 @@ static int temac_of_probe(struct platform_device *op)
1043 lp->regs = of_iomap(op->dev.of_node, 0); 1043 lp->regs = of_iomap(op->dev.of_node, 0);
1044 if (!lp->regs) { 1044 if (!lp->regs) {
1045 dev_err(&op->dev, "could not map temac regs.\n"); 1045 dev_err(&op->dev, "could not map temac regs.\n");
1046 rc = -ENOMEM;
1046 goto nodev; 1047 goto nodev;
1047 } 1048 }
1048 1049
@@ -1062,6 +1063,7 @@ static int temac_of_probe(struct platform_device *op)
1062 np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); 1063 np = of_parse_phandle(op->dev.of_node, "llink-connected", 0);
1063 if (!np) { 1064 if (!np) {
1064 dev_err(&op->dev, "could not find DMA node\n"); 1065 dev_err(&op->dev, "could not find DMA node\n");
1066 rc = -ENODEV;
1065 goto err_iounmap; 1067 goto err_iounmap;
1066 } 1068 }
1067 1069
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index c18a0c637c44..a6d2860b712c 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1501,6 +1501,7 @@ static int axienet_of_probe(struct platform_device *op)
1501 lp->regs = of_iomap(op->dev.of_node, 0); 1501 lp->regs = of_iomap(op->dev.of_node, 0);
1502 if (!lp->regs) { 1502 if (!lp->regs) {
1503 dev_err(&op->dev, "could not map Axi Ethernet regs.\n"); 1503 dev_err(&op->dev, "could not map Axi Ethernet regs.\n");
1504 ret = -ENOMEM;
1504 goto nodev; 1505 goto nodev;
1505 } 1506 }
1506 /* Setup checksum offload, but default to off if not specified */ 1507 /* Setup checksum offload, but default to off if not specified */
@@ -1563,6 +1564,7 @@ static int axienet_of_probe(struct platform_device *op)
1563 np = of_parse_phandle(op->dev.of_node, "axistream-connected", 0); 1564 np = of_parse_phandle(op->dev.of_node, "axistream-connected", 0);
1564 if (!np) { 1565 if (!np) {
1565 dev_err(&op->dev, "could not find DMA node\n"); 1566 dev_err(&op->dev, "could not find DMA node\n");
1567 ret = -ENODEV;
1566 goto err_iounmap; 1568 goto err_iounmap;
1567 } 1569 }
1568 lp->dma_regs = of_iomap(np, 0); 1570 lp->dma_regs = of_iomap(np, 0);
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 24858799c204..9d4ce388510a 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -1109,6 +1109,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
1109 res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0); 1109 res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0);
1110 if (!res) { 1110 if (!res) {
1111 dev_err(dev, "no IRQ found\n"); 1111 dev_err(dev, "no IRQ found\n");
1112 rc = -ENXIO;
1112 goto error; 1113 goto error;
1113 } 1114 }
1114 1115
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index b8a82b86f909..602dc6668c3a 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -56,6 +56,8 @@ struct qmi_wwan_state {
56/* default ethernet address used by the modem */ 56/* default ethernet address used by the modem */
57static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3}; 57static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3};
58 58
59static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00};
60
59/* Make up an ethernet header if the packet doesn't have one. 61/* Make up an ethernet header if the packet doesn't have one.
60 * 62 *
61 * A firmware bug common among several devices cause them to send raw 63 * A firmware bug common among several devices cause them to send raw
@@ -332,10 +334,12 @@ next_desc:
332 usb_driver_release_interface(driver, info->data); 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 337 /* Never use the same address on both ends of the link, even if the
336 * if the buggy firmware told us to. 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 eth_hw_addr_random(dev->net); 343 eth_hw_addr_random(dev->net);
340 344
341 /* make MAC addr easily distinguishable from an IP header */ 345 /* make MAC addr easily distinguishable from an IP header */
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 2d1c77e81836..57ec23e8ccfa 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -1897,6 +1897,22 @@ static void _rtl8152_set_rx_mode(struct net_device *netdev)
1897 netif_wake_queue(netdev); 1897 netif_wake_queue(netdev);
1898} 1898}
1899 1899
1900static netdev_features_t
1901rtl8152_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
1900static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb, 1916static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb,
1901 struct net_device *netdev) 1917 struct net_device *netdev)
1902{ 1918{
@@ -3706,6 +3722,7 @@ static const struct net_device_ops rtl8152_netdev_ops = {
3706 .ndo_set_mac_address = rtl8152_set_mac_address, 3722 .ndo_set_mac_address = rtl8152_set_mac_address,
3707 .ndo_change_mtu = rtl8152_change_mtu, 3723 .ndo_change_mtu = rtl8152_change_mtu,
3708 .ndo_validate_addr = eth_validate_addr, 3724 .ndo_validate_addr = eth_validate_addr,
3725 .ndo_features_check = rtl8152_features_check,
3709}; 3726};
3710 3727
3711static void r8152b_get_version(struct r8152 *tp) 3728static void r8152b_get_version(struct r8152 *tp)
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index efbaf2ae1999..794204e34fba 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -737,6 +737,7 @@ static void connect(struct backend_info *be)
737 } 737 }
738 738
739 queue->remaining_credit = credit_bytes; 739 queue->remaining_credit = credit_bytes;
740 queue->credit_usec = credit_usec;
740 741
741 err = connect_rings(be, queue); 742 err = connect_rings(be, queue);
742 if (err) { 743 if (err) {
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 58d719ddaa60..29c7be8808d5 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1270,8 +1270,7 @@ struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
1270 * 1270 *
1271 * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the 1271 * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the
1272 * driver to indicate that it requires IV generation for this 1272 * driver to indicate that it requires IV generation for this
1273 * particular key. Setting this flag does not necessarily mean that SKBs 1273 * particular key.
1274 * will have sufficient tailroom for ICV or MIC.
1275 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by 1274 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by
1276 * the driver for a TKIP key if it requires Michael MIC 1275 * the driver for a TKIP key if it requires Michael MIC
1277 * generation in software. 1276 * generation in software.
@@ -1283,9 +1282,7 @@ struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
1283 * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver 1282 * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver
1284 * if space should be prepared for the IV, but the IV 1283 * if space should be prepared for the IV, but the IV
1285 * itself should not be generated. Do not set together with 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 1285 * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key.
1287 * not necessarily mean that SKBs will have sufficient tailroom for ICV or
1288 * MIC.
1289 * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received 1286 * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received
1290 * management frames. The flag can help drivers that have a hardware 1287 * management frames. The flag can help drivers that have a hardware
1291 * crypto implementation that doesn't deal with management frames 1288 * crypto implementation that doesn't deal with management frames
diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index ab6bb2af1d45..b24e4bb64fb5 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -685,11 +685,13 @@ static void batadv_mcast_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
685 if (orig_initialized) 685 if (orig_initialized)
686 atomic_dec(&bat_priv->mcast.num_disabled); 686 atomic_dec(&bat_priv->mcast.num_disabled);
687 orig->capabilities |= BATADV_ORIG_CAPA_HAS_MCAST; 687 orig->capabilities |= BATADV_ORIG_CAPA_HAS_MCAST;
688 /* If mcast support is being switched off increase the disabled 688 /* If mcast support is being switched off or if this is an initial
689 * mcast node counter. 689 * OGM without mcast support then increase the disabled mcast
690 * node counter.
690 */ 691 */
691 } else if (!orig_mcast_enabled && 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 atomic_inc(&bat_priv->mcast.num_disabled); 695 atomic_inc(&bat_priv->mcast.num_disabled);
694 orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_MCAST; 696 orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_MCAST;
695 } 697 }
@@ -738,7 +740,8 @@ void batadv_mcast_purge_orig(struct batadv_orig_node *orig)
738{ 740{
739 struct batadv_priv *bat_priv = orig->bat_priv; 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 atomic_dec(&bat_priv->mcast.num_disabled); 745 atomic_dec(&bat_priv->mcast.num_disabled);
743 746
744 batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS); 747 batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS);
diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c
index 8d04d174669e..fab47f1f3ef9 100644
--- a/net/batman-adv/network-coding.c
+++ b/net/batman-adv/network-coding.c
@@ -133,7 +133,7 @@ int batadv_nc_mesh_init(struct batadv_priv *bat_priv)
133 if (!bat_priv->nc.decoding_hash) 133 if (!bat_priv->nc.decoding_hash)
134 goto err; 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 &batadv_nc_decoding_hash_lock_class_key); 137 &batadv_nc_decoding_hash_lock_class_key);
138 138
139 INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker); 139 INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker);
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 6a484514cd3e..bea8198d0198 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -570,9 +570,6 @@ static void batadv_orig_node_free_rcu(struct rcu_head *rcu)
570 570
571 batadv_frag_purge_orig(orig_node, NULL); 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 if (orig_node->bat_priv->bat_algo_ops->bat_orig_free) 573 if (orig_node->bat_priv->bat_algo_ops->bat_orig_free)
577 orig_node->bat_priv->bat_algo_ops->bat_orig_free(orig_node); 574 orig_node->bat_priv->bat_algo_ops->bat_orig_free(orig_node);
578 575
@@ -678,6 +675,7 @@ struct batadv_orig_node *batadv_orig_node_new(struct batadv_priv *bat_priv,
678 atomic_set(&orig_node->last_ttvn, 0); 675 atomic_set(&orig_node->last_ttvn, 0);
679 orig_node->tt_buff = NULL; 676 orig_node->tt_buff = NULL;
680 orig_node->tt_buff_len = 0; 677 orig_node->tt_buff_len = 0;
678 orig_node->last_seen = jiffies;
681 reset_time = jiffies - 1 - msecs_to_jiffies(BATADV_RESET_PROTECTION_MS); 679 reset_time = jiffies - 1 - msecs_to_jiffies(BATADV_RESET_PROTECTION_MS);
682 orig_node->bcast_seqno_reset = reset_time; 680 orig_node->bcast_seqno_reset = reset_time;
683#ifdef CONFIG_BATMAN_ADV_MCAST 681#ifdef CONFIG_BATMAN_ADV_MCAST
@@ -977,6 +975,9 @@ static void _batadv_purge_orig(struct batadv_priv *bat_priv)
977 if (batadv_purge_orig_node(bat_priv, orig_node)) { 975 if (batadv_purge_orig_node(bat_priv, orig_node)) {
978 batadv_gw_node_delete(bat_priv, orig_node); 976 batadv_gw_node_delete(bat_priv, orig_node);
979 hlist_del_rcu(&orig_node->hash_entry); 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 batadv_orig_node_free_ref(orig_node); 981 batadv_orig_node_free_ref(orig_node);
981 continue; 982 continue;
982 } 983 }
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 35f76f2f7824..6648f321864d 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -443,11 +443,13 @@ batadv_find_router(struct batadv_priv *bat_priv,
443 443
444 router = batadv_orig_router_get(orig_node, recv_if); 444 router = batadv_orig_router_get(orig_node, recv_if);
445 445
446 if (!router)
447 return router;
448
446 /* only consider bonding for recv_if == BATADV_IF_DEFAULT (first hop) 449 /* only consider bonding for recv_if == BATADV_IF_DEFAULT (first hop)
447 * and if activated. 450 * and if activated.
448 */ 451 */
449 if (recv_if == BATADV_IF_DEFAULT || !atomic_read(&bat_priv->bonding) || 452 if (!(recv_if == BATADV_IF_DEFAULT && atomic_read(&bat_priv->bonding)))
450 !router)
451 return router; 453 return router;
452 454
453 /* bonding: loop through the list of possible routers found 455 /* bonding: loop through the list of possible routers found
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 7f18262e2326..65caf8b95e17 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2019,7 +2019,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
2019 if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now))) 2019 if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now)))
2020 break; 2020 break;
2021 2021
2022 if (tso_segs == 1) { 2022 if (tso_segs == 1 || !max_segs) {
2023 if (unlikely(!tcp_nagle_test(tp, skb, mss_now, 2023 if (unlikely(!tcp_nagle_test(tp, skb, mss_now,
2024 (tcp_skb_is_last(sk, skb) ? 2024 (tcp_skb_is_last(sk, skb) ?
2025 nonagle : TCP_NAGLE_PUSH)))) 2025 nonagle : TCP_NAGLE_PUSH))))
@@ -2032,7 +2032,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
2032 } 2032 }
2033 2033
2034 limit = mss_now; 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 limit = tcp_mss_split_point(sk, skb, mss_now, 2036 limit = tcp_mss_split_point(sk, skb, mss_now,
2037 min_t(unsigned int, 2037 min_t(unsigned int,
2038 cwnd_quota, 2038 cwnd_quota,
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 0bb7038121ac..bd4e46ec32bd 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -140,7 +140,9 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
140 if (!ret) { 140 if (!ret) {
141 key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; 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 sdata->crypto_tx_tailroom_needed_cnt--; 146 sdata->crypto_tx_tailroom_needed_cnt--;
145 147
146 WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) && 148 WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) &&
@@ -188,7 +190,9 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
188 sta = key->sta; 190 sta = key->sta;
189 sdata = key->sdata; 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 increment_tailroom_need_count(sdata); 196 increment_tailroom_need_count(sdata);
193 197
194 ret = drv_set_key(key->local, DISABLE_KEY, sdata, 198 ret = drv_set_key(key->local, DISABLE_KEY, sdata,
@@ -884,7 +888,9 @@ void ieee80211_remove_key(struct ieee80211_key_conf *keyconf)
884 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) { 888 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
885 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; 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 increment_tailroom_need_count(key->sdata); 894 increment_tailroom_need_count(key->sdata);
889 } 895 }
890 896
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index 70bef2ab7f2b..da2fae0873a5 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -70,6 +70,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
70{ 70{
71 struct flow_stats *stats; 71 struct flow_stats *stats;
72 int node = numa_node_id(); 72 int node = numa_node_id();
73 int len = skb->len + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0);
73 74
74 stats = rcu_dereference(flow->stats[node]); 75 stats = rcu_dereference(flow->stats[node]);
75 76
@@ -105,7 +106,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
105 if (likely(new_stats)) { 106 if (likely(new_stats)) {
106 new_stats->used = jiffies; 107 new_stats->used = jiffies;
107 new_stats->packet_count = 1; 108 new_stats->packet_count = 1;
108 new_stats->byte_count = skb->len; 109 new_stats->byte_count = len;
109 new_stats->tcp_flags = tcp_flags; 110 new_stats->tcp_flags = tcp_flags;
110 spin_lock_init(&new_stats->lock); 111 spin_lock_init(&new_stats->lock);
111 112
@@ -120,7 +121,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
120 121
121 stats->used = jiffies; 122 stats->used = jiffies;
122 stats->packet_count++; 123 stats->packet_count++;
123 stats->byte_count += skb->len; 124 stats->byte_count += len;
124 stats->tcp_flags |= tcp_flags; 125 stats->tcp_flags |= tcp_flags;
125unlock: 126unlock:
126 spin_unlock(&stats->lock); 127 spin_unlock(&stats->lock);
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index 53f3ebbfceab..2034c6d9cb5a 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -480,7 +480,7 @@ void ovs_vport_receive(struct vport *vport, struct sk_buff *skb,
480 stats = this_cpu_ptr(vport->percpu_stats); 480 stats = this_cpu_ptr(vport->percpu_stats);
481 u64_stats_update_begin(&stats->syncp); 481 u64_stats_update_begin(&stats->syncp);
482 stats->rx_packets++; 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 u64_stats_update_end(&stats->syncp); 484 u64_stats_update_end(&stats->syncp);
485 485
486 OVS_CB(skb)->input_vport = vport; 486 OVS_CB(skb)->input_vport = vport;