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 out-of-bounds array access in netfilter ipset, from Jozsef
    Kadlecsik.

 2) Use correct free operation on netfilter conntrack templates, from
    Daniel Borkmann.

 3) Fix route leak in SCTP, from Marcelo Ricardo Leitner.

 4) Fix sizeof(pointer) in mac80211, from Thierry Reding.

 5) Fix cache pointer comparison in ip6mr leading to missed unlock of
    mrt_lock.  From Richard Laing.

 6) rds_conn_lookup() needs to consider network namespace in key
    comparison, from Sowmini Varadhan.

 7) Fix deadlock in TIPC code wrt broadcast link wakeups, from Kolmakov
    Dmitriy.

 8) Fix fd leaks in bpf syscall, from Daniel Borkmann.

 9) Fix error recovery when installing ipv6 multipath routes, we would
    delete the old route before we would know if we could fully commit
    to the new set of nexthops.  Fix from Roopa Prabhu.

10) Fix run-time suspend problems in r8152, from Hayes Wang.

11) In fec, don't program the MAC address into the chip when the clocks
    are gated off.  From Fugang Duan.

12) Fix poll behavior for netlink sockets when using rx ring mmap, from
    Daniel Borkmann.

13) Don't allocate memory with GFP_KERNEL from get_stats64 in r8169
    driver, from Corinna Vinschen.

14) In TCP Cubic congestion control, handle idle periods better where we
    are application limited, in order to keep cwnd from growing out of
    control.  From Eric Dumzet.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (65 commits)
  tcp_cubic: better follow cubic curve after idle period
  tcp: generate CA_EVENT_TX_START on data frames
  xen-netfront: respect user provided max_queues
  xen-netback: respect user provided max_queues
  r8169: Fix sleeping function called during get_stats64, v2
  ether: add IEEE 1722 ethertype - TSN
  netlink, mmap: fix edge-case leakages in nf queue zero-copy
  netlink, mmap: don't walk rx ring on poll if receive queue non-empty
  cxgb4: changes for new firmware 1.14.4.0
  net: fec: add netif status check before set mac address
  r8152: fix the runtime suspend issues
  r8152: split DRIVER_VERSION
  ipv6: fix ifnullfree.cocci warnings
  add microchip LAN88xx phy driver
  stmmac: fix check for phydev being open
  net: qlcnic: delete redundant memsets
  net: mv643xx_eth: use kzalloc
  net: jme: use kzalloc() instead of kmalloc+memset
  net: cavium: liquidio: use kzalloc in setup_glist()
  net: ipv6: use common fib_default_rule_pref
  ...
  • Loading branch information
torvalds committed Sep 10, 2015
2 parents b8889c4 + 3092752 commit 65c61bc
Show file tree
Hide file tree
Showing 78 changed files with 994 additions and 315 deletions.
14 changes: 8 additions & 6 deletions drivers/base/property.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,13 +611,15 @@ static void *device_get_mac_addr(struct device *dev,
*/
void *device_get_mac_address(struct device *dev, char *addr, int alen)
{
addr = device_get_mac_addr(dev, "mac-address", addr, alen);
if (addr)
return addr;
char *res;

addr = device_get_mac_addr(dev, "local-mac-address", addr, alen);
if (addr)
return addr;
res = device_get_mac_addr(dev, "mac-address", addr, alen);
if (res)
return res;

res = device_get_mac_addr(dev, "local-mac-address", addr, alen);
if (res)
return res;

return device_get_mac_addr(dev, "address", addr, alen);
}
Expand Down
12 changes: 8 additions & 4 deletions drivers/net/dsa/bcm_sf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ static int bcm_sf2_sw_fast_age_port(struct dsa_switch *ds, int port)
core_writel(priv, port, CORE_FAST_AGE_PORT);

reg = core_readl(priv, CORE_FAST_AGE_CTRL);
reg |= EN_AGE_PORT | FAST_AGE_STR_DONE;
reg |= EN_AGE_PORT | EN_AGE_DYNAMIC | FAST_AGE_STR_DONE;
core_writel(priv, reg, CORE_FAST_AGE_CTRL);

do {
Expand All @@ -432,6 +432,8 @@ static int bcm_sf2_sw_fast_age_port(struct dsa_switch *ds, int port)
if (!timeout)
return -ETIMEDOUT;

core_writel(priv, 0, CORE_FAST_AGE_CTRL);

return 0;
}

Expand Down Expand Up @@ -507,7 +509,7 @@ static int bcm_sf2_sw_br_set_stp_state(struct dsa_switch *ds, int port,
u32 reg;

reg = core_readl(priv, CORE_G_PCTL_PORT(port));
cur_hw_state = reg >> G_MISTP_STATE_SHIFT;
cur_hw_state = reg & (G_MISTP_STATE_MASK << G_MISTP_STATE_SHIFT);

switch (state) {
case BR_STATE_DISABLED:
Expand All @@ -531,10 +533,12 @@ static int bcm_sf2_sw_br_set_stp_state(struct dsa_switch *ds, int port,
}

/* Fast-age ARL entries if we are moving a port from Learning or
* Forwarding state to Disabled, Blocking or Listening state
* Forwarding (cur_hw_state) state to Disabled, Blocking or Listening
* state (hw_state)
*/
if (cur_hw_state != hw_state) {
if (cur_hw_state & 4 && !(hw_state & 4)) {
if (cur_hw_state >= G_MISTP_LEARN_STATE &&
hw_state <= G_MISTP_LISTEN_STATE) {
ret = bcm_sf2_sw_fast_age_port(ds, port);
if (ret) {
pr_err("%s: fast-ageing failed\n", __func__);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/dsa/bcm_sf2.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ static inline u64 name##_readq(struct bcm_sf2_priv *priv, u32 off) \
spin_unlock(&priv->indir_lock); \
return (u64)indir << 32 | dir; \
} \
static inline void name##_writeq(struct bcm_sf2_priv *priv, u32 off, \
u64 val) \
static inline void name##_writeq(struct bcm_sf2_priv *priv, u64 val, \
u32 off) \
{ \
spin_lock(&priv->indir_lock); \
reg_writel(priv, upper_32_bits(val), REG_DIR_DATA_WRITE); \
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/dsa/mv88e6171.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ struct dsa_switch_driver mv88e6171_switch_driver = {
.port_join_bridge = mv88e6xxx_join_bridge,
.port_leave_bridge = mv88e6xxx_leave_bridge,
.port_stp_update = mv88e6xxx_port_stp_update,
.port_pvid_get = mv88e6xxx_port_pvid_get,
.port_pvid_set = mv88e6xxx_port_pvid_set,
.port_vlan_add = mv88e6xxx_port_vlan_add,
.port_vlan_del = mv88e6xxx_port_vlan_del,
.vlan_getnext = mv88e6xxx_vlan_getnext,
.port_fdb_add = mv88e6xxx_port_fdb_add,
.port_fdb_del = mv88e6xxx_port_fdb_del,
.port_fdb_getnext = mv88e6xxx_port_fdb_getnext,
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/altera/altera_tse_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,7 @@ static int tse_poll(struct napi_struct *napi, int budget)

if (rxcomplete < budget) {

napi_gro_flush(napi, false);
__napi_complete(napi);
napi_complete(napi);

netdev_dbg(priv->dev,
"NAPI Complete, did %d packets with budget %d\n",
Expand Down Expand Up @@ -1518,6 +1517,7 @@ static int altera_tse_probe(struct platform_device *pdev)
spin_lock_init(&priv->tx_lock);
spin_lock_init(&priv->rxdma_irq_lock);

netif_carrier_off(ndev);
ret = register_netdev(ndev);
if (ret) {
dev_err(&pdev->dev, "failed to register TSE net device\n");
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/ethernet/cavium/liquidio/lio_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,10 +818,9 @@ static int setup_glist(struct lio *lio)
INIT_LIST_HEAD(&lio->glist);

for (i = 0; i < lio->tx_qsize; i++) {
g = kmalloc(sizeof(*g), GFP_KERNEL);
g = kzalloc(sizeof(*g), GFP_KERNEL);
if (!g)
break;
memset(g, 0, sizeof(struct octnic_gather));

g->sg_size =
((ROUNDUP4(OCTNIC_MAX_SG) >> 2) * OCT_SG_ENTRY_SIZE);
Expand Down
24 changes: 11 additions & 13 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4568,28 +4568,23 @@ static void free_some_resources(struct adapter *adapter)

static int get_chip_type(struct pci_dev *pdev, u32 pl_rev)
{
int ver, chip;
u16 device_id;

/* Retrieve adapter's device ID */
pci_read_config_word(pdev, PCI_DEVICE_ID, &device_id);
ver = device_id >> 12;
switch (ver) {

switch (device_id >> 12) {
case CHELSIO_T4:
chip |= CHELSIO_CHIP_CODE(CHELSIO_T4, pl_rev);
break;
return CHELSIO_CHIP_CODE(CHELSIO_T4, pl_rev);
case CHELSIO_T5:
chip |= CHELSIO_CHIP_CODE(CHELSIO_T5, pl_rev);
break;
return CHELSIO_CHIP_CODE(CHELSIO_T5, pl_rev);
case CHELSIO_T6:
chip |= CHELSIO_CHIP_CODE(CHELSIO_T6, pl_rev);
break;
return CHELSIO_CHIP_CODE(CHELSIO_T6, pl_rev);
default:
dev_err(&pdev->dev, "Device %d is not supported\n",
device_id);
return -EINVAL;
}
return chip;
return -EINVAL;
}

static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
Expand Down Expand Up @@ -4724,8 +4719,6 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
err = -ENOMEM;
goto out_free_adapter;
}
t4_write_reg(adapter, SGE_STAT_CFG_A,
STATSOURCE_T5_V(7) | STATMODE_V(0));
}

setup_memwin(adapter);
Expand All @@ -4737,6 +4730,11 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err)
goto out_unmap_bar;

/* configure SGE_STAT_CFG_A to read WC stats */
if (!is_t4(adapter->params.chip))
t4_write_reg(adapter, SGE_STAT_CFG_A,
STATSOURCE_T5_V(7) | STATMODE_V(0));

for_each_port(adapter, i) {
struct net_device *netdev;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/chelsio/cxgb4/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ static inline unsigned int calc_tx_flits(const struct sk_buff *skb)
* message or, if we're doing a Large Send Offload, an LSO CPL message
* with an embedded TX Packet Write CPL message.
*/
flits = sgl_len(skb_shinfo(skb)->nr_frags + 1) + 4;
flits = sgl_len(skb_shinfo(skb)->nr_frags + 1);
if (skb_shinfo(skb)->gso_size)
flits += (sizeof(struct fw_eth_tx_pkt_wr) +
sizeof(struct cpl_tx_pkt_lso_core) +
Expand Down
33 changes: 31 additions & 2 deletions drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,6 @@ enum fw_ldst_func_mod_index {

struct fw_ldst_cmd {
__be32 op_to_addrspace;
#define FW_LDST_CMD_ADDRSPACE_S 0
#define FW_LDST_CMD_ADDRSPACE_V(x) ((x) << FW_LDST_CMD_ADDRSPACE_S)
__be32 cycles_to_len16;
union fw_ldst {
struct fw_ldst_addrval {
Expand All @@ -788,6 +786,13 @@ struct fw_ldst_cmd {
__be16 vctl;
__be16 rval;
} mdio;
struct fw_ldst_cim_rq {
u8 req_first64[8];
u8 req_second64[8];
u8 resp_first64[8];
u8 resp_second64[8];
__be32 r3[2];
} cim_rq;
union fw_ldst_mps {
struct fw_ldst_mps_rplc {
__be16 fid_idx;
Expand Down Expand Up @@ -828,9 +833,33 @@ struct fw_ldst_cmd {
__be16 nset_pkd;
__be32 data[12];
} pcie;
struct fw_ldst_i2c_deprecated {
u8 pid_pkd;
u8 base;
u8 boffset;
u8 data;
__be32 r9;
} i2c_deprecated;
struct fw_ldst_i2c {
u8 pid;
u8 did;
u8 boffset;
u8 blen;
__be32 r9;
__u8 data[48];
} i2c;
struct fw_ldst_le {
__be32 index;
__be32 r9;
u8 val[33];
u8 r11[7];
} le;
} u;
};

#define FW_LDST_CMD_ADDRSPACE_S 0
#define FW_LDST_CMD_ADDRSPACE_V(x) ((x) << FW_LDST_CMD_ADDRSPACE_S)

#define FW_LDST_CMD_MSG_S 31
#define FW_LDST_CMD_MSG_V(x) ((x) << FW_LDST_CMD_MSG_S)

Expand Down
12 changes: 6 additions & 6 deletions drivers/net/ethernet/chelsio/cxgb4/t4fw_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,26 @@
#define __T4FW_VERSION_H__

#define T4FW_VERSION_MAJOR 0x01
#define T4FW_VERSION_MINOR 0x0D
#define T4FW_VERSION_MICRO 0x20
#define T4FW_VERSION_MINOR 0x0E
#define T4FW_VERSION_MICRO 0x04
#define T4FW_VERSION_BUILD 0x00

#define T4FW_MIN_VERSION_MAJOR 0x01
#define T4FW_MIN_VERSION_MINOR 0x04
#define T4FW_MIN_VERSION_MICRO 0x00

#define T5FW_VERSION_MAJOR 0x01
#define T5FW_VERSION_MINOR 0x0D
#define T5FW_VERSION_MICRO 0x20
#define T5FW_VERSION_MINOR 0x0E
#define T5FW_VERSION_MICRO 0x04
#define T5FW_VERSION_BUILD 0x00

#define T5FW_MIN_VERSION_MAJOR 0x00
#define T5FW_MIN_VERSION_MINOR 0x00
#define T5FW_MIN_VERSION_MICRO 0x00

#define T6FW_VERSION_MAJOR 0x01
#define T6FW_VERSION_MINOR 0x0D
#define T6FW_VERSION_MICRO 0x2D
#define T6FW_VERSION_MINOR 0x0E
#define T6FW_VERSION_MICRO 0x04
#define T6FW_VERSION_BUILD 0x00

#define T6FW_MIN_VERSION_MAJOR 0x00
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/davicom/dm9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ static irqreturn_t dm9000_interrupt(int irq, void *dev_id)
if (int_status & ISR_PRS)
dm9000_rx(dev);

/* Trnasmit Interrupt check */
/* Transmit Interrupt check */
if (int_status & ISR_PTS)
dm9000_tx_done(dev, db);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/emulex/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@ static int __be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value)
memcpy(req->mcast_mac[i++].byte, ha->addr, ETH_ALEN);
}

status = be_mcc_notify(adapter);
status = be_mcc_notify_wait(adapter);
err:
spin_unlock_bh(&adapter->mcc_lock);
return status;
Expand Down
7 changes: 1 addition & 6 deletions drivers/net/ethernet/ethoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1132,19 +1132,14 @@ static int ethoc_probe(struct platform_device *pdev)
memcpy(netdev->dev_addr, pdata->hwaddr, IFHWADDRLEN);
priv->phy_id = pdata->phy_id;
} else {
priv->phy_id = -1;

#ifdef CONFIG_OF
{
const uint8_t *mac;

mac = of_get_property(pdev->dev.of_node,
"local-mac-address",
NULL);
if (mac)
memcpy(netdev->dev_addr, mac, IFHWADDRLEN);
}
#endif
priv->phy_id = -1;
}

/* Check that the given MAC address is valid. If it isn't, read the
Expand Down
12 changes: 11 additions & 1 deletion drivers/net/ethernet/freescale/fec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1816,11 +1816,13 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
struct fec_enet_private *fep = bus->priv;
struct device *dev = &fep->pdev->dev;
unsigned long time_left;
int ret = 0;
int ret;

ret = pm_runtime_get_sync(dev);
if (ret < 0)
return ret;
else
ret = 0;

fep->mii_timeout = 0;
reinit_completion(&fep->mdio_done);
Expand Down Expand Up @@ -3029,6 +3031,14 @@ fec_set_mac_address(struct net_device *ndev, void *p)
memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
}

/* Add netif status check here to avoid system hang in below case:
* ifconfig ethx down; ifconfig ethx hw ether xx:xx:xx:xx:xx:xx;
* After ethx down, fec all clocks are gated off and then register
* access causes system hang.
*/
if (!netif_running(ndev))
return 0;

writel(ndev->dev_addr[3] | (ndev->dev_addr[2] << 8) |
(ndev->dev_addr[1] << 16) | (ndev->dev_addr[0] << 24),
fep->hwp + FEC_ADDR_LOW);
Expand Down
8 changes: 2 additions & 6 deletions drivers/net/ethernet/jme.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ jme_setup_tx_resources(struct jme_adapter *jme)
atomic_set(&txring->next_to_clean, 0);
atomic_set(&txring->nr_free, jme->tx_ring_size);

txring->bufinf = kmalloc(sizeof(struct jme_buffer_info) *
txring->bufinf = kzalloc(sizeof(struct jme_buffer_info) *
jme->tx_ring_size, GFP_ATOMIC);
if (unlikely(!(txring->bufinf)))
goto err_free_txring;
Expand All @@ -592,8 +592,6 @@ jme_setup_tx_resources(struct jme_adapter *jme)
* Initialize Transmit Descriptors
*/
memset(txring->alloc, 0, TX_RING_ALLOC_SIZE(jme->tx_ring_size));
memset(txring->bufinf, 0,
sizeof(struct jme_buffer_info) * jme->tx_ring_size);

return 0;

Expand Down Expand Up @@ -845,16 +843,14 @@ jme_setup_rx_resources(struct jme_adapter *jme)
rxring->next_to_use = 0;
atomic_set(&rxring->next_to_clean, 0);

rxring->bufinf = kmalloc(sizeof(struct jme_buffer_info) *
rxring->bufinf = kzalloc(sizeof(struct jme_buffer_info) *
jme->rx_ring_size, GFP_ATOMIC);
if (unlikely(!(rxring->bufinf)))
goto err_free_rxring;

/*
* Initiallize Receive Descriptors
*/
memset(rxring->bufinf, 0,
sizeof(struct jme_buffer_info) * jme->rx_ring_size);
for (i = 0 ; i < jme->rx_ring_size ; ++i) {
if (unlikely(jme_make_new_rx_buf(jme, i))) {
jme_free_rx_resources(jme);
Expand Down
5 changes: 1 addition & 4 deletions drivers/net/ethernet/marvell/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1859,14 +1859,11 @@ static void mv643xx_eth_program_multicast_filter(struct net_device *dev)
return;
}

mc_spec = kmalloc(0x200, GFP_ATOMIC);
mc_spec = kzalloc(0x200, GFP_ATOMIC);
if (mc_spec == NULL)
goto oom;
mc_other = mc_spec + (0x100 >> 2);

memset(mc_spec, 0, 0x100);
memset(mc_other, 0, 0x100);

netdev_for_each_mc_addr(ha, dev) {
u8 *a = ha->addr;
u32 *table;
Expand Down
Loading

0 comments on commit 65c61bc

Please sign in to comment.