Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Browse files Browse the repository at this point in the history
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
  ...
  • Loading branch information
torvalds committed Sep 23, 2017
2 parents 79444df + 4e683f4 commit 71aa60f
Show file tree
Hide file tree
Showing 71 changed files with 646 additions and 414 deletions.
18 changes: 14 additions & 4 deletions Documentation/networking/ip-sysctl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,9 @@ accept_dad - INTEGER
2: Enable DAD, and disable IPv6 operation if MAC-based duplicate
link-local address has been found.

DAD operation and mode on a given interface will be selected according
to the maximum value of conf/{all,interface}/accept_dad.

force_tllao - BOOLEAN
Enable sending the target link-layer address option even when
responding to a unicast neighbor solicitation.
Expand Down Expand Up @@ -1727,16 +1730,23 @@ suppress_frag_ndisc - INTEGER

optimistic_dad - BOOLEAN
Whether to perform Optimistic Duplicate Address Detection (RFC 4429).
0: disabled (default)
1: enabled
0: disabled (default)
1: enabled

Optimistic Duplicate Address Detection for the interface will be enabled
if at least one of conf/{all,interface}/optimistic_dad is set to 1,
it will be disabled otherwise.

use_optimistic - BOOLEAN
If enabled, do not classify optimistic addresses as deprecated during
source address selection. Preferred addresses will still be chosen
before optimistic addresses, subject to other ranking in the source
address selection algorithm.
0: disabled (default)
1: enabled
0: disabled (default)
1: enabled

This will be enabled if at least one of
conf/{all,interface}/use_optimistic is set to 1, disabled otherwise.

stable_secret - IPv6 address
This IPv6 address will be used as a secret to generate IPv6
Expand Down
68 changes: 34 additions & 34 deletions Documentation/networking/switchdev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,42 @@ an example setup using a data-center-class switch ASIC chip. Other setups
with SR-IOV or soft switches, such as OVS, are possible.


                             User-spacetools

       userspace                   |
      +-------------------------------------------------------------------+
       kernel                       | Netlink
                                    |
                     +--------------+-------------------------------+
                     |         Networkstack                        |
                     |           (Linux)                            |
                     |                                              |
                     +----------------------------------------------+
User-space tools

user space |
+-------------------------------------------------------------------+
kernel | Netlink
|
+--------------+-------------------------------+
| Network stack |
| (Linux) |
| |
+----------------------------------------------+

sw1p2 sw1p4 sw1p6
                      sw1p1+ sw1p3 + sw1p5 +         eth1
                        +    |    +    |    +    |            +
                        |    |    |    |    |    |            |
                     +--+----+----+----+-+--+----+---+  +-----+-----+
                     |         Switchdriver         |  |    mgmt   |
                     |        (thisdocument)        |  |   driver  |
                     |                               |  |           |
                     +--------------+----------------+  +-----------+
                                    |
       kernel                       | HW bus(egPCI)
      +-------------------------------------------------------------------+
       hardware                     |
                     +--------------+---+------------+
                     |         Switchdevice (sw1)   |
                     |  +----+                       +--------+
                     |  |    v offloadeddatapath   | mgmtport
                     |  |    |                       |
                     +--|----|----+----+----+----+---+
                        |    |    |    |    |    |
                        +    +    +    +    +    +
                       p1   p2   p3   p4   p5   p6

                             front-panelports
sw1p1 + sw1p3 + sw1p5 + eth1
+ | + | + | +
| | | | | | |
+--+----+----+----+----+----+---+ +-----+-----+
| Switch driver | | mgmt |
| (this document) | | driver |
| | | |
+--------------+----------------+ +-----------+
|
kernel | HW bus (eg PCI)
+-------------------------------------------------------------------+
hardware |
+--------------+----------------+
| Switch device (sw1) |
| +----+ +--------+
| | v offloaded data path | mgmt port
| | | |
+--|----|----+----+----+----+---+
| | | | | |
+ + + + + +
p1 p2 p3 p4 p5 p6

front-panel ports


Fig 1.
Expand Down
6 changes: 2 additions & 4 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2865,7 +2865,6 @@ S: Supported
F: drivers/scsi/bnx2i/

BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
M: Yuval Mintz <[email protected]>
M: Ariel Elior <[email protected]>
M: [email protected]
L: [email protected]
Expand Down Expand Up @@ -6655,8 +6654,8 @@ M: Alexander Aring <[email protected]>
M: Stefan Schmidt <[email protected]>
L: [email protected]
W: http://wpan.cakelab.org/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan-next.git
S: Maintained
F: net/ieee802154/
F: net/mac802154/
Expand Down Expand Up @@ -11059,7 +11058,6 @@ S: Supported
F: drivers/scsi/qedi/

QLOGIC QL4xxx ETHERNET DRIVER
M: Yuval Mintz <[email protected]>
M: Ariel Elior <[email protected]>
M: [email protected]
L: [email protected]
Expand Down
37 changes: 25 additions & 12 deletions drivers/isdn/i4l/isdn_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,6 @@ isdn_ppp_write(int min, struct file *file, const char __user *buf, int count)
isdn_net_local *lp;
struct ippp_struct *is;
int proto;
unsigned char protobuf[4];

is = file->private_data;

Expand All @@ -839,24 +838,28 @@ isdn_ppp_write(int min, struct file *file, const char __user *buf, int count)
if (!lp)
printk(KERN_DEBUG "isdn_ppp_write: lp == NULL\n");
else {
/*
* Don't reset huptimer for
* LCP packets. (Echo requests).
*/
if (copy_from_user(protobuf, buf, 4))
return -EFAULT;
proto = PPP_PROTOCOL(protobuf);
if (proto != PPP_LCP)
lp->huptimer = 0;
if (lp->isdn_device < 0 || lp->isdn_channel < 0) {
unsigned char protobuf[4];
/*
* Don't reset huptimer for
* LCP packets. (Echo requests).
*/
if (copy_from_user(protobuf, buf, 4))
return -EFAULT;

proto = PPP_PROTOCOL(protobuf);
if (proto != PPP_LCP)
lp->huptimer = 0;

if (lp->isdn_device < 0 || lp->isdn_channel < 0)
return 0;
}

if ((dev->drv[lp->isdn_device]->flags & DRV_FLAG_RUNNING) &&
lp->dialstate == 0 &&
(lp->flags & ISDN_NET_CONNECTED)) {
unsigned short hl;
struct sk_buff *skb;
unsigned char *cpy_buf;
/*
* we need to reserve enough space in front of
* sk_buff. old call to dev_alloc_skb only reserved
Expand All @@ -869,11 +872,21 @@ isdn_ppp_write(int min, struct file *file, const char __user *buf, int count)
return count;
}
skb_reserve(skb, hl);
if (copy_from_user(skb_put(skb, count), buf, count))
cpy_buf = skb_put(skb, count);
if (copy_from_user(cpy_buf, buf, count))
{
kfree_skb(skb);
return -EFAULT;
}

/*
* Don't reset huptimer for
* LCP packets. (Echo requests).
*/
proto = PPP_PROTOCOL(cpy_buf);
if (proto != PPP_LCP)
lp->huptimer = 0;

if (is->debug & 0x40) {
printk(KERN_DEBUG "ppp xmit: len %d\n", (int) skb->len);
isdn_ppp_frame_log("xmit", skb->data, skb->len, 32, is->unit, lp->ppp_slot);
Expand Down
52 changes: 32 additions & 20 deletions drivers/net/ethernet/broadcom/bcmsysport.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,18 +432,44 @@ static void bcm_sysport_update_mib_counters(struct bcm_sysport_priv *priv)
netif_dbg(priv, hw, priv->netdev, "updated MIB counters\n");
}

static void bcm_sysport_update_tx_stats(struct bcm_sysport_priv *priv,
u64 *tx_bytes, u64 *tx_packets)
{
struct bcm_sysport_tx_ring *ring;
u64 bytes = 0, packets = 0;
unsigned int start;
unsigned int q;

for (q = 0; q < priv->netdev->num_tx_queues; q++) {
ring = &priv->tx_rings[q];
do {
start = u64_stats_fetch_begin_irq(&priv->syncp);
bytes = ring->bytes;
packets = ring->packets;
} while (u64_stats_fetch_retry_irq(&priv->syncp, start));

*tx_bytes += bytes;
*tx_packets += packets;
}
}

static void bcm_sysport_get_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *data)
{
struct bcm_sysport_priv *priv = netdev_priv(dev);
struct bcm_sysport_stats64 *stats64 = &priv->stats64;
struct u64_stats_sync *syncp = &priv->syncp;
struct bcm_sysport_tx_ring *ring;
u64 tx_bytes = 0, tx_packets = 0;
unsigned int start;
int i, j;

if (netif_running(dev))
if (netif_running(dev)) {
bcm_sysport_update_mib_counters(priv);
bcm_sysport_update_tx_stats(priv, &tx_bytes, &tx_packets);
stats64->tx_bytes = tx_bytes;
stats64->tx_packets = tx_packets;
}

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

if (s->stat_sizeof == sizeof(u64))
if (s->stat_sizeof == sizeof(u64) &&
s->type == BCM_SYSPORT_STAT_NETDEV64) {
do {
start = u64_stats_fetch_begin_irq(syncp);
data[i] = *(u64 *)p;
} while (u64_stats_fetch_retry_irq(syncp, start));
else
} else
data[i] = *(u32 *)p;
j++;
}
Expand Down Expand Up @@ -1716,27 +1743,12 @@ static void bcm_sysport_get_stats64(struct net_device *dev,
{
struct bcm_sysport_priv *priv = netdev_priv(dev);
struct bcm_sysport_stats64 *stats64 = &priv->stats64;
struct bcm_sysport_tx_ring *ring;
u64 tx_packets = 0, tx_bytes = 0;
unsigned int start;
unsigned int q;

netdev_stats_to_stats64(stats, &dev->stats);

for (q = 0; q < dev->num_tx_queues; q++) {
ring = &priv->tx_rings[q];
do {
start = u64_stats_fetch_begin_irq(&priv->syncp);
tx_bytes = ring->bytes;
tx_packets = ring->packets;
} while (u64_stats_fetch_retry_irq(&priv->syncp, start));

stats->tx_bytes += tx_bytes;
stats->tx_packets += tx_packets;
}

stats64->tx_bytes = stats->tx_bytes;
stats64->tx_packets = stats->tx_packets;
bcm_sysport_update_tx_stats(priv, &stats->tx_bytes,
&stats->tx_packets);

do {
start = u64_stats_fetch_begin_irq(&priv->syncp);
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,10 @@ int bnxt_tc_setup_flower(struct bnxt *bp, u16 src_fid,
{
int rc = 0;

if (!is_classid_clsact_ingress(cls_flower->common.classid) ||
cls_flower->common.chain_index)
return -EOPNOTSUPP;

switch (cls_flower->command) {
case TC_CLSFLOWER_REPLACE:
rc = bnxt_tc_add_flow(bp, src_fid, cls_flower);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/freescale/fec.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ struct bufdesc_ex {
#define FEC_ENET_TS_AVAIL ((uint)0x00010000)
#define FEC_ENET_TS_TIMER ((uint)0x00008000)

#define FEC_DEFAULT_IMASK (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII | FEC_ENET_TS_TIMER)
#define FEC_NAPI_IMASK (FEC_ENET_MII | FEC_ENET_TS_TIMER)
#define FEC_DEFAULT_IMASK (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII)
#define FEC_NAPI_IMASK FEC_ENET_MII
#define FEC_RX_DISABLED_IMASK (FEC_DEFAULT_IMASK & (~FEC_ENET_RXF))

/* ENET interrupt coalescing macro define */
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/freescale/fec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1559,14 +1559,14 @@ fec_enet_collect_events(struct fec_enet_private *fep, uint int_events)
if (int_events == 0)
return false;

if (int_events & FEC_ENET_RXF)
if (int_events & FEC_ENET_RXF_0)
fep->work_rx |= (1 << 2);
if (int_events & FEC_ENET_RXF_1)
fep->work_rx |= (1 << 0);
if (int_events & FEC_ENET_RXF_2)
fep->work_rx |= (1 << 1);

if (int_events & FEC_ENET_TXF)
if (int_events & FEC_ENET_TXF_0)
fep->work_tx |= (1 << 2);
if (int_events & FEC_ENET_TXF_1)
fep->work_tx |= (1 << 0);
Expand Down Expand Up @@ -1604,8 +1604,8 @@ fec_enet_interrupt(int irq, void *dev_id)
}

if (fep->ptp_clock)
fec_ptp_check_pps_event(fep);

if (fec_ptp_check_pps_event(fep))
ret = IRQ_HANDLED;
return ret;
}

Expand Down
Loading

0 comments on commit 71aa60f

Please sign in to comment.