Skip to content

Commit dbbffe6

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Several small bug fixes all over: 1) be2net driver uses wrong payload length when submitting MAC list get requests to the chip. From Sathya Perla. 2) Fix mwifiex memory leak on driver unload, from Amitkumar Karwar. 3) Prevent random memory access in batman-adv, from Marek Lindner. 4) batman-adv doesn't check for pskb_trim_rcsum() errors, also from Marek Lindner. 5) Fix fec crashes on rapid link up/down, from Frank Li. 6) Fix inner protocol grovelling in GSO, from Pravin B Shelar. 7) Link event validation fix in qlcnic from Rajesh Borundia. 8) Not all FEC chips can support checksum offload, fix from Shawn Guo. 9) EXPORT_SYMBOL + inline doesn't make any sense, from Denis Efremov. 10) Fix race in passthru mode during device removal in macvlan, from Jiri Pirko. 11) Fix RCU hash table lookup socket state race in ipv6, leading to NULL pointer derefs, from Eric Dumazet. 12) Add several missing HAS_DMA kconfig dependencies, from Geert Uyttterhoeven. 13) Fix bogus PCI resource management in 3c59x driver, from Sergei Shtylyov. 14) Fix info leak in ipv6 GRE tunnel driver, from Amerigo Wang. 15) Fix device leak in ipv6 IPSEC policy layer, from Cong Wang. 16) DMA mapping leak fix in qlge from Thadeu Lima de Souza Cascardo. 17) Missing iounmap on probe failure in bna driver, from Wei Yongjun." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (40 commits) bna: add missing iounmap() on error in bnad_init() qlge: fix dma map leak when the last chunk is not allocated xfrm6: release dev before returning error ipv6,gre: do not leak info to user-space virtio_net: use default napi weight by default emac: Fix EMAC soft reset on 460EX/GT 3c59x: fix PCI resource management caif: CAIF_VIRTIO should depend on HAS_DMA net/ethernet: MACB should depend on HAS_DMA net/ethernet: ARM_AT91_ETHER should depend on HAS_DMA net/wireless: ATH9K should depend on HAS_DMA net/ethernet: STMMAC_ETH should depend on HAS_DMA net/ethernet: NET_CALXEDA_XGMAC should depend on HAS_DMA ipv6: do not clear pinet6 field macvlan: fix passthru mode race between dev removal and rx path ipv4: ip_output: remove inline marking of EXPORT_SYMBOL functions net/mlx4: Strengthen VLAN tags/priorities enforcement in VST mode net/mlx4_core: Add missing report on VST and spoof-checking dev caps net: fec: enable hardware checksum only on imx6q-fec qlcnic: Fix validation of link event command. ...
2 parents 1f63876 + ba21fc6 commit dbbffe6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+498
-263
lines changed

drivers/net/caif/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ config CAIF_HSI
4343

4444
config CAIF_VIRTIO
4545
tristate "CAIF virtio transport driver"
46-
depends on CAIF
46+
depends on CAIF && HAS_DMA
4747
select VHOST_RING
4848
select VIRTIO
4949
select GENERIC_ALLOCATOR

drivers/net/ethernet/3com/3c59x.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ struct vortex_private {
632632
pm_state_valid:1, /* pci_dev->saved_config_space has sane contents */
633633
open:1,
634634
medialock:1,
635-
must_free_region:1, /* Flag: if zero, Cardbus owns the I/O region */
636635
large_frames:1, /* accept large frames */
637636
handling_irq:1; /* private in_irq indicator */
638637
/* {get|set}_wol operations are already serialized by rtnl.
@@ -1012,6 +1011,12 @@ static int vortex_init_one(struct pci_dev *pdev,
10121011
if (rc < 0)
10131012
goto out;
10141013

1014+
rc = pci_request_regions(pdev, DRV_NAME);
1015+
if (rc < 0) {
1016+
pci_disable_device(pdev);
1017+
goto out;
1018+
}
1019+
10151020
unit = vortex_cards_found;
10161021

10171022
if (global_use_mmio < 0 && (unit >= MAX_UNITS || use_mmio[unit] < 0)) {
@@ -1027,6 +1032,7 @@ static int vortex_init_one(struct pci_dev *pdev,
10271032
if (!ioaddr) /* If mapping fails, fall-back to BAR 0... */
10281033
ioaddr = pci_iomap(pdev, 0, 0);
10291034
if (!ioaddr) {
1035+
pci_release_regions(pdev);
10301036
pci_disable_device(pdev);
10311037
rc = -ENOMEM;
10321038
goto out;
@@ -1036,6 +1042,7 @@ static int vortex_init_one(struct pci_dev *pdev,
10361042
ent->driver_data, unit);
10371043
if (rc < 0) {
10381044
pci_iounmap(pdev, ioaddr);
1045+
pci_release_regions(pdev);
10391046
pci_disable_device(pdev);
10401047
goto out;
10411048
}
@@ -1178,11 +1185,6 @@ static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
11781185

11791186
/* PCI-only startup logic */
11801187
if (pdev) {
1181-
/* EISA resources already marked, so only PCI needs to do this here */
1182-
/* Ignore return value, because Cardbus drivers already allocate for us */
1183-
if (request_region(dev->base_addr, vci->io_size, print_name) != NULL)
1184-
vp->must_free_region = 1;
1185-
11861188
/* enable bus-mastering if necessary */
11871189
if (vci->flags & PCI_USES_MASTER)
11881190
pci_set_master(pdev);
@@ -1220,7 +1222,7 @@ static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
12201222
&vp->rx_ring_dma);
12211223
retval = -ENOMEM;
12221224
if (!vp->rx_ring)
1223-
goto free_region;
1225+
goto free_device;
12241226

12251227
vp->tx_ring = (struct boom_tx_desc *)(vp->rx_ring + RX_RING_SIZE);
12261228
vp->tx_ring_dma = vp->rx_ring_dma + sizeof(struct boom_rx_desc) * RX_RING_SIZE;
@@ -1484,9 +1486,7 @@ static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
14841486
+ sizeof(struct boom_tx_desc) * TX_RING_SIZE,
14851487
vp->rx_ring,
14861488
vp->rx_ring_dma);
1487-
free_region:
1488-
if (vp->must_free_region)
1489-
release_region(dev->base_addr, vci->io_size);
1489+
free_device:
14901490
free_netdev(dev);
14911491
pr_err(PFX "vortex_probe1 fails. Returns %d\n", retval);
14921492
out:
@@ -3254,8 +3254,9 @@ static void vortex_remove_one(struct pci_dev *pdev)
32543254
+ sizeof(struct boom_tx_desc) * TX_RING_SIZE,
32553255
vp->rx_ring,
32563256
vp->rx_ring_dma);
3257-
if (vp->must_free_region)
3258-
release_region(dev->base_addr, vp->io_size);
3257+
3258+
pci_release_regions(pdev);
3259+
32593260
free_netdev(dev);
32603261
}
32613262

drivers/net/ethernet/brocade/bna/bnad.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3236,9 +3236,10 @@ bnad_init(struct bnad *bnad,
32363236

32373237
sprintf(bnad->wq_name, "%s_wq_%d", BNAD_NAME, bnad->id);
32383238
bnad->work_q = create_singlethread_workqueue(bnad->wq_name);
3239-
3240-
if (!bnad->work_q)
3239+
if (!bnad->work_q) {
3240+
iounmap(bnad->bar0);
32413241
return -ENOMEM;
3242+
}
32423243

32433244
return 0;
32443245
}

drivers/net/ethernet/cadence/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if NET_CADENCE
2222

2323
config ARM_AT91_ETHER
2424
tristate "AT91RM9200 Ethernet support"
25-
depends on GENERIC_HARDIRQS
25+
depends on GENERIC_HARDIRQS && HAS_DMA
2626
select NET_CORE
2727
select MACB
2828
---help---
@@ -31,6 +31,7 @@ config ARM_AT91_ETHER
3131

3232
config MACB
3333
tristate "Cadence MACB/GEM support"
34+
depends on HAS_DMA
3435
select PHYLIB
3536
---help---
3637
The Cadence MACB ethernet interface is found on many Atmel AT32 and

drivers/net/ethernet/calxeda/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
config NET_CALXEDA_XGMAC
22
tristate "Calxeda 1G/10G XGMAC Ethernet driver"
3-
depends on HAS_IOMEM
3+
depends on HAS_IOMEM && HAS_DMA
44
select CRC32
55
help
66
This is the driver for the XGMAC Ethernet IP block found on Calxeda

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787
#define FEC_QUIRK_HAS_GBIT (1 << 3)
8888
/* Controller has extend desc buffer */
8989
#define FEC_QUIRK_HAS_BUFDESC_EX (1 << 4)
90+
/* Controller has hardware checksum support */
91+
#define FEC_QUIRK_HAS_CSUM (1 << 5)
9092

9193
static struct platform_device_id fec_devtype[] = {
9294
{
@@ -105,7 +107,7 @@ static struct platform_device_id fec_devtype[] = {
105107
}, {
106108
.name = "imx6q-fec",
107109
.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
108-
FEC_QUIRK_HAS_BUFDESC_EX,
110+
FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM,
109111
}, {
110112
.name = "mvf-fec",
111113
.driver_data = FEC_QUIRK_ENET_MAC,
@@ -1744,6 +1746,8 @@ static const struct net_device_ops fec_netdev_ops = {
17441746
static int fec_enet_init(struct net_device *ndev)
17451747
{
17461748
struct fec_enet_private *fep = netdev_priv(ndev);
1749+
const struct platform_device_id *id_entry =
1750+
platform_get_device_id(fep->pdev);
17471751
struct bufdesc *cbd_base;
17481752

17491753
/* Allocate memory for buffer descriptors. */
@@ -1775,12 +1779,14 @@ static int fec_enet_init(struct net_device *ndev)
17751779
writel(FEC_RX_DISABLED_IMASK, fep->hwp + FEC_IMASK);
17761780
netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, FEC_NAPI_WEIGHT);
17771781

1778-
/* enable hw accelerator */
1779-
ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
1780-
| NETIF_F_RXCSUM);
1781-
ndev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
1782-
| NETIF_F_RXCSUM);
1783-
fep->csum_flags |= FLAG_RX_CSUM_ENABLED;
1782+
if (id_entry->driver_data & FEC_QUIRK_HAS_CSUM) {
1783+
/* enable hw accelerator */
1784+
ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
1785+
| NETIF_F_RXCSUM);
1786+
ndev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
1787+
| NETIF_F_RXCSUM);
1788+
fep->csum_flags |= FLAG_RX_CSUM_ENABLED;
1789+
}
17841790

17851791
fec_restart(ndev, 0);
17861792

drivers/net/ethernet/ibm/emac/core.c

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -359,21 +359,41 @@ static int emac_reset(struct emac_instance *dev)
359359
}
360360

361361
#ifdef CONFIG_PPC_DCR_NATIVE
362-
/* Enable internal clock source */
363-
if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX))
364-
dcri_clrset(SDR0, SDR0_ETH_CFG,
365-
0, SDR0_ETH_CFG_ECS << dev->cell_index);
362+
/*
363+
* PPC460EX/GT Embedded Processor Advanced User's Manual
364+
* section 28.10.1 Mode Register 0 (EMACx_MR0) states:
365+
* Note: The PHY must provide a TX Clk in order to perform a soft reset
366+
* of the EMAC. If none is present, select the internal clock
367+
* (SDR0_ETH_CFG[EMACx_PHY_CLK] = 1).
368+
* After a soft reset, select the external clock.
369+
*/
370+
if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {
371+
if (dev->phy_address == 0xffffffff &&
372+
dev->phy_map == 0xffffffff) {
373+
/* No PHY: select internal loop clock before reset */
374+
dcri_clrset(SDR0, SDR0_ETH_CFG,
375+
0, SDR0_ETH_CFG_ECS << dev->cell_index);
376+
} else {
377+
/* PHY present: select external clock before reset */
378+
dcri_clrset(SDR0, SDR0_ETH_CFG,
379+
SDR0_ETH_CFG_ECS << dev->cell_index, 0);
380+
}
381+
}
366382
#endif
367383

368384
out_be32(&p->mr0, EMAC_MR0_SRST);
369385
while ((in_be32(&p->mr0) & EMAC_MR0_SRST) && n)
370386
--n;
371387

372388
#ifdef CONFIG_PPC_DCR_NATIVE
373-
/* Enable external clock source */
374-
if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX))
375-
dcri_clrset(SDR0, SDR0_ETH_CFG,
376-
SDR0_ETH_CFG_ECS << dev->cell_index, 0);
389+
if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {
390+
if (dev->phy_address == 0xffffffff &&
391+
dev->phy_map == 0xffffffff) {
392+
/* No PHY: restore external clock source after reset */
393+
dcri_clrset(SDR0, SDR0_ETH_CFG,
394+
SDR0_ETH_CFG_ECS << dev->cell_index, 0);
395+
}
396+
}
377397
#endif
378398

379399
if (n) {

drivers/net/ethernet/mellanox/mlx4/en_resources.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride,
6060
context->pri_path.sched_queue = 0x83 | (priv->port - 1) << 6;
6161
if (user_prio >= 0) {
6262
context->pri_path.sched_queue |= user_prio << 3;
63-
context->pri_path.feup = 1 << 6;
63+
context->pri_path.feup = MLX4_FEUP_FORCE_ETH_UP;
6464
}
6565
context->pri_path.counter_index = 0xff;
6666
context->cqn_send = cpu_to_be32(cqn);

drivers/net/ethernet/mellanox/mlx4/fw.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
131131
[2] = "RSS XOR Hash Function support",
132132
[3] = "Device manage flow steering support",
133133
[4] = "Automatic MAC reassignment support",
134-
[5] = "Time stamping support"
134+
[5] = "Time stamping support",
135+
[6] = "VST (control vlan insertion/stripping) support",
136+
[7] = "FSM (MAC anti-spoofing) support"
135137
};
136138
int i;
137139

drivers/net/ethernet/mellanox/mlx4/resource_tracker.c

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -372,24 +372,29 @@ static int update_vport_qp_param(struct mlx4_dev *dev,
372372
if (MLX4_QP_ST_RC == qp_type)
373373
return -EINVAL;
374374

375+
/* force strip vlan by clear vsd */
376+
qpc->param3 &= ~cpu_to_be32(MLX4_STRIP_VLAN);
377+
if (0 != vp_oper->state.default_vlan) {
378+
qpc->pri_path.vlan_control =
379+
MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED |
380+
MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED |
381+
MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED;
382+
} else { /* priority tagged */
383+
qpc->pri_path.vlan_control =
384+
MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED |
385+
MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED;
386+
}
387+
388+
qpc->pri_path.fvl_rx |= MLX4_FVL_RX_FORCE_ETH_VLAN;
375389
qpc->pri_path.vlan_index = vp_oper->vlan_idx;
376-
qpc->pri_path.fl = (1 << 6) | (1 << 2); /* set cv bit and hide_cqe_vlan bit*/
377-
qpc->pri_path.feup |= 1 << 3; /* set fvl bit */
390+
qpc->pri_path.fl |= MLX4_FL_CV | MLX4_FL_ETH_HIDE_CQE_VLAN;
391+
qpc->pri_path.feup |= MLX4_FEUP_FORCE_ETH_UP | MLX4_FVL_FORCE_ETH_VLAN;
378392
qpc->pri_path.sched_queue &= 0xC7;
379393
qpc->pri_path.sched_queue |= (vp_oper->state.default_qos) << 3;
380-
mlx4_dbg(dev, "qp %d port %d Q 0x%x set vlan to %d vidx %d feup %x fl %x\n",
381-
be32_to_cpu(qpc->local_qpn) & 0xffffff, port,
382-
(int)(qpc->pri_path.sched_queue), vp_oper->state.default_vlan,
383-
vp_oper->vlan_idx, (int)(qpc->pri_path.feup),
384-
(int)(qpc->pri_path.fl));
385394
}
386395
if (vp_oper->state.spoofchk) {
387-
qpc->pri_path.feup |= 1 << 5; /* set fsm bit */;
396+
qpc->pri_path.feup |= MLX4_FSM_FORCE_ETH_SRC_MAC;
388397
qpc->pri_path.grh_mylmc = (0x80 & qpc->pri_path.grh_mylmc) + vp_oper->mac_idx;
389-
mlx4_dbg(dev, "spoof qp %d port %d feup 0x%x, myLmc 0x%x mindx %d\n",
390-
be32_to_cpu(qpc->local_qpn) & 0xffffff, port,
391-
(int)qpc->pri_path.feup, (int)qpc->pri_path.grh_mylmc,
392-
vp_oper->mac_idx);
393398
}
394399
return 0;
395400
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ struct qlcnic_hardware_context {
429429

430430
u16 port_type;
431431
u16 board_type;
432+
u16 supported_type;
432433

433434
u16 link_speed;
434435
u16 link_duplex;
@@ -1514,6 +1515,7 @@ void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter);
15141515
void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter);
15151516
void qlcnic_82xx_add_sysfs(struct qlcnic_adapter *adapter);
15161517
void qlcnic_82xx_remove_sysfs(struct qlcnic_adapter *adapter);
1518+
int qlcnic_82xx_get_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
15171519

15181520
int qlcnicvf_config_bridged_mode(struct qlcnic_adapter *, u32);
15191521
int qlcnicvf_config_led(struct qlcnic_adapter *, u32, u32);

0 commit comments

Comments
 (0)