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
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (69 commits)
  pptp: Accept packet with seq zero
  RDS: Remove some unused iWARP code
  net: fsl: fec: handle 10Mbps speed in RMII mode
  drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c: add missing iounmap
  drivers/net/ethernet/tundra/tsi108_eth.c: add missing iounmap
  ksz884x: fix mtu for VLAN
  net_sched: sfq: add optional RED on top of SFQ
  dp83640: Fix NOHZ local_softirq_pending 08 warning
  gianfar: Fix invalid TX frames returned on error queue when time stamping
  gianfar: Fix missing sock reference when processing TX time stamps
  phylib: introduce mdiobus_alloc_size()
  net: decrement memcg jump label when limit, not usage, is changed
  net: reintroduce missing rcu_assign_pointer() calls
  inet_diag: Rename inet_diag_req_compat into inet_diag_req
  inet_diag: Rename inet_diag_req into inet_diag_req_v2
  bond_alb: don't disable softirq under bond_alb_xmit
  mac80211: fix rx->key NULL pointer dereference in promiscuous mode
  nl80211: fix old station flags compatibility
  mdio-octeon: use an unique MDIO bus name.
  mdio-gpio: use an unique MDIO bus name.
  ...
  • Loading branch information
Linus Torvalds committed Jan 13, 2012
2 parents 2485a4b + 91dce7d commit 7c17d86
Show file tree
Hide file tree
Showing 98 changed files with 925 additions and 588 deletions.
2 changes: 1 addition & 1 deletion drivers/isdn/i4l/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if ISDN_I4L

config ISDN_PPP
bool "Support synchronous PPP"
depends on INET
depends on INET && NETDEVICES
select SLHC
help
Over digital connections such as ISDN, there is no need to
Expand Down
112 changes: 76 additions & 36 deletions drivers/net/bonding/bond_alb.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,26 @@ static inline u8 _simple_hash(const u8 *hash_start, int hash_size)

/*********************** tlb specific functions ***************************/

static inline void _lock_tx_hashtbl(struct bonding *bond)
static inline void _lock_tx_hashtbl_bh(struct bonding *bond)
{
spin_lock_bh(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
}

static inline void _unlock_tx_hashtbl(struct bonding *bond)
static inline void _unlock_tx_hashtbl_bh(struct bonding *bond)
{
spin_unlock_bh(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
}

static inline void _lock_tx_hashtbl(struct bonding *bond)
{
spin_lock(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
}

static inline void _unlock_tx_hashtbl(struct bonding *bond)
{
spin_unlock(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
}

/* Caller must hold tx_hashtbl lock */
static inline void tlb_init_table_entry(struct tlb_client_info *entry, int save_load)
{
Expand All @@ -129,14 +139,13 @@ static inline void tlb_init_slave(struct slave *slave)
SLAVE_TLB_INFO(slave).head = TLB_NULL_INDEX;
}

/* Caller must hold bond lock for read */
static void tlb_clear_slave(struct bonding *bond, struct slave *slave, int save_load)
/* Caller must hold bond lock for read, BH disabled */
static void __tlb_clear_slave(struct bonding *bond, struct slave *slave,
int save_load)
{
struct tlb_client_info *tx_hash_table;
u32 index;

_lock_tx_hashtbl(bond);

/* clear slave from tx_hashtbl */
tx_hash_table = BOND_ALB_INFO(bond).tx_hashtbl;

Expand All @@ -151,8 +160,15 @@ static void tlb_clear_slave(struct bonding *bond, struct slave *slave, int save_
}

tlb_init_slave(slave);
}

_unlock_tx_hashtbl(bond);
/* Caller must hold bond lock for read */
static void tlb_clear_slave(struct bonding *bond, struct slave *slave,
int save_load)
{
_lock_tx_hashtbl_bh(bond);
__tlb_clear_slave(bond, slave, save_load);
_unlock_tx_hashtbl_bh(bond);
}

/* Must be called before starting the monitor timer */
Expand All @@ -169,15 +185,15 @@ static int tlb_initialize(struct bonding *bond)
bond->dev->name);
return -1;
}
_lock_tx_hashtbl(bond);
_lock_tx_hashtbl_bh(bond);

bond_info->tx_hashtbl = new_hashtbl;

for (i = 0; i < TLB_HASH_TABLE_SIZE; i++) {
tlb_init_table_entry(&bond_info->tx_hashtbl[i], 0);
}

_unlock_tx_hashtbl(bond);
_unlock_tx_hashtbl_bh(bond);

return 0;
}
Expand All @@ -187,12 +203,12 @@ static void tlb_deinitialize(struct bonding *bond)
{
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));

_lock_tx_hashtbl(bond);
_lock_tx_hashtbl_bh(bond);

kfree(bond_info->tx_hashtbl);
bond_info->tx_hashtbl = NULL;

_unlock_tx_hashtbl(bond);
_unlock_tx_hashtbl_bh(bond);
}

static long long compute_gap(struct slave *slave)
Expand Down Expand Up @@ -226,15 +242,13 @@ static struct slave *tlb_get_least_loaded_slave(struct bonding *bond)
return least_loaded;
}

/* Caller must hold bond lock for read */
static struct slave *tlb_choose_channel(struct bonding *bond, u32 hash_index, u32 skb_len)
static struct slave *__tlb_choose_channel(struct bonding *bond, u32 hash_index,
u32 skb_len)
{
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
struct tlb_client_info *hash_table;
struct slave *assigned_slave;

_lock_tx_hashtbl(bond);

hash_table = bond_info->tx_hashtbl;
assigned_slave = hash_table[hash_index].tx_slave;
if (!assigned_slave) {
Expand Down Expand Up @@ -263,22 +277,46 @@ static struct slave *tlb_choose_channel(struct bonding *bond, u32 hash_index, u3
hash_table[hash_index].tx_bytes += skb_len;
}

_unlock_tx_hashtbl(bond);

return assigned_slave;
}

/* Caller must hold bond lock for read */
static struct slave *tlb_choose_channel(struct bonding *bond, u32 hash_index,
u32 skb_len)
{
struct slave *tx_slave;
/*
* We don't need to disable softirq here, becase
* tlb_choose_channel() is only called by bond_alb_xmit()
* which already has softirq disabled.
*/
_lock_tx_hashtbl(bond);
tx_slave = __tlb_choose_channel(bond, hash_index, skb_len);
_unlock_tx_hashtbl(bond);
return tx_slave;
}

/*********************** rlb specific functions ***************************/
static inline void _lock_rx_hashtbl(struct bonding *bond)
static inline void _lock_rx_hashtbl_bh(struct bonding *bond)
{
spin_lock_bh(&(BOND_ALB_INFO(bond).rx_hashtbl_lock));
}

static inline void _unlock_rx_hashtbl(struct bonding *bond)
static inline void _unlock_rx_hashtbl_bh(struct bonding *bond)
{
spin_unlock_bh(&(BOND_ALB_INFO(bond).rx_hashtbl_lock));
}

static inline void _lock_rx_hashtbl(struct bonding *bond)
{
spin_lock(&(BOND_ALB_INFO(bond).rx_hashtbl_lock));
}

static inline void _unlock_rx_hashtbl(struct bonding *bond)
{
spin_unlock(&(BOND_ALB_INFO(bond).rx_hashtbl_lock));
}

/* when an ARP REPLY is received from a client update its info
* in the rx_hashtbl
*/
Expand All @@ -288,7 +326,7 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
struct rlb_client_info *client_info;
u32 hash_index;

_lock_rx_hashtbl(bond);
_lock_rx_hashtbl_bh(bond);

hash_index = _simple_hash((u8*)&(arp->ip_src), sizeof(arp->ip_src));
client_info = &(bond_info->rx_hashtbl[hash_index]);
Expand All @@ -303,7 +341,7 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
bond_info->rx_ntt = 1;
}

_unlock_rx_hashtbl(bond);
_unlock_rx_hashtbl_bh(bond);
}

static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond,
Expand Down Expand Up @@ -401,7 +439,7 @@ static void rlb_clear_slave(struct bonding *bond, struct slave *slave)
u32 index, next_index;

/* clear slave from rx_hashtbl */
_lock_rx_hashtbl(bond);
_lock_rx_hashtbl_bh(bond);

rx_hash_table = bond_info->rx_hashtbl;
index = bond_info->rx_hashtbl_head;
Expand Down Expand Up @@ -432,7 +470,7 @@ static void rlb_clear_slave(struct bonding *bond, struct slave *slave)
}
}

_unlock_rx_hashtbl(bond);
_unlock_rx_hashtbl_bh(bond);

write_lock_bh(&bond->curr_slave_lock);

Expand Down Expand Up @@ -489,7 +527,7 @@ static void rlb_update_rx_clients(struct bonding *bond)
struct rlb_client_info *client_info;
u32 hash_index;

_lock_rx_hashtbl(bond);
_lock_rx_hashtbl_bh(bond);

hash_index = bond_info->rx_hashtbl_head;
for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {
Expand All @@ -507,7 +545,7 @@ static void rlb_update_rx_clients(struct bonding *bond)
*/
bond_info->rlb_update_delay_counter = RLB_UPDATE_DELAY;

_unlock_rx_hashtbl(bond);
_unlock_rx_hashtbl_bh(bond);
}

/* The slave was assigned a new mac address - update the clients */
Expand All @@ -518,7 +556,7 @@ static void rlb_req_update_slave_clients(struct bonding *bond, struct slave *sla
int ntt = 0;
u32 hash_index;

_lock_rx_hashtbl(bond);
_lock_rx_hashtbl_bh(bond);

hash_index = bond_info->rx_hashtbl_head;
for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {
Expand All @@ -538,7 +576,7 @@ static void rlb_req_update_slave_clients(struct bonding *bond, struct slave *sla
bond_info->rlb_update_retry_counter = RLB_UPDATE_RETRY;
}

_unlock_rx_hashtbl(bond);
_unlock_rx_hashtbl_bh(bond);
}

/* mark all clients using src_ip to be updated */
Expand Down Expand Up @@ -709,7 +747,7 @@ static void rlb_rebalance(struct bonding *bond)
int ntt;
u32 hash_index;

_lock_rx_hashtbl(bond);
_lock_rx_hashtbl_bh(bond);

ntt = 0;
hash_index = bond_info->rx_hashtbl_head;
Expand All @@ -727,7 +765,7 @@ static void rlb_rebalance(struct bonding *bond)
if (ntt) {
bond_info->rx_ntt = 1;
}
_unlock_rx_hashtbl(bond);
_unlock_rx_hashtbl_bh(bond);
}

/* Caller must hold rx_hashtbl lock */
Expand All @@ -751,7 +789,7 @@ static int rlb_initialize(struct bonding *bond)
bond->dev->name);
return -1;
}
_lock_rx_hashtbl(bond);
_lock_rx_hashtbl_bh(bond);

bond_info->rx_hashtbl = new_hashtbl;

Expand All @@ -761,7 +799,7 @@ static int rlb_initialize(struct bonding *bond)
rlb_init_table_entry(bond_info->rx_hashtbl + i);
}

_unlock_rx_hashtbl(bond);
_unlock_rx_hashtbl_bh(bond);

/* register to receive ARPs */
bond->recv_probe = rlb_arp_recv;
Expand All @@ -773,21 +811,21 @@ static void rlb_deinitialize(struct bonding *bond)
{
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));

_lock_rx_hashtbl(bond);
_lock_rx_hashtbl_bh(bond);

kfree(bond_info->rx_hashtbl);
bond_info->rx_hashtbl = NULL;
bond_info->rx_hashtbl_head = RLB_NULL_INDEX;

_unlock_rx_hashtbl(bond);
_unlock_rx_hashtbl_bh(bond);
}

static void rlb_clear_vlan(struct bonding *bond, unsigned short vlan_id)
{
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
u32 curr_index;

_lock_rx_hashtbl(bond);
_lock_rx_hashtbl_bh(bond);

curr_index = bond_info->rx_hashtbl_head;
while (curr_index != RLB_NULL_INDEX) {
Expand All @@ -812,7 +850,7 @@ static void rlb_clear_vlan(struct bonding *bond, unsigned short vlan_id)
curr_index = next_index;
}

_unlock_rx_hashtbl(bond);
_unlock_rx_hashtbl_bh(bond);
}

/*********************** tlb/rlb shared functions *********************/
Expand Down Expand Up @@ -1320,7 +1358,9 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
res = bond_dev_queue_xmit(bond, skb, tx_slave->dev);
} else {
if (tx_slave) {
tlb_clear_slave(bond, tx_slave, 0);
_lock_tx_hashtbl(bond);
__tlb_clear_slave(bond, tx_slave, 0);
_unlock_tx_hashtbl(bond);
}
}

Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/8390/ax88796.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ static int ax_mii_init(struct net_device *dev)

ax->mii_bus->name = "ax88796_mii_bus";
ax->mii_bus->parent = dev->dev.parent;
snprintf(ax->mii_bus->id, MII_BUS_ID_SIZE, "%x", pdev->id);
snprintf(ax->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
pdev->name, pdev->id);

ax->mii_bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
if (!ax->mii_bus->irq) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/adi/bfin_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,8 @@ static int __devinit bfin_mii_bus_probe(struct platform_device *pdev)
miibus->name = "bfin_mii_bus";
miibus->phy_mask = mii_bus_pd->phy_mask;

snprintf(miibus->id, MII_BUS_ID_SIZE, "0");
snprintf(miibus->id, MII_BUS_ID_SIZE, "%s-%x",
pdev->name, pdev->id);
miibus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
if (!miibus->irq)
goto out_err_irq_alloc;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/amd/au1000_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,8 @@ static int __devinit au1000_probe(struct platform_device *pdev)
aup->mii_bus->write = au1000_mdiobus_write;
aup->mii_bus->reset = au1000_mdiobus_reset;
aup->mii_bus->name = "au1000_eth_mii";
snprintf(aup->mii_bus->id, MII_BUS_ID_SIZE, "%x", aup->mac_id);
snprintf(aup->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
pdev->name, aup->mac_id);
aup->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
if (aup->mii_bus->irq == NULL)
goto err_out;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bcm63xx_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1727,7 +1727,7 @@ static int __devinit bcm_enet_probe(struct platform_device *pdev)
bus->priv = priv;
bus->read = bcm_enet_mdio_read_phylib;
bus->write = bcm_enet_mdio_write_phylib;
sprintf(bus->id, "%d", priv->mac_id);
sprintf(bus->id, "%s-%d", pdev->name, priv->mac_id);

/* only probe bus where we think the PHY is, because
* the mdio read operation return 0 instead of 0xffff
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/broadcom/sb1250-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2259,7 +2259,8 @@ static int sbmac_init(struct platform_device *pldev, long long base)
}

sc->mii_bus->name = sbmac_mdio_string;
snprintf(sc->mii_bus->id, MII_BUS_ID_SIZE, "%x", idx);
snprintf(sc->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
pldev->name, idx);
sc->mii_bus->priv = sc;
sc->mii_bus->read = sbmac_mii_read;
sc->mii_bus->write = sbmac_mii_write;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/cadence/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ static int macb_mii_init(struct macb *bp)
bp->mii_bus->read = &macb_mdio_read;
bp->mii_bus->write = &macb_mdio_write;
bp->mii_bus->reset = &macb_mdio_reset;
snprintf(bp->mii_bus->id, MII_BUS_ID_SIZE, "%x", bp->pdev->id);
snprintf(bp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
bp->pdev->name, bp->pdev->id);
bp->mii_bus->priv = bp;
bp->mii_bus->parent = &bp->dev->dev;
pdata = bp->pdev->dev.platform_data;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/dnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ static int dnet_mii_init(struct dnet *bp)
bp->mii_bus->write = &dnet_mdio_write;
bp->mii_bus->reset = &dnet_mdio_reset;

snprintf(bp->mii_bus->id, MII_BUS_ID_SIZE, "%x", 0);
snprintf(bp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
bp->pdev->name, bp->pdev->id);

bp->mii_bus->priv = bp;

Expand Down
Loading

0 comments on commit 7c17d86

Please sign in to comment.