Skip to content

Commit 71aa60f

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix NAPI poll list corruption in enic driver, from Christian Lamparter. 2) Fix route use after free, from Eric Dumazet. 3) Fix regression in reuseaddr handling, from Josef Bacik. 4) Assert the size of control messages in compat handling since we copy it in from userspace twice. From Meng Xu. 5) SMC layer bug fixes (missing RCU locking, bad refcounting, etc.) from Ursula Braun. 6) Fix races in AF_PACKET fanout handling, from Willem de Bruijn. 7) Don't use ARRAY_SIZE on spinlock array which might have zero entries, from Geert Uytterhoeven. 8) Fix miscomputation of checksum in ipv6 udp code, from Subash Abhinov Kasiviswanathan. 9) Push the ipv6 header properly in ipv6 GRE tunnel driver, from Xin Long. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (75 commits) inet: fix improper empty comparison net: use inet6_rcv_saddr to compare sockets net: set tb->fast_sk_family net: orphan frags on stand-alone ptype in dev_queue_xmit_nit MAINTAINERS: update git tree locations for ieee802154 subsystem net: prevent dst uses after free net: phy: Fix truncation of large IRQ numbers in phy_attached_print() net/smc: no close wait in case of process shut down net/smc: introduce a delay net/smc: terminate link group if out-of-sync is received net/smc: longer delay for client link group removal net/smc: adapt send request completion notification net/smc: adjust net_device refcount net/smc: take RCU read lock for routing cache lookup net/smc: add receive timeout check net/smc: add missing dev_put net: stmmac: Cocci spatch "of_table" lan78xx: Use default values loaded from EEPROM/OTP after reset lan78xx: Allow EEPROM write for less than MAX_EEPROM_SIZE lan78xx: Fix for eeprom read/write when device auto suspend ...
2 parents 79444df + 4e683f4 commit 71aa60f

Some content is hidden

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

71 files changed

+646
-414
lines changed

Documentation/networking/ip-sysctl.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,6 +1680,9 @@ accept_dad - INTEGER
16801680
2: Enable DAD, and disable IPv6 operation if MAC-based duplicate
16811681
link-local address has been found.
16821682

1683+
DAD operation and mode on a given interface will be selected according
1684+
to the maximum value of conf/{all,interface}/accept_dad.
1685+
16831686
force_tllao - BOOLEAN
16841687
Enable sending the target link-layer address option even when
16851688
responding to a unicast neighbor solicitation.
@@ -1727,16 +1730,23 @@ suppress_frag_ndisc - INTEGER
17271730

17281731
optimistic_dad - BOOLEAN
17291732
Whether to perform Optimistic Duplicate Address Detection (RFC 4429).
1730-
0: disabled (default)
1731-
1: enabled
1733+
0: disabled (default)
1734+
1: enabled
1735+
1736+
Optimistic Duplicate Address Detection for the interface will be enabled
1737+
if at least one of conf/{all,interface}/optimistic_dad is set to 1,
1738+
it will be disabled otherwise.
17321739

17331740
use_optimistic - BOOLEAN
17341741
If enabled, do not classify optimistic addresses as deprecated during
17351742
source address selection. Preferred addresses will still be chosen
17361743
before optimistic addresses, subject to other ranking in the source
17371744
address selection algorithm.
1738-
0: disabled (default)
1739-
1: enabled
1745+
0: disabled (default)
1746+
1: enabled
1747+
1748+
This will be enabled if at least one of
1749+
conf/{all,interface}/use_optimistic is set to 1, disabled otherwise.
17401750

17411751
stable_secret - IPv6 address
17421752
This IPv6 address will be used as a secret to generate IPv6

Documentation/networking/switchdev.txt

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,42 @@ an example setup using a data-center-class switch ASIC chip. Other setups
1313
with SR-IOV or soft switches, such as OVS, are possible.
1414

1515

16-
                             User-spacetools
17-
18-
       userspace                   |
19-
      +-------------------------------------------------------------------+
20-
       kernel                       | Netlink
21-
                                    |
22-
                     +--------------+-------------------------------+
23-
                     |         Networkstack                        |
24-
                     |           (Linux)                            |
25-
                     |                                              |
26-
                     +----------------------------------------------+
16+
User-space tools
17+
18+
user space |
19+
+-------------------------------------------------------------------+
20+
kernel | Netlink
21+
|
22+
+--------------+-------------------------------+
23+
| Network stack |
24+
| (Linux) |
25+
| |
26+
+----------------------------------------------+
2727

2828
sw1p2 sw1p4 sw1p6
29-
                      sw1p1+ sw1p3 + sw1p5 +         eth1
30-
                        +    |    +    |    +    |            +
31-
                        |    |    |    |    |    |            |
32-
                     +--+----+----+----+-+--+----+---+  +-----+-----+
33-
                     |         Switchdriver         |  |    mgmt   |
34-
                     |        (thisdocument)        |  |   driver  |
35-
                     |                               |  |           |
36-
                     +--------------+----------------+  +-----------+
37-
                                    |
38-
       kernel                       | HW bus(egPCI)
39-
      +-------------------------------------------------------------------+
40-
       hardware                     |
41-
                     +--------------+---+------------+
42-
                     |         Switchdevice (sw1)   |
43-
                     |  +----+                       +--------+
44-
                     |  |    v offloadeddatapath   | mgmtport
45-
                     |  |    |                       |
46-
                     +--|----|----+----+----+----+---+
47-
                        |    |    |    |    |    |
48-
                        +    +    +    +    +    +
49-
                       p1   p2   p3   p4   p5   p6
50-
51-
                             front-panelports
29+
sw1p1 + sw1p3 + sw1p5 + eth1
30+
+ | + | + | +
31+
| | | | | | |
32+
+--+----+----+----+----+----+---+ +-----+-----+
33+
| Switch driver | | mgmt |
34+
| (this document) | | driver |
35+
| | | |
36+
+--------------+----------------+ +-----------+
37+
|
38+
kernel | HW bus (eg PCI)
39+
+-------------------------------------------------------------------+
40+
hardware |
41+
+--------------+----------------+
42+
| Switch device (sw1) |
43+
| +----+ +--------+
44+
| | v offloaded data path | mgmt port
45+
| | | |
46+
+--|----|----+----+----+----+---+
47+
| | | | | |
48+
+ + + + + +
49+
p1 p2 p3 p4 p5 p6
50+
51+
front-panel ports
5252

5353

5454
Fig 1.

MAINTAINERS

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2865,7 +2865,6 @@ S: Supported
28652865
F: drivers/scsi/bnx2i/
28662866

28672867
BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
2868-
M: Yuval Mintz <[email protected]>
28692868
M: Ariel Elior <[email protected]>
28702869
28712870
@@ -6655,8 +6654,8 @@ M: Alexander Aring <[email protected]>
66556654
M: Stefan Schmidt <[email protected]>
66566655
66576656
W: http://wpan.cakelab.org/
6658-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git
6659-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
6657+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan.git
6658+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan-next.git
66606659
S: Maintained
66616660
F: net/ieee802154/
66626661
F: net/mac802154/
@@ -11059,7 +11058,6 @@ S: Supported
1105911058
F: drivers/scsi/qedi/
1106011059

1106111060
QLOGIC QL4xxx ETHERNET DRIVER
11062-
M: Yuval Mintz <[email protected]>
1106311061
M: Ariel Elior <[email protected]>
1106411062
1106511063

drivers/isdn/i4l/isdn_ppp.c

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,6 @@ isdn_ppp_write(int min, struct file *file, const char __user *buf, int count)
825825
isdn_net_local *lp;
826826
struct ippp_struct *is;
827827
int proto;
828-
unsigned char protobuf[4];
829828

830829
is = file->private_data;
831830

@@ -839,24 +838,28 @@ isdn_ppp_write(int min, struct file *file, const char __user *buf, int count)
839838
if (!lp)
840839
printk(KERN_DEBUG "isdn_ppp_write: lp == NULL\n");
841840
else {
842-
/*
843-
* Don't reset huptimer for
844-
* LCP packets. (Echo requests).
845-
*/
846-
if (copy_from_user(protobuf, buf, 4))
847-
return -EFAULT;
848-
proto = PPP_PROTOCOL(protobuf);
849-
if (proto != PPP_LCP)
850-
lp->huptimer = 0;
841+
if (lp->isdn_device < 0 || lp->isdn_channel < 0) {
842+
unsigned char protobuf[4];
843+
/*
844+
* Don't reset huptimer for
845+
* LCP packets. (Echo requests).
846+
*/
847+
if (copy_from_user(protobuf, buf, 4))
848+
return -EFAULT;
849+
850+
proto = PPP_PROTOCOL(protobuf);
851+
if (proto != PPP_LCP)
852+
lp->huptimer = 0;
851853

852-
if (lp->isdn_device < 0 || lp->isdn_channel < 0)
853854
return 0;
855+
}
854856

855857
if ((dev->drv[lp->isdn_device]->flags & DRV_FLAG_RUNNING) &&
856858
lp->dialstate == 0 &&
857859
(lp->flags & ISDN_NET_CONNECTED)) {
858860
unsigned short hl;
859861
struct sk_buff *skb;
862+
unsigned char *cpy_buf;
860863
/*
861864
* we need to reserve enough space in front of
862865
* sk_buff. old call to dev_alloc_skb only reserved
@@ -869,11 +872,21 @@ isdn_ppp_write(int min, struct file *file, const char __user *buf, int count)
869872
return count;
870873
}
871874
skb_reserve(skb, hl);
872-
if (copy_from_user(skb_put(skb, count), buf, count))
875+
cpy_buf = skb_put(skb, count);
876+
if (copy_from_user(cpy_buf, buf, count))
873877
{
874878
kfree_skb(skb);
875879
return -EFAULT;
876880
}
881+
882+
/*
883+
* Don't reset huptimer for
884+
* LCP packets. (Echo requests).
885+
*/
886+
proto = PPP_PROTOCOL(cpy_buf);
887+
if (proto != PPP_LCP)
888+
lp->huptimer = 0;
889+
877890
if (is->debug & 0x40) {
878891
printk(KERN_DEBUG "ppp xmit: len %d\n", (int) skb->len);
879892
isdn_ppp_frame_log("xmit", skb->data, skb->len, 32, is->unit, lp->ppp_slot);

drivers/net/ethernet/broadcom/bcmsysport.c

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -432,18 +432,44 @@ static void bcm_sysport_update_mib_counters(struct bcm_sysport_priv *priv)
432432
netif_dbg(priv, hw, priv->netdev, "updated MIB counters\n");
433433
}
434434

435+
static void bcm_sysport_update_tx_stats(struct bcm_sysport_priv *priv,
436+
u64 *tx_bytes, u64 *tx_packets)
437+
{
438+
struct bcm_sysport_tx_ring *ring;
439+
u64 bytes = 0, packets = 0;
440+
unsigned int start;
441+
unsigned int q;
442+
443+
for (q = 0; q < priv->netdev->num_tx_queues; q++) {
444+
ring = &priv->tx_rings[q];
445+
do {
446+
start = u64_stats_fetch_begin_irq(&priv->syncp);
447+
bytes = ring->bytes;
448+
packets = ring->packets;
449+
} while (u64_stats_fetch_retry_irq(&priv->syncp, start));
450+
451+
*tx_bytes += bytes;
452+
*tx_packets += packets;
453+
}
454+
}
455+
435456
static void bcm_sysport_get_stats(struct net_device *dev,
436457
struct ethtool_stats *stats, u64 *data)
437458
{
438459
struct bcm_sysport_priv *priv = netdev_priv(dev);
439460
struct bcm_sysport_stats64 *stats64 = &priv->stats64;
440461
struct u64_stats_sync *syncp = &priv->syncp;
441462
struct bcm_sysport_tx_ring *ring;
463+
u64 tx_bytes = 0, tx_packets = 0;
442464
unsigned int start;
443465
int i, j;
444466

445-
if (netif_running(dev))
467+
if (netif_running(dev)) {
446468
bcm_sysport_update_mib_counters(priv);
469+
bcm_sysport_update_tx_stats(priv, &tx_bytes, &tx_packets);
470+
stats64->tx_bytes = tx_bytes;
471+
stats64->tx_packets = tx_packets;
472+
}
447473

448474
for (i = 0, j = 0; i < BCM_SYSPORT_STATS_LEN; i++) {
449475
const struct bcm_sysport_stats *s;
@@ -461,12 +487,13 @@ static void bcm_sysport_get_stats(struct net_device *dev,
461487
continue;
462488
p += s->stat_offset;
463489

464-
if (s->stat_sizeof == sizeof(u64))
490+
if (s->stat_sizeof == sizeof(u64) &&
491+
s->type == BCM_SYSPORT_STAT_NETDEV64) {
465492
do {
466493
start = u64_stats_fetch_begin_irq(syncp);
467494
data[i] = *(u64 *)p;
468495
} while (u64_stats_fetch_retry_irq(syncp, start));
469-
else
496+
} else
470497
data[i] = *(u32 *)p;
471498
j++;
472499
}
@@ -1716,27 +1743,12 @@ static void bcm_sysport_get_stats64(struct net_device *dev,
17161743
{
17171744
struct bcm_sysport_priv *priv = netdev_priv(dev);
17181745
struct bcm_sysport_stats64 *stats64 = &priv->stats64;
1719-
struct bcm_sysport_tx_ring *ring;
1720-
u64 tx_packets = 0, tx_bytes = 0;
17211746
unsigned int start;
1722-
unsigned int q;
17231747

17241748
netdev_stats_to_stats64(stats, &dev->stats);
17251749

1726-
for (q = 0; q < dev->num_tx_queues; q++) {
1727-
ring = &priv->tx_rings[q];
1728-
do {
1729-
start = u64_stats_fetch_begin_irq(&priv->syncp);
1730-
tx_bytes = ring->bytes;
1731-
tx_packets = ring->packets;
1732-
} while (u64_stats_fetch_retry_irq(&priv->syncp, start));
1733-
1734-
stats->tx_bytes += tx_bytes;
1735-
stats->tx_packets += tx_packets;
1736-
}
1737-
1738-
stats64->tx_bytes = stats->tx_bytes;
1739-
stats64->tx_packets = stats->tx_packets;
1750+
bcm_sysport_update_tx_stats(priv, &stats->tx_bytes,
1751+
&stats->tx_packets);
17401752

17411753
do {
17421754
start = u64_stats_fetch_begin_irq(&priv->syncp);

drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,10 @@ int bnxt_tc_setup_flower(struct bnxt *bp, u16 src_fid,
750750
{
751751
int rc = 0;
752752

753+
if (!is_classid_clsact_ingress(cls_flower->common.classid) ||
754+
cls_flower->common.chain_index)
755+
return -EOPNOTSUPP;
756+
753757
switch (cls_flower->command) {
754758
case TC_CLSFLOWER_REPLACE:
755759
rc = bnxt_tc_add_flow(bp, src_fid, cls_flower);

drivers/net/ethernet/freescale/fec.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ struct bufdesc_ex {
374374
#define FEC_ENET_TS_AVAIL ((uint)0x00010000)
375375
#define FEC_ENET_TS_TIMER ((uint)0x00008000)
376376

377-
#define FEC_DEFAULT_IMASK (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII | FEC_ENET_TS_TIMER)
378-
#define FEC_NAPI_IMASK (FEC_ENET_MII | FEC_ENET_TS_TIMER)
377+
#define FEC_DEFAULT_IMASK (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII)
378+
#define FEC_NAPI_IMASK FEC_ENET_MII
379379
#define FEC_RX_DISABLED_IMASK (FEC_DEFAULT_IMASK & (~FEC_ENET_RXF))
380380

381381
/* ENET interrupt coalescing macro define */

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,14 +1559,14 @@ fec_enet_collect_events(struct fec_enet_private *fep, uint int_events)
15591559
if (int_events == 0)
15601560
return false;
15611561

1562-
if (int_events & FEC_ENET_RXF)
1562+
if (int_events & FEC_ENET_RXF_0)
15631563
fep->work_rx |= (1 << 2);
15641564
if (int_events & FEC_ENET_RXF_1)
15651565
fep->work_rx |= (1 << 0);
15661566
if (int_events & FEC_ENET_RXF_2)
15671567
fep->work_rx |= (1 << 1);
15681568

1569-
if (int_events & FEC_ENET_TXF)
1569+
if (int_events & FEC_ENET_TXF_0)
15701570
fep->work_tx |= (1 << 2);
15711571
if (int_events & FEC_ENET_TXF_1)
15721572
fep->work_tx |= (1 << 0);
@@ -1604,8 +1604,8 @@ fec_enet_interrupt(int irq, void *dev_id)
16041604
}
16051605

16061606
if (fep->ptp_clock)
1607-
fec_ptp_check_pps_event(fep);
1608-
1607+
if (fec_ptp_check_pps_event(fep))
1608+
ret = IRQ_HANDLED;
16091609
return ret;
16101610
}
16111611

0 commit comments

Comments
 (0)