Skip to content

Commit 4cf1846

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) stmmac_drv_probe() can race with stmmac_open() because we register the netdevice too early. Fix from Florian Fainelli. 2) UFO handling in __ip6_append_data() and ip6_finish_output() use different tests for deciding whether a frame will be fragmented or not, put them in sync. Fix from Zheng Li. 3) The rtnetlink getstats handlers need to validate that the netlink request is large enough, fix from Mathias Krause. 4) Use after free in mlx4 driver, from Jack Morgenstein. 5) Fix setting of garbage UID value in sockets during setattr() calls, from Eric Biggers. 6) Packet drop_monitor doesn't format the netlink messages properly such that nlmsg_next fails to work, fix from Reiter Wolfgang. 7) Fix handling of wildcard addresses in l2tp lookups, from Guillaume Nault. 8) __skb_flow_dissect() can crash on pptp packets, from Ian Kumlien. 9) IGMP code doesn't reset group query timers properly, from Michal Tesar. 10) Fix overzealous MAIN/LOCAL route table combining in ipv4, from Alexander Duyck. 11) vxlan offload check needs to be more strict in be2net driver, from Sabrina Dubroca. 12) Moving l3mdev to packet hooks lost RX stat counters unintentionally, fix from David Ahern. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (52 commits) sh_eth: enable RX descriptor word 0 shift on SH7734 sfc: don't report RX hash keys to ethtool when RSS wasn't enabled dpaa_eth: Initialize CGR structure before init dpaa_eth: cleanup after init_phy() failure net: systemport: Pad packet before inserting TSB net: systemport: Utilize skb_put_padto() LiquidIO VF: s/select/imply/ for PTP_1588_CLOCK libcxgb: fix error check for ip6_route_output() net: usb: asix_devices: add .reset_resume for USB PM net: vrf: Add missing Rx counters drop_monitor: consider inserted data in genlmsg_end benet: stricter vxlan offloading check in be_features_check ipv4: Do not allow MAIN to be alias for new LOCAL w/ custom rules net: macb: Updated resource allocation function calls to new version of API. net: stmmac: dwmac-oxnas: use generic pm implementation net: stmmac: dwmac-oxnas: fix fixed-link-phydev leaks net: stmmac: dwmac-oxnas: fix of-node leak Documentation/networking: fix typo in mpls-sysctl igmp: Make igmp group member RFC 3376 compliant flow_dissector: Update pptp handling to avoid null pointer deref. ...
2 parents 62f8c40 + 71eae1c commit 4cf1846

50 files changed

Lines changed: 273 additions & 377 deletions

Some content is hidden

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

‎Documentation/networking/mpls-sysctl.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ platform_labels - INTEGER
55
possible to configure forwarding for label values equal to or
66
greater than the number of platform labels.
77

8-
A dense utliziation of the entries in the platform label table
9-
is possible and expected aas the platform labels are locally
8+
A dense utilization of the entries in the platform label table
9+
is possible and expected as the platform labels are locally
1010
allocated.
1111

1212
If the number of platform label table entries is set to 0 no

‎drivers/infiniband/hw/mlx4/main.c‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,9 +1682,19 @@ static int __mlx4_ib_create_flow(struct ib_qp *qp, struct ib_flow_attr *flow_att
16821682
size += ret;
16831683
}
16841684

1685+
if (mlx4_is_master(mdev->dev) && flow_type == MLX4_FS_REGULAR &&
1686+
flow_attr->num_of_specs == 1) {
1687+
struct _rule_hw *rule_header = (struct _rule_hw *)(ctrl + 1);
1688+
enum ib_flow_spec_type header_spec =
1689+
((union ib_flow_spec *)(flow_attr + 1))->type;
1690+
1691+
if (header_spec == IB_FLOW_SPEC_ETH)
1692+
mlx4_handle_eth_header_mcast_prio(ctrl, rule_header);
1693+
}
1694+
16851695
ret = mlx4_cmd_imm(mdev->dev, mailbox->dma, reg_id, size >> 2, 0,
16861696
MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A,
1687-
MLX4_CMD_WRAPPED);
1697+
MLX4_CMD_NATIVE);
16881698
if (ret == -ENOMEM)
16891699
pr_err("mcg table is full. Fail to register network rule.\n");
16901700
else if (ret == -ENXIO)
@@ -1701,7 +1711,7 @@ static int __mlx4_ib_destroy_flow(struct mlx4_dev *dev, u64 reg_id)
17011711
int err;
17021712
err = mlx4_cmd(dev, reg_id, 0, 0,
17031713
MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A,
1704-
MLX4_CMD_WRAPPED);
1714+
MLX4_CMD_NATIVE);
17051715
if (err)
17061716
pr_err("Fail to detach network rule. registration id = 0x%llx\n",
17071717
reg_id);

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,29 +1012,28 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
10121012
goto out;
10131013
}
10141014

1015-
/* Insert TSB and checksum infos */
1016-
if (priv->tsb_en) {
1017-
skb = bcm_sysport_insert_tsb(skb, dev);
1018-
if (!skb) {
1019-
ret = NETDEV_TX_OK;
1020-
goto out;
1021-
}
1022-
}
1023-
10241015
/* The Ethernet switch we are interfaced with needs packets to be at
10251016
* least 64 bytes (including FCS) otherwise they will be discarded when
10261017
* they enter the switch port logic. When Broadcom tags are enabled, we
10271018
* need to make sure that packets are at least 68 bytes
10281019
* (including FCS and tag) because the length verification is done after
10291020
* the Broadcom tag is stripped off the ingress packet.
10301021
*/
1031-
if (skb_padto(skb, ETH_ZLEN + ENET_BRCM_TAG_LEN)) {
1022+
if (skb_put_padto(skb, ETH_ZLEN + ENET_BRCM_TAG_LEN)) {
10321023
ret = NETDEV_TX_OK;
10331024
goto out;
10341025
}
10351026

1036-
skb_len = skb->len < ETH_ZLEN + ENET_BRCM_TAG_LEN ?
1037-
ETH_ZLEN + ENET_BRCM_TAG_LEN : skb->len;
1027+
/* Insert TSB and checksum infos */
1028+
if (priv->tsb_en) {
1029+
skb = bcm_sysport_insert_tsb(skb, dev);
1030+
if (!skb) {
1031+
ret = NETDEV_TX_OK;
1032+
goto out;
1033+
}
1034+
}
1035+
1036+
skb_len = skb->len;
10381037

10391038
mapping = dma_map_single(kdev, skb->data, skb_len, DMA_TO_DEVICE);
10401039
if (dma_mapping_error(kdev, mapping)) {

‎drivers/net/ethernet/cadence/macb_pci.c‎

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* macb_pci.c - Cadence GEM PCI wrapper.
2+
* Cadence GEM PCI wrapper.
33
*
44
* Copyright (C) 2016 Cadence Design Systems - http://www.cadence.com
55
*
@@ -45,32 +45,27 @@ static int macb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
4545
struct macb_platform_data plat_data;
4646
struct resource res[2];
4747

48-
/* sanity check */
49-
if (!id)
50-
return -EINVAL;
51-
5248
/* enable pci device */
53-
err = pci_enable_device(pdev);
49+
err = pcim_enable_device(pdev);
5450
if (err < 0) {
55-
dev_err(&pdev->dev, "Enabling PCI device has failed: 0x%04X",
56-
err);
57-
return -EACCES;
51+
dev_err(&pdev->dev, "Enabling PCI device has failed: %d", err);
52+
return err;
5853
}
5954

6055
pci_set_master(pdev);
6156

6257
/* set up resources */
6358
memset(res, 0x00, sizeof(struct resource) * ARRAY_SIZE(res));
64-
res[0].start = pdev->resource[0].start;
65-
res[0].end = pdev->resource[0].end;
59+
res[0].start = pci_resource_start(pdev, 0);
60+
res[0].end = pci_resource_end(pdev, 0);
6661
res[0].name = PCI_DRIVER_NAME;
6762
res[0].flags = IORESOURCE_MEM;
68-
res[1].start = pdev->irq;
63+
res[1].start = pci_irq_vector(pdev, 0);
6964
res[1].name = PCI_DRIVER_NAME;
7065
res[1].flags = IORESOURCE_IRQ;
7166

72-
dev_info(&pdev->dev, "EMAC physical base addr = 0x%p\n",
73-
(void *)(uintptr_t)pci_resource_start(pdev, 0));
67+
dev_info(&pdev->dev, "EMAC physical base addr: %pa\n",
68+
&res[0].start);
7469

7570
/* set up macb platform data */
7671
memset(&plat_data, 0, sizeof(plat_data));
@@ -100,7 +95,7 @@ static int macb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
10095
plat_info.num_res = ARRAY_SIZE(res);
10196
plat_info.data = &plat_data;
10297
plat_info.size_data = sizeof(plat_data);
103-
plat_info.dma_mask = DMA_BIT_MASK(32);
98+
plat_info.dma_mask = pdev->dma_mask;
10499

105100
/* register platform device */
106101
plat_dev = platform_device_register_full(&plat_info);
@@ -120,7 +115,6 @@ static int macb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
120115
clk_unregister(plat_data.pclk);
121116

122117
err_pclk_register:
123-
pci_disable_device(pdev);
124118
return err;
125119
}
126120

@@ -130,7 +124,6 @@ static void macb_remove(struct pci_dev *pdev)
130124
struct macb_platform_data *plat_data = dev_get_platdata(&plat_dev->dev);
131125

132126
platform_device_unregister(plat_dev);
133-
pci_disable_device(pdev);
134127
clk_unregister(plat_data->pclk);
135128
clk_unregister(plat_data->hclk);
136129
}

‎drivers/net/ethernet/cavium/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ config OCTEON_MGMT_ETHERNET
7777
config LIQUIDIO_VF
7878
tristate "Cavium LiquidIO VF support"
7979
depends on 64BIT && PCI_MSI
80-
select PTP_1588_CLOCK
80+
imply PTP_1588_CLOCK
8181
---help---
8282
This driver supports Cavium LiquidIO Intelligent Server Adapter
8383
based on CN23XX chips.

‎drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,15 @@ cxgb_find_route6(struct cxgb4_lld_info *lldi,
133133
if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL)
134134
fl6.flowi6_oif = sin6_scope_id;
135135
dst = ip6_route_output(&init_net, NULL, &fl6);
136-
if (!dst)
137-
goto out;
138-
if (!cxgb_our_interface(lldi, get_real_dev,
139-
ip6_dst_idev(dst)->dev) &&
140-
!(ip6_dst_idev(dst)->dev->flags & IFF_LOOPBACK)) {
136+
if (dst->error ||
137+
(!cxgb_our_interface(lldi, get_real_dev,
138+
ip6_dst_idev(dst)->dev) &&
139+
!(ip6_dst_idev(dst)->dev->flags & IFF_LOOPBACK))) {
141140
dst_release(dst);
142-
dst = NULL;
141+
return NULL;
143142
}
144143
}
145144

146-
out:
147145
return dst;
148146
}
149147
EXPORT_SYMBOL(cxgb_find_route6);

‎drivers/net/ethernet/emulex/benet/be_main.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5155,7 +5155,9 @@ static netdev_features_t be_features_check(struct sk_buff *skb,
51555155
skb->inner_protocol_type != ENCAP_TYPE_ETHER ||
51565156
skb->inner_protocol != htons(ETH_P_TEB) ||
51575157
skb_inner_mac_header(skb) - skb_transport_header(skb) !=
5158-
sizeof(struct udphdr) + sizeof(struct vxlanhdr))
5158+
sizeof(struct udphdr) + sizeof(struct vxlanhdr) ||
5159+
!adapter->vxlan_port ||
5160+
udp_hdr(skb)->dest != adapter->vxlan_port)
51595161
return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
51605162

51615163
return features;

‎drivers/net/ethernet/freescale/dpaa/dpaa_eth.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ static int dpaa_eth_cgr_init(struct dpaa_priv *priv)
733733
priv->cgr_data.cgr.cb = dpaa_eth_cgscn;
734734

735735
/* Enable Congestion State Change Notifications and CS taildrop */
736+
memset(&initcgr, 0, sizeof(initcgr));
736737
initcgr.we_mask = cpu_to_be16(QM_CGR_WE_CSCN_EN | QM_CGR_WE_CS_THRES);
737738
initcgr.cgr.cscn_en = QM_CGR_EN;
738739

@@ -2291,7 +2292,8 @@ static int dpaa_open(struct net_device *net_dev)
22912292
net_dev->phydev = mac_dev->init_phy(net_dev, priv->mac_dev);
22922293
if (!net_dev->phydev) {
22932294
netif_err(priv, ifup, net_dev, "init_phy() failed\n");
2294-
return -ENODEV;
2295+
err = -ENODEV;
2296+
goto phy_init_failed;
22952297
}
22962298

22972299
for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) {
@@ -2314,6 +2316,7 @@ static int dpaa_open(struct net_device *net_dev)
23142316
for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++)
23152317
fman_port_disable(mac_dev->port[i]);
23162318

2319+
phy_init_failed:
23172320
dpaa_eth_napi_disable(priv);
23182321

23192322
return err;
@@ -2420,6 +2423,7 @@ static int dpaa_ingress_cgr_init(struct dpaa_priv *priv)
24202423
}
24212424

24222425
/* Enable CS TD, but disable Congestion State Change Notifications. */
2426+
memset(&initcgr, 0, sizeof(initcgr));
24232427
initcgr.we_mask = cpu_to_be16(QM_CGR_WE_CS_THRES);
24242428
initcgr.cgr.cscn_en = QM_CGR_EN;
24252429
cs_th = DPAA_INGRESS_CS_THRESHOLD;

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,9 @@ static u32 freq_to_shift(u16 freq)
245245
{
246246
u32 freq_khz = freq * 1000;
247247
u64 max_val_cycles = freq_khz * 1000 * MLX4_EN_WRAP_AROUND_SEC;
248-
u64 tmp_rounded =
249-
roundup_pow_of_two(max_val_cycles) > max_val_cycles ?
250-
roundup_pow_of_two(max_val_cycles) - 1 : UINT_MAX;
251-
u64 max_val_cycles_rounded = is_power_of_2(max_val_cycles + 1) ?
252-
max_val_cycles : tmp_rounded;
248+
u64 max_val_cycles_rounded = 1ULL << fls64(max_val_cycles - 1);
253249
/* calculate max possible multiplier in order to fit in 64bit */
254-
u64 max_mul = div_u64(0xffffffffffffffffULL, max_val_cycles_rounded);
250+
u64 max_mul = div64_u64(ULLONG_MAX, max_val_cycles_rounded);
255251

256252
/* This comes from the reverse of clocksource_khz2mult */
257253
return ilog2(div_u64(max_mul * freq_khz, 1000000));

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,14 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
445445
ring->cqn = priv->rx_cq[ring_ind]->mcq.cqn;
446446

447447
ring->stride = stride;
448-
if (ring->stride <= TXBB_SIZE)
448+
if (ring->stride <= TXBB_SIZE) {
449+
/* Stamp first unused send wqe */
450+
__be32 *ptr = (__be32 *)ring->buf;
451+
__be32 stamp = cpu_to_be32(1 << STAMP_SHIFT);
452+
*ptr = stamp;
453+
/* Move pointer to start of rx section */
449454
ring->buf += TXBB_SIZE;
455+
}
450456

451457
ring->log_stride = ffs(ring->stride) - 1;
452458
ring->buf_size = ring->size * ring->stride;

0 commit comments

Comments
 (0)