Skip to content

Commit 36bef88

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) nft_compat accidently truncates ethernet protocol to 8-bits, from Arturo Borrero. 2) Memory leak in ip_vs_proc_conn(), from Julian Anastasov. 3) Don't allow the space required for nftables rules to exceed the maximum value representable in the dlen field. From Patrick McHardy. 4) bcm63xx_enet can accidently leave interrupts permanently disabled due to errors in the NAPI polling exit logic. Fix from Nicolas Schichan. 5) Fix OOPSes triggerable by the ping protocol module, due to missing address family validations etc. From Lorenzo Colitti. 6) Don't use RCU locking in sleepable context in team driver, from Jiri Pirko. 7) xen-netback miscalculates statistic offset pointers when reporting the stats to userspace. From David Vrabel. 8) Fix a leak of up to 256 pages per VIF destroy in xen-netaback, also from David Vrabel. 9) ip_check_defrag() cannot assume that skb_network_offset(), particularly when it is used by the AF_PACKET fanout defrag code. From Alexander Drozdov. 10) gianfar driver doesn't query OF node names properly when trying to determine the number of hw queues available. Fix it to explicitly check for OF nodes named queue-group. From Tobias Waldekranz. 11) MID field in macb driver should be 12 bits, not 16. From Punnaiah Choudary Kalluri. 12) Fix unintentional regression in traceroute due to timestamp socket option changes. Empty ICMP payloads should be allowed in non-timestamp cases. From Willem de Bruijn. 13) When devices are unregistered, we have to get rid of AF_PACKET multicast list entries that point to it via ifindex. Fix from Francesco Ruggeri. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (38 commits) tipc: fix bug in link failover handling net: delete stale packet_mclist entries net: macb: constify macb configuration data MAINTAINERS: add Marc Kleine-Budde as co maintainer for CAN networking layer MAINTAINERS: linux-can moved to github can: kvaser_usb: Read all messages in a bulk-in URB buffer can: kvaser_usb: Avoid double free on URB submission failures can: peak_usb: fix missing ctrlmode_ init for every dev can: add missing initialisations in CAN related skbuffs ip: fix error queue empty skb handling bgmac: Clean warning messages tcp: align tcp_xmit_size_goal() on tcp_tso_autosize() net: fec: fix unbalanced clk disable on driver unbind net: macb: Correct the MID field length value net: gianfar: correctly determine the number of queue groups ipv4: ip_check_defrag should not assume that skb_network_offset is zero net: bcmgenet: properly disable password matching net: eth: xgene: fix booting with devicetree bnx2x: Force fundamental reset for EEH recovery xen-netback: refactor xenvif_handle_frag_list() ...
2 parents e93df63 + e6441ba commit 36bef88

File tree

39 files changed

+311
-177
lines changed

39 files changed

+311
-177
lines changed

Documentation/devicetree/bindings/net/apm-xgene-enet.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ Ethernet nodes are defined to describe on-chip ethernet interfaces in
44
APM X-Gene SoC.
55

66
Required properties for all the ethernet interfaces:
7-
- compatible: Should be "apm,xgene-enet"
7+
- compatible: Should state binding information from the following list,
8+
- "apm,xgene-enet": RGMII based 1G interface
9+
- "apm,xgene1-sgenet": SGMII based 1G interface
10+
- "apm,xgene1-xgenet": XFI based 10G interface
811
- reg: Address and length of the register set for the device. It contains the
912
information of registers in the same order as described by reg-names
1013
- reg-names: Should contain the register set names

MAINTAINERS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,8 +2369,9 @@ F: arch/x86/include/asm/tce.h
23692369

23702370
CAN NETWORK LAYER
23712371
M: Oliver Hartkopp <socketcan@hartkopp.net>
2372+
M: Marc Kleine-Budde <mkl@pengutronix.de>
23722373
L: linux-can@vger.kernel.org
2373-
W: http://gitorious.org/linux-can
2374+
W: https://github.com/linux-can
23742375
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git
23752376
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git
23762377
S: Maintained
@@ -2386,7 +2387,7 @@ CAN NETWORK DRIVERS
23862387
M: Wolfgang Grandegger <wg@grandegger.com>
23872388
M: Marc Kleine-Budde <mkl@pengutronix.de>
23882389
L: linux-can@vger.kernel.org
2389-
W: http://gitorious.org/linux-can
2390+
W: https://github.com/linux-can
23902391
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git
23912392
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git
23922393
S: Maintained

arch/arm/mach-pxa/idp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <linux/platform_data/video-pxafb.h>
3737
#include <mach/bitfield.h>
3838
#include <linux/platform_data/mmc-pxamci.h>
39+
#include <linux/smc91x.h>
3940

4041
#include "generic.h"
4142
#include "devices.h"

arch/arm/mach-pxa/lpd270.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static struct resource smc91x_resources[] = {
195195
};
196196

197197
struct smc91x_platdata smc91x_platdata = {
198-
.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT;
198+
.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
199199
};
200200

201201
static struct platform_device smc91x_device = {

arch/arm/mach-sa1100/neponset.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ static int neponset_probe(struct platform_device *dev)
268268
.id = 0,
269269
.res = smc91x_resources,
270270
.num_res = ARRAY_SIZE(smc91x_resources),
271-
.data = &smc91c_platdata,
272-
.size_data = sizeof(smc91c_platdata),
271+
.data = &smc91x_platdata,
272+
.size_data = sizeof(smc91x_platdata),
273273
};
274274
int ret, irq;
275275

arch/arm/mach-sa1100/pleb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static struct platform_device smc91x_device = {
5454
.num_resources = ARRAY_SIZE(smc91x_resources),
5555
.resource = smc91x_resources,
5656
.dev = {
57-
.platform_data = &smc91c_platdata,
57+
.platform_data = &smc91x_platdata,
5858
},
5959
};
6060

arch/arm64/boot/dts/apm/apm-storm.dtsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@
622622
};
623623

624624
sgenet0: ethernet@1f210000 {
625-
compatible = "apm,xgene-enet";
625+
compatible = "apm,xgene1-sgenet";
626626
status = "disabled";
627627
reg = <0x0 0x1f210000 0x0 0xd100>,
628628
<0x0 0x1f200000 0x0 0Xc300>,
@@ -636,7 +636,7 @@
636636
};
637637

638638
xgenet: ethernet@1f610000 {
639-
compatible = "apm,xgene-enet";
639+
compatible = "apm,xgene1-xgenet";
640640
status = "disabled";
641641
reg = <0x0 0x1f610000 0x0 0xd100>,
642642
<0x0 0x1f600000 0x0 0Xc300>,

drivers/net/can/dev.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,10 @@ struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf)
579579
skb->pkt_type = PACKET_BROADCAST;
580580
skb->ip_summed = CHECKSUM_UNNECESSARY;
581581

582+
skb_reset_mac_header(skb);
583+
skb_reset_network_header(skb);
584+
skb_reset_transport_header(skb);
585+
582586
can_skb_reserve(skb);
583587
can_skb_prv(skb)->ifindex = dev->ifindex;
584588

@@ -603,6 +607,10 @@ struct sk_buff *alloc_canfd_skb(struct net_device *dev,
603607
skb->pkt_type = PACKET_BROADCAST;
604608
skb->ip_summed = CHECKSUM_UNNECESSARY;
605609

610+
skb_reset_mac_header(skb);
611+
skb_reset_network_header(skb);
612+
skb_reset_transport_header(skb);
613+
606614
can_skb_reserve(skb);
607615
can_skb_prv(skb)->ifindex = dev->ifindex;
608616

drivers/net/can/usb/kvaser_usb.c

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* Copyright (C) 2015 Valeo S.A.
1515
*/
1616

17+
#include <linux/kernel.h>
1718
#include <linux/completion.h>
1819
#include <linux/module.h>
1920
#include <linux/netdevice.h>
@@ -584,8 +585,15 @@ static int kvaser_usb_wait_msg(const struct kvaser_usb *dev, u8 id,
584585
while (pos <= actual_len - MSG_HEADER_LEN) {
585586
tmp = buf + pos;
586587

587-
if (!tmp->len)
588-
break;
588+
/* Handle messages crossing the USB endpoint max packet
589+
* size boundary. Check kvaser_usb_read_bulk_callback()
590+
* for further details.
591+
*/
592+
if (tmp->len == 0) {
593+
pos = round_up(pos,
594+
dev->bulk_in->wMaxPacketSize);
595+
continue;
596+
}
589597

590598
if (pos + tmp->len > actual_len) {
591599
dev_err(dev->udev->dev.parent,
@@ -787,7 +795,6 @@ static int kvaser_usb_simple_msg_async(struct kvaser_usb_net_priv *priv,
787795
netdev_err(netdev, "Error transmitting URB\n");
788796
usb_unanchor_urb(urb);
789797
usb_free_urb(urb);
790-
kfree(buf);
791798
return err;
792799
}
793800

@@ -1317,16 +1324,26 @@ static void kvaser_usb_read_bulk_callback(struct urb *urb)
13171324
while (pos <= urb->actual_length - MSG_HEADER_LEN) {
13181325
msg = urb->transfer_buffer + pos;
13191326

1320-
if (!msg->len)
1321-
break;
1327+
/* The Kvaser firmware can only read and write messages that
1328+
* does not cross the USB's endpoint wMaxPacketSize boundary.
1329+
* If a follow-up command crosses such boundary, firmware puts
1330+
* a placeholder zero-length command in its place then aligns
1331+
* the real command to the next max packet size.
1332+
*
1333+
* Handle such cases or we're going to miss a significant
1334+
* number of events in case of a heavy rx load on the bus.
1335+
*/
1336+
if (msg->len == 0) {
1337+
pos = round_up(pos, dev->bulk_in->wMaxPacketSize);
1338+
continue;
1339+
}
13221340

13231341
if (pos + msg->len > urb->actual_length) {
13241342
dev_err(dev->udev->dev.parent, "Format error\n");
13251343
break;
13261344
}
13271345

13281346
kvaser_usb_handle_message(dev, msg);
1329-
13301347
pos += msg->len;
13311348
}
13321349

@@ -1615,8 +1632,7 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb,
16151632
struct urb *urb;
16161633
void *buf;
16171634
struct kvaser_msg *msg;
1618-
int i, err;
1619-
int ret = NETDEV_TX_OK;
1635+
int i, err, ret = NETDEV_TX_OK;
16201636
u8 *msg_tx_can_flags = NULL; /* GCC */
16211637

16221638
if (can_dropped_invalid_skb(netdev, skb))
@@ -1634,7 +1650,7 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb,
16341650
if (!buf) {
16351651
stats->tx_dropped++;
16361652
dev_kfree_skb(skb);
1637-
goto nobufmem;
1653+
goto freeurb;
16381654
}
16391655

16401656
msg = buf;
@@ -1681,8 +1697,10 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb,
16811697
/* This should never happen; it implies a flow control bug */
16821698
if (!context) {
16831699
netdev_warn(netdev, "cannot find free context\n");
1700+
1701+
kfree(buf);
16841702
ret = NETDEV_TX_BUSY;
1685-
goto releasebuf;
1703+
goto freeurb;
16861704
}
16871705

16881706
context->priv = priv;
@@ -1719,16 +1737,12 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb,
17191737
else
17201738
netdev_warn(netdev, "Failed tx_urb %d\n", err);
17211739

1722-
goto releasebuf;
1740+
goto freeurb;
17231741
}
17241742

1725-
usb_free_urb(urb);
1726-
1727-
return NETDEV_TX_OK;
1743+
ret = NETDEV_TX_OK;
17281744

1729-
releasebuf:
1730-
kfree(buf);
1731-
nobufmem:
1745+
freeurb:
17321746
usb_free_urb(urb);
17331747
return ret;
17341748
}

drivers/net/can/usb/peak_usb/pcan_usb_fd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,10 @@ static int pcan_usb_fd_init(struct peak_usb_device *dev)
879879

880880
pdev->usb_if = ppdev->usb_if;
881881
pdev->cmd_buffer_addr = ppdev->cmd_buffer_addr;
882+
883+
/* do a copy of the ctrlmode[_supported] too */
884+
dev->can.ctrlmode = ppdev->dev.can.ctrlmode;
885+
dev->can.ctrlmode_supported = ppdev->dev.can.ctrlmode_supported;
882886
}
883887

884888
pdev->usb_if->dev[dev->ctrl_idx] = dev;

drivers/net/ethernet/apm/xgene/xgene_enet_hw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
593593
if (!xgene_ring_mgr_init(pdata))
594594
return -ENODEV;
595595

596-
if (!efi_enabled(EFI_BOOT)) {
596+
if (pdata->clk) {
597597
clk_prepare_enable(pdata->clk);
598598
clk_disable_unprepare(pdata->clk);
599599
clk_prepare_enable(pdata->clk);

drivers/net/ethernet/apm/xgene/xgene_enet_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,8 @@ static int xgene_enet_remove(struct platform_device *pdev)
10251025
#ifdef CONFIG_ACPI
10261026
static const struct acpi_device_id xgene_enet_acpi_match[] = {
10271027
{ "APMC0D05", },
1028+
{ "APMC0D30", },
1029+
{ "APMC0D31", },
10281030
{ }
10291031
};
10301032
MODULE_DEVICE_TABLE(acpi, xgene_enet_acpi_match);
@@ -1033,6 +1035,8 @@ MODULE_DEVICE_TABLE(acpi, xgene_enet_acpi_match);
10331035
#ifdef CONFIG_OF
10341036
static struct of_device_id xgene_enet_of_match[] = {
10351037
{.compatible = "apm,xgene-enet",},
1038+
{.compatible = "apm,xgene1-sgenet",},
1039+
{.compatible = "apm,xgene1-xgenet",},
10361040
{},
10371041
};
10381042

drivers/net/ethernet/broadcom/bcm63xx_enet.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static int bcm_enet_poll(struct napi_struct *napi, int budget)
486486
{
487487
struct bcm_enet_priv *priv;
488488
struct net_device *dev;
489-
int tx_work_done, rx_work_done;
489+
int rx_work_done;
490490

491491
priv = container_of(napi, struct bcm_enet_priv, napi);
492492
dev = priv->net_dev;
@@ -498,14 +498,14 @@ static int bcm_enet_poll(struct napi_struct *napi, int budget)
498498
ENETDMAC_IR, priv->tx_chan);
499499

500500
/* reclaim sent skb */
501-
tx_work_done = bcm_enet_tx_reclaim(dev, 0);
501+
bcm_enet_tx_reclaim(dev, 0);
502502

503503
spin_lock(&priv->rx_lock);
504504
rx_work_done = bcm_enet_receive_queue(dev, budget);
505505
spin_unlock(&priv->rx_lock);
506506

507-
if (rx_work_done >= budget || tx_work_done > 0) {
508-
/* rx/tx queue is not yet empty/clean */
507+
if (rx_work_done >= budget) {
508+
/* rx queue is not yet empty/clean */
509509
return rx_work_done;
510510
}
511511

drivers/net/ethernet/broadcom/bgmac.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,6 @@ static int bgmac_dma_rx_skb_for_slot(struct bgmac *bgmac,
302302
slot->skb = skb;
303303
slot->dma_addr = dma_addr;
304304

305-
if (slot->dma_addr & 0xC0000000)
306-
bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n");
307-
308305
return 0;
309306
}
310307

@@ -505,8 +502,6 @@ static int bgmac_dma_alloc(struct bgmac *bgmac)
505502
ring->mmio_base);
506503
goto err_dma_free;
507504
}
508-
if (ring->dma_base & 0xC0000000)
509-
bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n");
510505

511506
ring->unaligned = bgmac_dma_unaligned(bgmac, ring,
512507
BGMAC_DMA_RING_TX);
@@ -536,8 +531,6 @@ static int bgmac_dma_alloc(struct bgmac *bgmac)
536531
err = -ENOMEM;
537532
goto err_dma_free;
538533
}
539-
if (ring->dma_base & 0xC0000000)
540-
bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n");
541534

542535
ring->unaligned = bgmac_dma_unaligned(bgmac, ring,
543536
BGMAC_DMA_RING_RX);

drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12722,6 +12722,9 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev,
1272212722
pci_write_config_dword(bp->pdev, PCICFG_GRC_ADDRESS,
1272312723
PCICFG_VENDOR_ID_OFFSET);
1272412724

12725+
/* Set PCIe reset type to fundamental for EEH recovery */
12726+
pdev->needs_freset = 1;
12727+
1272512728
/* AER (Advanced Error reporting) configuration */
1272612729
rc = pci_enable_pcie_error_reporting(pdev);
1272712730
if (!rc)

drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,17 @@ int bcmgenet_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
7373
if (wol->wolopts & ~(WAKE_MAGIC | WAKE_MAGICSECURE))
7474
return -EINVAL;
7575

76+
reg = bcmgenet_umac_readl(priv, UMAC_MPD_CTRL);
7677
if (wol->wolopts & WAKE_MAGICSECURE) {
7778
bcmgenet_umac_writel(priv, get_unaligned_be16(&wol->sopass[0]),
7879
UMAC_MPD_PW_MS);
7980
bcmgenet_umac_writel(priv, get_unaligned_be32(&wol->sopass[2]),
8081
UMAC_MPD_PW_LS);
81-
reg = bcmgenet_umac_readl(priv, UMAC_MPD_CTRL);
8282
reg |= MPD_PW_EN;
83-
bcmgenet_umac_writel(priv, reg, UMAC_MPD_CTRL);
83+
} else {
84+
reg &= ~MPD_PW_EN;
8485
}
86+
bcmgenet_umac_writel(priv, reg, UMAC_MPD_CTRL);
8587

8688
/* Flag the device and relevant IRQ as wakeup capable */
8789
if (wol->wolopts) {

drivers/net/ethernet/cadence/macb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,17 +2113,17 @@ static const struct net_device_ops macb_netdev_ops = {
21132113
};
21142114

21152115
#if defined(CONFIG_OF)
2116-
static struct macb_config pc302gem_config = {
2116+
static const struct macb_config pc302gem_config = {
21172117
.caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE,
21182118
.dma_burst_length = 16,
21192119
};
21202120

2121-
static struct macb_config sama5d3_config = {
2121+
static const struct macb_config sama5d3_config = {
21222122
.caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE,
21232123
.dma_burst_length = 16,
21242124
};
21252125

2126-
static struct macb_config sama5d4_config = {
2126+
static const struct macb_config sama5d4_config = {
21272127
.caps = 0,
21282128
.dma_burst_length = 4,
21292129
};
@@ -2154,7 +2154,7 @@ static void macb_configure_caps(struct macb *bp)
21542154
if (bp->pdev->dev.of_node) {
21552155
match = of_match_node(macb_dt_ids, bp->pdev->dev.of_node);
21562156
if (match && match->data) {
2157-
config = (const struct macb_config *)match->data;
2157+
config = match->data;
21582158

21592159
bp->caps = config->caps;
21602160
/*

drivers/net/ethernet/cadence/macb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@
351351

352352
/* Bitfields in MID */
353353
#define MACB_IDNUM_OFFSET 16
354-
#define MACB_IDNUM_SIZE 16
354+
#define MACB_IDNUM_SIZE 12
355355
#define MACB_REV_OFFSET 0
356356
#define MACB_REV_SIZE 16
357357

0 commit comments

Comments
 (0)