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
1) VETH_INFO_PEER netlink attribute needs to have it's size validated,
   from Thomas Graf.

2) 'poll' module option of bnx2x driver crashes the machine, just remove
   it.  From Michal Schmidt.

3) ks8851_mll driver reads the irq number from two places, but only
   initializes one of them, oops.  Use only one location and fix this
   problem, from Jan Weitzel.

4) Fix buffer overrun and unicast sterring bugs in mellanox mlx4 driver,
   from Eugenia Emantayev.

5) Swapped kcalloc() args in RxRPC and mlx4, from Axel Lin.

6) PHY MDIO device name regression fixes from Florian Fainelli.

7) If the wake event IRQ line is different from the netdevice one, we
   have to properly route it to the stmmac interrupt handler.  From
   Francesco Virlinzi.

8) Fix rwlock lock initialization ordering bug in mac80211, from
   Mohammed Shafi Shajakhan.

9) TCP lost_cnt can get out of sync, and in fact go negative, in certain
   circumstances.  Fix the way we specify what sequence range to operate
   on in tcp_sacktag_one() to fix this bug.  From Neal Cardwell.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (27 commits)
  net/ethernet: ks8851_mll fix irq handling
  veth: Enforce minimum size of VETH_INFO_PEER
  stmmac: update the driver version to Feb 2012 (v2)
  stmmac: move hw init in the probe (v2)
  stmmac: request_irq when use an ext wake irq line (v2)
  stmmac: do not discard frame on dribbling bit assert
  ipheth: Add iPhone 4S
  mlx4: add unicast steering entries to resource_tracker
  mlx4: fix QP tree trashing
  mlx4: fix buffer overrun
  3c59x: shorten timer period for slave devices
  netpoll: netpoll_poll_dev() should access dev->flags
  RxRPC: Fix kcalloc parameters swapped
  bnx2x: remove the 'poll' module option
  tcp: fix tcp_shifted_skb() adjustment of lost_cnt_hint for FACK
  ks8851: Fix NOHZ local_softirq_pending 08 warning
  bnx2x: fix bnx2x_storm_stats_update() on big endian
  ixp4xx-eth: fix PHY name to match MDIO bus name
  octeon: fix PHY name to match MDIO bus name
  fec: fix PHY name to match fixed MDIO bus name
  ...
  • Loading branch information
Linus Torvalds committed Feb 18, 2012
2 parents bff98bf + 6c23e41 commit 584216b
Showing 27 changed files with 212 additions and 191 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/3com/3c59x.c
Original file line number Diff line number Diff line change
@@ -1842,7 +1842,7 @@ vortex_timer(unsigned long data)
ok = 1;
}

if (!netif_carrier_ok(dev))
if (dev->flags & IFF_SLAVE || !netif_carrier_ok(dev))
next_tick = 5*HZ;

if (vp->medialock)
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bcm63xx_enet.c
Original file line number Diff line number Diff line change
@@ -797,7 +797,7 @@ static int bcm_enet_open(struct net_device *dev)
if (priv->has_phy) {
/* connect to PHY */
snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT,
priv->mac_id ? "1" : "0", priv->phy_id);
priv->mii_bus->id, priv->phy_id);

phydev = phy_connect(dev, phy_id, bcm_enet_adjust_phy_link, 0,
PHY_INTERFACE_MODE_MII);
17 changes: 1 addition & 16 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
@@ -117,10 +117,6 @@ static int dropless_fc;
module_param(dropless_fc, int, 0);
MODULE_PARM_DESC(dropless_fc, " Pause on exhausted host ring");

static int poll;
module_param(poll, int, 0);
MODULE_PARM_DESC(poll, " Use polling (for debug)");

static int mrrs = -1;
module_param(mrrs, int, 0);
MODULE_PARM_DESC(mrrs, " Force Max Read Req Size (0..3) (for debug)");
@@ -4834,20 +4830,11 @@ void bnx2x_drv_pulse(struct bnx2x *bp)

static void bnx2x_timer(unsigned long data)
{
u8 cos;
struct bnx2x *bp = (struct bnx2x *) data;

if (!netif_running(bp->dev))
return;

if (poll) {
struct bnx2x_fastpath *fp = &bp->fp[0];

for_each_cos_in_tx_queue(fp, cos)
bnx2x_tx_int(bp, &fp->txdata[cos]);
bnx2x_rx_int(fp, 1000);
}

if (!BP_NOMCP(bp)) {
int mb_idx = BP_FW_MB_IDX(bp);
u32 drv_pulse;
@@ -10063,7 +10050,6 @@ static void __devinit bnx2x_set_modes_bitmap(struct bnx2x *bp)
static int __devinit bnx2x_init_bp(struct bnx2x *bp)
{
int func;
int timer_interval;
int rc;

mutex_init(&bp->port.phy_mutex);
@@ -10139,8 +10125,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)
bp->tx_ticks = (50 / BNX2X_BTR) * BNX2X_BTR;
bp->rx_ticks = (25 / BNX2X_BTR) * BNX2X_BTR;

timer_interval = (CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ);
bp->current_interval = (poll ? poll : timer_interval);
bp->current_interval = CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ;

init_timer(&bp->timer);
bp->timer.expires = jiffies + bp->current_interval;
8 changes: 4 additions & 4 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
Original file line number Diff line number Diff line change
@@ -1081,17 +1081,17 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
estats->rx_stat_ifhcinbadoctets_lo);

ADD_64(fstats->total_bytes_received_hi,
tfunc->rcv_error_bytes.hi,
le32_to_cpu(tfunc->rcv_error_bytes.hi),
fstats->total_bytes_received_lo,
tfunc->rcv_error_bytes.lo);
le32_to_cpu(tfunc->rcv_error_bytes.lo));

memcpy(estats, &(fstats->total_bytes_received_hi),
sizeof(struct host_func_stats) - 2*sizeof(u32));

ADD_64(estats->error_bytes_received_hi,
tfunc->rcv_error_bytes.hi,
le32_to_cpu(tfunc->rcv_error_bytes.hi),
estats->error_bytes_received_lo,
tfunc->rcv_error_bytes.lo);
le32_to_cpu(tfunc->rcv_error_bytes.lo));

ADD_64(estats->etherstatsoverrsizepkts_hi,
estats->rx_stat_dot3statsframestoolong_hi,
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/fec.c
Original file line number Diff line number Diff line change
@@ -986,7 +986,7 @@ static int fec_enet_mii_probe(struct net_device *ndev)
printk(KERN_INFO
"%s: no PHY, assuming direct connection to switch\n",
ndev->name);
strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE);
strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE);
phy_id = 0;
}

5 changes: 3 additions & 2 deletions drivers/net/ethernet/mellanox/mlx4/eq.c
Original file line number Diff line number Diff line change
@@ -815,8 +815,9 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
int err;
int i;

priv->eq_table.uar_map = kcalloc(sizeof *priv->eq_table.uar_map,
mlx4_num_eq_uar(dev), GFP_KERNEL);
priv->eq_table.uar_map = kcalloc(mlx4_num_eq_uar(dev),
sizeof *priv->eq_table.uar_map,
GFP_KERNEL);
if (!priv->eq_table.uar_map) {
err = -ENOMEM;
goto err_out_free;
21 changes: 13 additions & 8 deletions drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
Original file line number Diff line number Diff line change
@@ -73,6 +73,7 @@ struct res_gid {
struct list_head list;
u8 gid[16];
enum mlx4_protocol prot;
enum mlx4_steer_type steer;
};

enum res_qp_states {
@@ -374,6 +375,7 @@ static struct res_common *alloc_qp_tr(int id)

ret->com.res_id = id;
ret->com.state = RES_QP_RESERVED;
ret->local_qpn = id;
INIT_LIST_HEAD(&ret->mcg_list);
spin_lock_init(&ret->mcg_spl);

@@ -2479,7 +2481,8 @@ static struct res_gid *find_gid(struct mlx4_dev *dev, int slave,
}

static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
u8 *gid, enum mlx4_protocol prot)
u8 *gid, enum mlx4_protocol prot,
enum mlx4_steer_type steer)
{
struct res_gid *res;
int err;
@@ -2495,6 +2498,7 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
} else {
memcpy(res->gid, gid, 16);
res->prot = prot;
res->steer = steer;
list_add_tail(&res->list, &rqp->mcg_list);
err = 0;
}
@@ -2504,14 +2508,15 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
}

static int rem_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
u8 *gid, enum mlx4_protocol prot)
u8 *gid, enum mlx4_protocol prot,
enum mlx4_steer_type steer)
{
struct res_gid *res;
int err;

spin_lock_irq(&rqp->mcg_spl);
res = find_gid(dev, slave, rqp, gid);
if (!res || res->prot != prot)
if (!res || res->prot != prot || res->steer != steer)
err = -EINVAL;
else {
list_del(&res->list);
@@ -2538,7 +2543,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
int attach = vhcr->op_modifier;
int block_loopback = vhcr->in_modifier >> 31;
u8 steer_type_mask = 2;
enum mlx4_steer_type type = gid[7] & steer_type_mask;
enum mlx4_steer_type type = (gid[7] & steer_type_mask) >> 1;

qpn = vhcr->in_modifier & 0xffffff;
err = get_res(dev, slave, qpn, RES_QP, &rqp);
@@ -2547,7 +2552,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,

qp.qpn = qpn;
if (attach) {
err = add_mcg_res(dev, slave, rqp, gid, prot);
err = add_mcg_res(dev, slave, rqp, gid, prot, type);
if (err)
goto ex_put;

@@ -2556,7 +2561,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
if (err)
goto ex_rem;
} else {
err = rem_mcg_res(dev, slave, rqp, gid, prot);
err = rem_mcg_res(dev, slave, rqp, gid, prot, type);
if (err)
goto ex_put;
err = mlx4_qp_detach_common(dev, &qp, gid, prot, type);
@@ -2567,7 +2572,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,

ex_rem:
/* ignore error return below, already in error */
err1 = rem_mcg_res(dev, slave, rqp, gid, prot);
err1 = rem_mcg_res(dev, slave, rqp, gid, prot, type);
ex_put:
put_res(dev, slave, qpn, RES_QP);

@@ -2606,7 +2611,7 @@ static void detach_qp(struct mlx4_dev *dev, int slave, struct res_qp *rqp)
list_for_each_entry_safe(rgid, tmp, &rqp->mcg_list, list) {
qp.qpn = rqp->local_qpn;
err = mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot,
MLX4_MC_STEER);
rgid->steer);
list_del(&rgid->list);
kfree(rgid);
}
2 changes: 1 addition & 1 deletion drivers/net/ethernet/micrel/ks8851.c
Original file line number Diff line number Diff line change
@@ -583,7 +583,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
ks8851_dbg_dumpkkt(ks, rxpkt);

skb->protocol = eth_type_trans(skb, ks->netdev);
netif_rx(skb);
netif_rx_ni(skb);

ks->netdev->stats.rx_packets++;
ks->netdev->stats.rx_bytes += rxlen;
14 changes: 6 additions & 8 deletions drivers/net/ethernet/micrel/ks8851_mll.c
Original file line number Diff line number Diff line change
@@ -394,7 +394,6 @@ union ks_tx_hdr {
* @msg_enable : The message flags controlling driver output (see ethtool).
* @frame_cnt : number of frames received.
* @bus_width : i/o bus width.
* @irq : irq number assigned to this device.
* @rc_rxqcr : Cached copy of KS_RXQCR.
* @rc_txcr : Cached copy of KS_TXCR.
* @rc_ier : Cached copy of KS_IER.
@@ -441,7 +440,6 @@ struct ks_net {
u32 msg_enable;
u32 frame_cnt;
int bus_width;
int irq;

u16 rc_rxqcr;
u16 rc_txcr;
@@ -907,10 +905,10 @@ static int ks_net_open(struct net_device *netdev)
netif_dbg(ks, ifup, ks->netdev, "%s - entry\n", __func__);

/* reset the HW */
err = request_irq(ks->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev);
err = request_irq(netdev->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev);

if (err) {
pr_err("Failed to request IRQ: %d: %d\n", ks->irq, err);
pr_err("Failed to request IRQ: %d: %d\n", netdev->irq, err);
return err;
}

@@ -955,7 +953,7 @@ static int ks_net_stop(struct net_device *netdev)

/* set powermode to soft power down to save power */
ks_set_powermode(ks, PMECR_PM_SOFTDOWN);
free_irq(ks->irq, netdev);
free_irq(netdev->irq, netdev);
mutex_unlock(&ks->lock);
return 0;
}
@@ -1545,10 +1543,10 @@ static int __devinit ks8851_probe(struct platform_device *pdev)
if (!ks->hw_addr_cmd)
goto err_ioremap1;

ks->irq = platform_get_irq(pdev, 0);
netdev->irq = platform_get_irq(pdev, 0);

if (ks->irq < 0) {
err = ks->irq;
if (netdev->irq < 0) {
err = netdev->irq;
goto err_get_irq;
}

4 changes: 2 additions & 2 deletions drivers/net/ethernet/octeon/octeon_mgmt.c
Original file line number Diff line number Diff line change
@@ -670,15 +670,15 @@ static void octeon_mgmt_adjust_link(struct net_device *netdev)
static int octeon_mgmt_init_phy(struct net_device *netdev)
{
struct octeon_mgmt *p = netdev_priv(netdev);
char phy_id[20];
char phy_id[MII_BUS_ID_SIZE + 3];

if (octeon_is_simulation()) {
/* No PHYs in the simulator. */
netif_carrier_on(netdev);
return 0;
}

snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "0", p->port);
snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "mdio-octeon-0", p->port);

p->phydev = phy_connect(netdev, phy_id, octeon_mgmt_adjust_link, 0,
PHY_INTERFACE_MODE_MII);
1 change: 1 addition & 0 deletions drivers/net/ethernet/stmicro/stmmac/common.h
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ struct stmmac_extra_stats {
unsigned long ipc_csum_error;
unsigned long rx_collision;
unsigned long rx_crc;
unsigned long dribbling_bit;
unsigned long rx_length;
unsigned long rx_mii;
unsigned long rx_multicast;
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/enh_desc.c
Original file line number Diff line number Diff line change
@@ -201,7 +201,7 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x,

if (unlikely(p->des01.erx.dribbling)) {
CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n");
ret = discard_frame;
x->dribbling_bit++;
}
if (unlikely(p->des01.erx.sa_filter_fail)) {
CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n");
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/norm_desc.c
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x,
ret = discard_frame;
}
if (unlikely(p->des01.rx.dribbling))
ret = discard_frame;
x->dribbling_bit++;

if (unlikely(p->des01.rx.length_error)) {
x->rx_length++;
5 changes: 3 additions & 2 deletions drivers/net/ethernet/stmicro/stmmac/stmmac.h
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
*******************************************************************************/

#define STMMAC_RESOURCE_NAME "stmmaceth"
#define DRV_MODULE_VERSION "Dec_2011"
#define DRV_MODULE_VERSION "Feb_2012"
#include <linux/stmmac.h>
#include <linux/phy.h>
#include "common.h"
@@ -97,4 +97,5 @@ int stmmac_resume(struct net_device *ndev);
int stmmac_suspend(struct net_device *ndev);
int stmmac_dvr_remove(struct net_device *ndev);
struct stmmac_priv *stmmac_dvr_probe(struct device *device,
struct plat_stmmacenet_data *plat_dat);
struct plat_stmmacenet_data *plat_dat,
void __iomem *addr);
7 changes: 6 additions & 1 deletion drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
Original file line number Diff line number Diff line change
@@ -47,23 +47,25 @@ struct stmmac_stats {
offsetof(struct stmmac_priv, xstats.m)}

static const struct stmmac_stats stmmac_gstrings_stats[] = {
/* Transmit errors */
STMMAC_STAT(tx_underflow),
STMMAC_STAT(tx_carrier),
STMMAC_STAT(tx_losscarrier),
STMMAC_STAT(vlan_tag),
STMMAC_STAT(tx_deferred),
STMMAC_STAT(tx_vlan),
STMMAC_STAT(rx_vlan),
STMMAC_STAT(tx_jabber),
STMMAC_STAT(tx_frame_flushed),
STMMAC_STAT(tx_payload_error),
STMMAC_STAT(tx_ip_header_error),
/* Receive errors */
STMMAC_STAT(rx_desc),
STMMAC_STAT(sa_filter_fail),
STMMAC_STAT(overflow_error),
STMMAC_STAT(ipc_csum_error),
STMMAC_STAT(rx_collision),
STMMAC_STAT(rx_crc),
STMMAC_STAT(dribbling_bit),
STMMAC_STAT(rx_length),
STMMAC_STAT(rx_mii),
STMMAC_STAT(rx_multicast),
@@ -73,6 +75,8 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = {
STMMAC_STAT(sa_rx_filter_fail),
STMMAC_STAT(rx_missed_cntr),
STMMAC_STAT(rx_overflow_cntr),
STMMAC_STAT(rx_vlan),
/* Tx/Rx IRQ errors */
STMMAC_STAT(tx_undeflow_irq),
STMMAC_STAT(tx_process_stopped_irq),
STMMAC_STAT(tx_jabber_irq),
@@ -82,6 +86,7 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = {
STMMAC_STAT(rx_watchdog_irq),
STMMAC_STAT(tx_early_irq),
STMMAC_STAT(fatal_bus_error_irq),
/* Extra info */
STMMAC_STAT(threshold),
STMMAC_STAT(tx_pkt_n),
STMMAC_STAT(rx_pkt_n),
Loading

0 comments on commit 584216b

Please sign in to comment.