Skip to content

Commit 1cef935

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) ping_err() ICMP error handler looks at wrong ICMP header, from Li Wei. 2) TCP socket hash function on ipv6 is too weak, from Eric Dumazet. 3) netif_set_xps_queue() forgets to drop mutex on errors, fix from Alexander Duyck. 4) sum_frag_mem_limit() can deadlock due to lack of BH disabling, fix from Eric Dumazet. 5) TCP SYN data is miscalculated in tcp_send_syn_data(), because the amount of TCP option space was not taken into account properly in this code path. Fix from yuchung Cheng. 6) MLX4 driver allocates device queues with the wrong size, from Kleber Sacilotto. 7) sock_diag can access past the end of the sock_diag_handlers[] array, from Mathias Krause. 8) vlan_set_encap_proto() makes incorrect assumptions about where skb->data points, rework the logic so that it works regardless of where skb->data happens to be. From Jesse Gross. 9) Fix gianfar build failure with NET_POLL enabled, from Paul Gortmaker. 10) Fix Ipv4 ID setting and checksum calculations in GRE driver, from Pravin B Shelar. 11) bgmac driver does: int i; for (i = 0; ...; ...) { ... for (i = 0; ...; ...) { effectively corrupting the outer loop index, use a seperate variable for the inner loops. From Rafał Miłecki. 12) Fix suspend bugs in smsc95xx driver, from Ming Lei. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (35 commits) usbnet: smsc95xx: rename FEATURE_AUTOSUSPEND usbnet: smsc95xx: fix broken runtime suspend usbnet: smsc95xx: fix suspend failure bgmac: fix indexing of 2nd level loops b43: Fix lockdep splat on module unload Revert "ip_gre: propogate target device GSO capability to the tunnel device" IP_GRE: Fix GRE_CSUM case. VXLAN: Use tunnel_ip_select_ident() for tunnel IP-Identification. IP_GRE: Fix IP-Identification. net/pasemi: Fix missing coding style vmxnet3: fix ethtool ring buffer size setting vmxnet3: make local function static bnx2x: remove dead code and make local funcs static gianfar: fix compile fail for NET_POLL=y due to struct packing vlan: adjust vlan_set_encap_proto() for its callers sock_diag: Simplify sock_diag_handlers[] handling in __sock_diag_rcv_msg sock_diag: Fix out-of-bounds access to sock_diag_handlers[] vxlan: remove depends on CONFIG_EXPERIMENTAL mlx4_en: fix allocation of CPU affinity reverse-map mlx4_en: fix allocation of device tx_cq ...
2 parents ecc88ef + eb970ff commit 1cef935

33 files changed

Lines changed: 218 additions & 233 deletions

File tree

‎drivers/net/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ config MACVTAP
150150

151151
config VXLAN
152152
tristate "Virtual eXtensible Local Area Network (VXLAN)"
153-
depends on EXPERIMENTAL && INET
153+
depends on INET
154154
---help---
155155
This allows one to create vxlan virtual interfaces that provide
156156
Layer 2 Networks over Layer 3 Networks. VXLAN is often used

‎drivers/net/ethernet/broadcom/bgmac.c‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,8 @@ static int bgmac_dma_alloc(struct bgmac *bgmac)
436436
}
437437

438438
for (i = 0; i < BGMAC_MAX_RX_RINGS; i++) {
439+
int j;
440+
439441
ring = &bgmac->rx_ring[i];
440442
ring->num_slots = BGMAC_RX_RING_SLOTS;
441443
ring->mmio_base = ring_base[i];
@@ -458,8 +460,8 @@ static int bgmac_dma_alloc(struct bgmac *bgmac)
458460
bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n");
459461

460462
/* Alloc RX slots */
461-
for (i = 0; i < ring->num_slots; i++) {
462-
err = bgmac_dma_rx_skb_for_slot(bgmac, &ring->slots[i]);
463+
for (j = 0; j < ring->num_slots; j++) {
464+
err = bgmac_dma_rx_skb_for_slot(bgmac, &ring->slots[j]);
463465
if (err) {
464466
bgmac_err(bgmac, "Can't allocate skb for slot in RX ring\n");
465467
goto err_dma_free;
@@ -496,6 +498,8 @@ static void bgmac_dma_init(struct bgmac *bgmac)
496498
}
497499

498500
for (i = 0; i < BGMAC_MAX_RX_RINGS; i++) {
501+
int j;
502+
499503
ring = &bgmac->rx_ring[i];
500504

501505
/* We don't implement unaligned addressing, so enable first */
@@ -505,20 +509,20 @@ static void bgmac_dma_init(struct bgmac *bgmac)
505509
bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_RX_RINGHI,
506510
upper_32_bits(ring->dma_base));
507511

508-
for (i = 0, dma_desc = ring->cpu_base; i < ring->num_slots;
509-
i++, dma_desc++) {
512+
for (j = 0, dma_desc = ring->cpu_base; j < ring->num_slots;
513+
j++, dma_desc++) {
510514
ctl0 = ctl1 = 0;
511515

512-
if (i == ring->num_slots - 1)
516+
if (j == ring->num_slots - 1)
513517
ctl0 |= BGMAC_DESC_CTL0_EOT;
514518
ctl1 |= BGMAC_RX_BUF_SIZE & BGMAC_DESC_CTL1_LEN;
515519
/* Is there any BGMAC device that requires extension? */
516520
/* ctl1 |= (addrext << B43_DMA64_DCTL1_ADDREXT_SHIFT) &
517521
* B43_DMA64_DCTL1_ADDREXT_MASK;
518522
*/
519523

520-
dma_desc->addr_low = cpu_to_le32(lower_32_bits(ring->slots[i].dma_addr));
521-
dma_desc->addr_high = cpu_to_le32(upper_32_bits(ring->slots[i].dma_addr));
524+
dma_desc->addr_low = cpu_to_le32(lower_32_bits(ring->slots[j].dma_addr));
525+
dma_desc->addr_high = cpu_to_le32(upper_32_bits(ring->slots[j].dma_addr));
522526
dma_desc->ctl0 = cpu_to_le32(ctl0);
523527
dma_desc->ctl1 = cpu_to_le32(ctl1);
524528
}

‎drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c‎

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -13013,64 +13013,6 @@ static int bnx2x_84833_common_init_phy(struct bnx2x *bp,
1301313013
return 0;
1301413014
}
1301513015

13016-
static int bnx2x_84833_pre_init_phy(struct bnx2x *bp,
13017-
struct bnx2x_phy *phy,
13018-
u8 port)
13019-
{
13020-
u16 val, cnt;
13021-
/* Wait for FW completing its initialization. */
13022-
for (cnt = 0; cnt < 1500; cnt++) {
13023-
bnx2x_cl45_read(bp, phy,
13024-
MDIO_PMA_DEVAD,
13025-
MDIO_PMA_REG_CTRL, &val);
13026-
if (!(val & (1<<15)))
13027-
break;
13028-
usleep_range(1000, 2000);
13029-
}
13030-
if (cnt >= 1500) {
13031-
DP(NETIF_MSG_LINK, "84833 reset timeout\n");
13032-
return -EINVAL;
13033-
}
13034-
13035-
/* Put the port in super isolate mode. */
13036-
bnx2x_cl45_read(bp, phy,
13037-
MDIO_CTL_DEVAD,
13038-
MDIO_84833_TOP_CFG_XGPHY_STRAP1, &val);
13039-
val |= MDIO_84833_SUPER_ISOLATE;
13040-
bnx2x_cl45_write(bp, phy,
13041-
MDIO_CTL_DEVAD,
13042-
MDIO_84833_TOP_CFG_XGPHY_STRAP1, val);
13043-
13044-
/* Save spirom version */
13045-
bnx2x_save_848xx_spirom_version(phy, bp, port);
13046-
return 0;
13047-
}
13048-
13049-
int bnx2x_pre_init_phy(struct bnx2x *bp,
13050-
u32 shmem_base,
13051-
u32 shmem2_base,
13052-
u32 chip_id,
13053-
u8 port)
13054-
{
13055-
int rc = 0;
13056-
struct bnx2x_phy phy;
13057-
if (bnx2x_populate_phy(bp, EXT_PHY1, shmem_base, shmem2_base,
13058-
port, &phy) != 0) {
13059-
DP(NETIF_MSG_LINK, "populate_phy failed\n");
13060-
return -EINVAL;
13061-
}
13062-
bnx2x_set_mdio_clk(bp, chip_id, phy.mdio_ctrl);
13063-
switch (phy.type) {
13064-
case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833:
13065-
case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834:
13066-
rc = bnx2x_84833_pre_init_phy(bp, &phy, port);
13067-
break;
13068-
default:
13069-
break;
13070-
}
13071-
return rc;
13072-
}
13073-
1307413016
static int bnx2x_ext_phy_common_init(struct bnx2x *bp, u32 shmem_base_path[],
1307513017
u32 shmem2_base_path[], u8 phy_index,
1307613018
u32 ext_phy_type, u32 chip_id)

‎drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static inline int bnx2x_pfvf_status_codes(int rc)
9898
}
9999
}
100100

101-
int bnx2x_send_msg2pf(struct bnx2x *bp, u8 *done, dma_addr_t msg_mapping)
101+
static int bnx2x_send_msg2pf(struct bnx2x *bp, u8 *done, dma_addr_t msg_mapping)
102102
{
103103
struct cstorm_vf_zone_data __iomem *zone_data =
104104
REG_ADDR(bp, PXP_VF_ADDR_CSDM_GLOBAL_START);
@@ -141,7 +141,7 @@ int bnx2x_send_msg2pf(struct bnx2x *bp, u8 *done, dma_addr_t msg_mapping)
141141
return 0;
142142
}
143143

144-
int bnx2x_get_vf_id(struct bnx2x *bp, u32 *vf_id)
144+
static int bnx2x_get_vf_id(struct bnx2x *bp, u32 *vf_id)
145145
{
146146
u32 me_reg;
147147
int tout = 10, interval = 100; /* Wait for 1 sec */

‎drivers/net/ethernet/freescale/fec.c‎

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,24 +1782,6 @@ fec_probe(struct platform_device *pdev)
17821782
fep->phy_interface = ret;
17831783
}
17841784

1785-
for (i = 0; i < FEC_IRQ_NUM; i++) {
1786-
irq = platform_get_irq(pdev, i);
1787-
if (irq < 0) {
1788-
if (i)
1789-
break;
1790-
ret = irq;
1791-
goto failed_irq;
1792-
}
1793-
ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev);
1794-
if (ret) {
1795-
while (--i >= 0) {
1796-
irq = platform_get_irq(pdev, i);
1797-
free_irq(irq, ndev);
1798-
}
1799-
goto failed_irq;
1800-
}
1801-
}
1802-
18031785
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
18041786
if (IS_ERR(pinctrl)) {
18051787
ret = PTR_ERR(pinctrl);
@@ -1850,6 +1832,24 @@ fec_probe(struct platform_device *pdev)
18501832
if (ret)
18511833
goto failed_init;
18521834

1835+
for (i = 0; i < FEC_IRQ_NUM; i++) {
1836+
irq = platform_get_irq(pdev, i);
1837+
if (irq < 0) {
1838+
if (i)
1839+
break;
1840+
ret = irq;
1841+
goto failed_irq;
1842+
}
1843+
ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev);
1844+
if (ret) {
1845+
while (--i >= 0) {
1846+
irq = platform_get_irq(pdev, i);
1847+
free_irq(irq, ndev);
1848+
}
1849+
goto failed_irq;
1850+
}
1851+
}
1852+
18531853
ret = fec_enet_mii_init(pdev);
18541854
if (ret)
18551855
goto failed_mii_init;
@@ -1867,19 +1867,19 @@ fec_probe(struct platform_device *pdev)
18671867
fec_enet_mii_remove(fep);
18681868
failed_mii_init:
18691869
failed_init:
1870+
for (i = 0; i < FEC_IRQ_NUM; i++) {
1871+
irq = platform_get_irq(pdev, i);
1872+
if (irq > 0)
1873+
free_irq(irq, ndev);
1874+
}
1875+
failed_irq:
18701876
failed_regulator:
18711877
clk_disable_unprepare(fep->clk_ahb);
18721878
clk_disable_unprepare(fep->clk_ipg);
18731879
if (!IS_ERR(fep->clk_ptp))
18741880
clk_disable_unprepare(fep->clk_ptp);
18751881
failed_pin:
18761882
failed_clk:
1877-
for (i = 0; i < FEC_IRQ_NUM; i++) {
1878-
irq = platform_get_irq(pdev, i);
1879-
if (irq > 0)
1880-
free_irq(irq, ndev);
1881-
}
1882-
failed_irq:
18831883
iounmap(fep->hwp);
18841884
failed_ioremap:
18851885
free_netdev(ndev);
@@ -1899,17 +1899,17 @@ fec_drv_remove(struct platform_device *pdev)
18991899

19001900
unregister_netdev(ndev);
19011901
fec_enet_mii_remove(fep);
1902-
for (i = 0; i < FEC_IRQ_NUM; i++) {
1903-
int irq = platform_get_irq(pdev, i);
1904-
if (irq > 0)
1905-
free_irq(irq, ndev);
1906-
}
19071902
del_timer_sync(&fep->time_keep);
19081903
clk_disable_unprepare(fep->clk_ptp);
19091904
if (fep->ptp_clock)
19101905
ptp_clock_unregister(fep->ptp_clock);
19111906
clk_disable_unprepare(fep->clk_ahb);
19121907
clk_disable_unprepare(fep->clk_ipg);
1908+
for (i = 0; i < FEC_IRQ_NUM; i++) {
1909+
int irq = platform_get_irq(pdev, i);
1910+
if (irq > 0)
1911+
free_irq(irq, ndev);
1912+
}
19131913
iounmap(fep->hwp);
19141914
free_netdev(ndev);
19151915

‎drivers/net/ethernet/freescale/gianfar.c‎

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2906,21 +2906,23 @@ static void gfar_netpoll(struct net_device *dev)
29062906
/* If the device has multiple interrupts, run tx/rx */
29072907
if (priv->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) {
29082908
for (i = 0; i < priv->num_grps; i++) {
2909-
disable_irq(priv->gfargrp[i].interruptTransmit);
2910-
disable_irq(priv->gfargrp[i].interruptReceive);
2911-
disable_irq(priv->gfargrp[i].interruptError);
2912-
gfar_interrupt(priv->gfargrp[i].interruptTransmit,
2913-
&priv->gfargrp[i]);
2914-
enable_irq(priv->gfargrp[i].interruptError);
2915-
enable_irq(priv->gfargrp[i].interruptReceive);
2916-
enable_irq(priv->gfargrp[i].interruptTransmit);
2909+
struct gfar_priv_grp *grp = &priv->gfargrp[i];
2910+
2911+
disable_irq(gfar_irq(grp, TX)->irq);
2912+
disable_irq(gfar_irq(grp, RX)->irq);
2913+
disable_irq(gfar_irq(grp, ER)->irq);
2914+
gfar_interrupt(gfar_irq(grp, TX)->irq, grp);
2915+
enable_irq(gfar_irq(grp, ER)->irq);
2916+
enable_irq(gfar_irq(grp, RX)->irq);
2917+
enable_irq(gfar_irq(grp, TX)->irq);
29172918
}
29182919
} else {
29192920
for (i = 0; i < priv->num_grps; i++) {
2920-
disable_irq(priv->gfargrp[i].interruptTransmit);
2921-
gfar_interrupt(priv->gfargrp[i].interruptTransmit,
2922-
&priv->gfargrp[i]);
2923-
enable_irq(priv->gfargrp[i].interruptTransmit);
2921+
struct gfar_priv_grp *grp = &priv->gfargrp[i];
2922+
2923+
disable_irq(gfar_irq(grp, TX)->irq);
2924+
gfar_interrupt(gfar_irq(grp, TX)->irq, grp);
2925+
enable_irq(gfar_irq(grp, TX)->irq);
29242926
}
29252927
}
29262928
}

‎drivers/net/ethernet/mellanox/mlx4/en_netdev.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,7 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
18291829
}
18301830

18311831
#ifdef CONFIG_RFS_ACCEL
1832-
priv->dev->rx_cpu_rmap = alloc_irq_cpu_rmap(priv->rx_ring_num);
1832+
priv->dev->rx_cpu_rmap = alloc_irq_cpu_rmap(priv->mdev->dev->caps.comp_pool);
18331833
if (!priv->dev->rx_cpu_rmap)
18341834
goto err;
18351835
#endif
@@ -2067,7 +2067,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
20672067
err = -ENOMEM;
20682068
goto out;
20692069
}
2070-
priv->tx_cq = kzalloc(sizeof(struct mlx4_en_cq) * MAX_RX_RINGS,
2070+
priv->tx_cq = kzalloc(sizeof(struct mlx4_en_cq) * MAX_TX_RINGS,
20712071
GFP_KERNEL);
20722072
if (!priv->tx_cq) {
20732073
err = -ENOMEM;

‎drivers/net/ethernet/pasemi/pasemi_mac.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,9 @@ static void pasemi_mac_free_tx_resources(struct pasemi_mac *mac)
579579
(TX_RING_SIZE-1)].dma;
580580
freed = pasemi_mac_unmap_tx_skb(mac, nfrags,
581581
info->skb, dmas);
582-
} else
582+
} else {
583583
freed = 2;
584+
}
584585
}
585586

586587
kfree(txring->ring_info);
@@ -808,8 +809,9 @@ static int pasemi_mac_clean_rx(struct pasemi_mac_rxring *rx,
808809
skb->ip_summed = CHECKSUM_UNNECESSARY;
809810
skb->csum = (macrx & XCT_MACRX_CSUM_M) >>
810811
XCT_MACRX_CSUM_S;
811-
} else
812+
} else {
812813
skb_checksum_none_assert(skb);
814+
}
813815

814816
packets++;
815817
tot_bytes += len;
@@ -1829,10 +1831,11 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
18291831
dev_err(&mac->pdev->dev, "register_netdev failed with error %d\n",
18301832
err);
18311833
goto out;
1832-
} else if netif_msg_probe(mac)
1834+
} else if (netif_msg_probe(mac)) {
18331835
printk(KERN_INFO "%s: PA Semi %s: intf %d, hw addr %pM\n",
18341836
dev->name, mac->type == MAC_TYPE_GMAC ? "GMAC" : "XAUI",
18351837
mac->dma_if, dev->dev_addr);
1838+
}
18361839

18371840
return err;
18381841

‎drivers/net/ethernet/qlogic/qlcnic/qlcnic.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838

3939
#define _QLCNIC_LINUX_MAJOR 5
4040
#define _QLCNIC_LINUX_MINOR 1
41-
#define _QLCNIC_LINUX_SUBVERSION 34
42-
#define QLCNIC_LINUX_VERSIONID "5.1.34"
41+
#define _QLCNIC_LINUX_SUBVERSION 35
42+
#define QLCNIC_LINUX_VERSIONID "5.1.35"
4343
#define QLCNIC_DRV_IDC_VER 0x01
4444
#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\
4545
(_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
@@ -1755,7 +1755,7 @@ static inline int qlcnic_set_lb_mode(struct qlcnic_adapter *adapter, u8 mode)
17551755

17561756
static inline int qlcnic_clear_lb_mode(struct qlcnic_adapter *adapter, u8 mode)
17571757
{
1758-
return adapter->ahw->hw_ops->config_loopback(adapter, mode);
1758+
return adapter->ahw->hw_ops->clear_loopback(adapter, mode);
17591759
}
17601760

17611761
static inline int qlcnic_nic_set_promisc(struct qlcnic_adapter *adapter,

‎drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -589,13 +589,6 @@ static int qlcnic_83xx_idc_reattach_driver(struct qlcnic_adapter *adapter)
589589
qlcnic_83xx_register_nic_idc_func(adapter, 1);
590590

591591
qlcnic_83xx_enable_mbx_intrpt(adapter);
592-
if ((adapter->flags & QLCNIC_MSIX_ENABLED)) {
593-
if (qlcnic_83xx_config_intrpt(adapter, 1)) {
594-
netdev_err(adapter->netdev,
595-
"Failed to enable mbx intr\n");
596-
return -EIO;
597-
}
598-
}
599592

600593
if (qlcnic_83xx_configure_opmode(adapter)) {
601594
qlcnic_83xx_idc_enter_failed_state(adapter, 1);

0 commit comments

Comments
 (0)