Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (30 commits)
  e1000: fix virtualization bug
  bonding: fix alb mode locking regression
  Bluetooth: Fix issue with sysfs handling for connections
  usbnet: CDC EEM support (v5)
  tcp: Fix tcp_prequeue() to get correct rto_min value
  ehea: fix invalid pointer access
  ne2k-pci: Do not register device until initialized.
  Subject: [PATCH] br2684: restore net_dev initialization
  net: Only store high 16 bits of kernel generated filter priorities
  virtio_net: Fix function name typo
  virtio_net: Cleanup command queue scatterlist usage
  bonding: correct the cleanup in bond_create()
  virtio: add missing include to virtio_net.h
  smsc95xx: add support for LAN9512 and LAN9514
  smsc95xx: configure LED outputs
  netconsole: take care of NETDEV_UNREGISTER event
  xt_socket: checks for the state of nf_conntrack
  bonding: bond_slave_info_query() fix
  cxgb3: fixing gcc 4.4 compiler warning: suggest parentheses around operand of ‘!’
  netfilter: use likely() in xt_info_rdlock_bh()
  ...
  • Loading branch information
Linus Torvalds committed May 5, 2009
2 parents 32bc66d + bc83871 commit 80445de
Show file tree
Hide file tree
Showing 33 changed files with 598 additions and 157 deletions.
12 changes: 3 additions & 9 deletions drivers/net/bonding/bond_alb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1706,10 +1706,8 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave
* Called with RTNL
*/
int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
__releases(&bond->curr_slave_lock)
__releases(&bond->lock)
__acquires(&bond->lock)
__acquires(&bond->curr_slave_lock)
__releases(&bond->lock)
{
struct bonding *bond = netdev_priv(bond_dev);
struct sockaddr *sa = addr;
Expand Down Expand Up @@ -1745,26 +1743,22 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
}
}

write_unlock_bh(&bond->curr_slave_lock);
read_unlock(&bond->lock);

if (swap_slave) {
alb_swap_mac_addr(bond, swap_slave, bond->curr_active_slave);
alb_fasten_mac_swap(bond, swap_slave, bond->curr_active_slave);
} else {
alb_set_slave_mac_addr(bond->curr_active_slave, bond_dev->dev_addr,
bond->alb_info.rlb_enabled);

read_lock(&bond->lock);
alb_send_learning_packets(bond->curr_active_slave, bond_dev->dev_addr);
if (bond->alb_info.rlb_enabled) {
/* inform clients mac address has changed */
rlb_req_update_slave_clients(bond, bond->curr_active_slave);
}
read_unlock(&bond->lock);
}

read_lock(&bond->lock);
write_lock_bh(&bond->curr_slave_lock);

return 0;
}

Expand Down
36 changes: 13 additions & 23 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2213,33 +2213,24 @@ static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *in
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave;
int i, found = 0;

if (info->slave_id < 0) {
return -ENODEV;
}
int i, res = -ENODEV;

read_lock(&bond->lock);

bond_for_each_slave(bond, slave, i) {
if (i == (int)info->slave_id) {
found = 1;
res = 0;
strcpy(info->slave_name, slave->dev->name);
info->link = slave->link;
info->state = slave->state;
info->link_failure_count = slave->link_failure_count;
break;
}
}

read_unlock(&bond->lock);

if (found) {
strcpy(info->slave_name, slave->dev->name);
info->link = slave->link;
info->state = slave->state;
info->link_failure_count = slave->link_failure_count;
} else {
return -ENODEV;
}

return 0;
return res;
}

/*-------------------------------- Monitoring -------------------------------*/
Expand Down Expand Up @@ -5167,16 +5158,15 @@ int bond_create(char *name, struct bond_params *params)
up_write(&bonding_rwsem);
rtnl_unlock(); /* allows sysfs registration of net device */
res = bond_create_sysfs_entry(netdev_priv(bond_dev));
if (res < 0) {
rtnl_lock();
down_write(&bonding_rwsem);
bond_deinit(bond_dev);
unregister_netdevice(bond_dev);
goto out_rtnl;
}
if (res < 0)
goto out_unreg;

return 0;

out_unreg:
rtnl_lock();
down_write(&bonding_rwsem);
unregister_netdevice(bond_dev);
out_bond:
bond_deinit(bond_dev);
out_netdev:
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/cxgb3/t3_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -3779,7 +3779,7 @@ int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai,

adapter->params.info = ai;
adapter->params.nports = ai->nports0 + ai->nports1;
adapter->params.chan_map = !!ai->nports0 | (!!ai->nports1 << 1);
adapter->params.chan_map = (!!ai->nports0) | (!!ai->nports1 << 1);
adapter->params.rev = t3_read_reg(adapter, A_PL_REV);
/*
* We used to only run the "adapter check task" once a second if
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3738,7 +3738,7 @@ static irqreturn_t e1000_intr(int irq, void *data)
struct e1000_hw *hw = &adapter->hw;
u32 rctl, icr = er32(ICR);

if (unlikely((!icr) || test_bit(__E1000_RESETTING, &adapter->flags)))
if (unlikely((!icr) || test_bit(__E1000_DOWN, &adapter->flags)))
return IRQ_NONE; /* Not our interrupt */

/* IMS will not auto-mask if INT_ASSERTED is not set, and if it is
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ehea/ehea.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <asm/io.h>

#define DRV_NAME "ehea"
#define DRV_VERSION "EHEA_0100"
#define DRV_VERSION "EHEA_0101"

/* eHEA capability flags */
#define DLPAR_PORT_ADD_REM 1
Expand Down
31 changes: 18 additions & 13 deletions drivers/net/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,14 +545,17 @@ static inline struct sk_buff *get_skb_by_index(struct sk_buff **skb_array,
x &= (arr_len - 1);

pref = skb_array[x];
prefetchw(pref);
prefetchw(pref + EHEA_CACHE_LINE);

pref = (skb_array[x]->data);
prefetch(pref);
prefetch(pref + EHEA_CACHE_LINE);
prefetch(pref + EHEA_CACHE_LINE * 2);
prefetch(pref + EHEA_CACHE_LINE * 3);
if (pref) {
prefetchw(pref);
prefetchw(pref + EHEA_CACHE_LINE);

pref = (skb_array[x]->data);
prefetch(pref);
prefetch(pref + EHEA_CACHE_LINE);
prefetch(pref + EHEA_CACHE_LINE * 2);
prefetch(pref + EHEA_CACHE_LINE * 3);
}

skb = skb_array[skb_index];
skb_array[skb_index] = NULL;
return skb;
Expand All @@ -569,12 +572,14 @@ static inline struct sk_buff *get_skb_by_index_ll(struct sk_buff **skb_array,
x &= (arr_len - 1);

pref = skb_array[x];
prefetchw(pref);
prefetchw(pref + EHEA_CACHE_LINE);
if (pref) {
prefetchw(pref);
prefetchw(pref + EHEA_CACHE_LINE);

pref = (skb_array[x]->data);
prefetchw(pref);
prefetchw(pref + EHEA_CACHE_LINE);
pref = (skb_array[x]->data);
prefetchw(pref);
prefetchw(pref + EHEA_CACHE_LINE);
}

skb = skb_array[wqe_index];
skb_array[wqe_index] = NULL;
Expand Down
24 changes: 13 additions & 11 deletions drivers/net/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,12 @@ struct mv643xx_eth_private {
struct work_struct tx_timeout_task;

struct napi_struct napi;
u8 oom;
u8 work_link;
u8 work_tx;
u8 work_tx_end;
u8 work_rx;
u8 work_rx_refill;
u8 work_rx_oom;

int skb_size;
struct sk_buff_head rx_recycle;
Expand Down Expand Up @@ -661,7 +661,7 @@ static int rxq_refill(struct rx_queue *rxq, int budget)
dma_get_cache_alignment() - 1);

if (skb == NULL) {
mp->work_rx_oom |= 1 << rxq->index;
mp->oom = 1;
goto oom;
}

Expand Down Expand Up @@ -1255,7 +1255,6 @@ static void mib_counters_update(struct mv643xx_eth_private *mp)

spin_lock_bh(&mp->mib_counters_lock);
p->good_octets_received += mib_read(mp, 0x00);
p->good_octets_received += (u64)mib_read(mp, 0x04) << 32;
p->bad_octets_received += mib_read(mp, 0x08);
p->internal_mac_transmit_err += mib_read(mp, 0x0c);
p->good_frames_received += mib_read(mp, 0x10);
Expand All @@ -1269,7 +1268,6 @@ static void mib_counters_update(struct mv643xx_eth_private *mp)
p->frames_512_to_1023_octets += mib_read(mp, 0x30);
p->frames_1024_to_max_octets += mib_read(mp, 0x34);
p->good_octets_sent += mib_read(mp, 0x38);
p->good_octets_sent += (u64)mib_read(mp, 0x3c) << 32;
p->good_frames_sent += mib_read(mp, 0x40);
p->excessive_collision += mib_read(mp, 0x44);
p->multicast_frames_sent += mib_read(mp, 0x48);
Expand Down Expand Up @@ -2167,8 +2165,10 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget)

mp = container_of(napi, struct mv643xx_eth_private, napi);

mp->work_rx_refill |= mp->work_rx_oom;
mp->work_rx_oom = 0;
if (unlikely(mp->oom)) {
mp->oom = 0;
del_timer(&mp->rx_oom);
}

work_done = 0;
while (work_done < budget) {
Expand All @@ -2182,8 +2182,10 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget)
continue;
}

queue_mask = mp->work_tx | mp->work_tx_end |
mp->work_rx | mp->work_rx_refill;
queue_mask = mp->work_tx | mp->work_tx_end | mp->work_rx;
if (likely(!mp->oom))
queue_mask |= mp->work_rx_refill;

if (!queue_mask) {
if (mv643xx_eth_collect_events(mp))
continue;
Expand All @@ -2204,15 +2206,15 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget)
txq_maybe_wake(mp->txq + queue);
} else if (mp->work_rx & queue_mask) {
work_done += rxq_process(mp->rxq + queue, work_tbd);
} else if (mp->work_rx_refill & queue_mask) {
} else if (!mp->oom && (mp->work_rx_refill & queue_mask)) {
work_done += rxq_refill(mp->rxq + queue, work_tbd);
} else {
BUG();
}
}

if (work_done < budget) {
if (mp->work_rx_oom)
if (mp->oom)
mod_timer(&mp->rx_oom, jiffies + (HZ / 10));
napi_complete(napi);
wrlp(mp, INT_MASK, INT_TX_END | INT_RX | INT_EXT);
Expand Down Expand Up @@ -2372,7 +2374,7 @@ static int mv643xx_eth_open(struct net_device *dev)
rxq_refill(mp->rxq + i, INT_MAX);
}

if (mp->work_rx_oom) {
if (mp->oom) {
mp->rx_oom.expires = jiffies + (HZ / 10);
add_timer(&mp->rx_oom);
}
Expand Down
7 changes: 3 additions & 4 deletions drivers/net/ne2k-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,18 +374,17 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
dev->ethtool_ops = &ne2k_pci_ethtool_ops;
NS8390_init(dev, 0);

memcpy(dev->dev_addr, SA_prom, 6);
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);

i = register_netdev(dev);
if (i)
goto err_out_free_netdev;

for(i = 0; i < 6; i++)
dev->dev_addr[i] = SA_prom[i];
printk("%s: %s found at %#lx, IRQ %d, %pM.\n",
dev->name, pci_clone_list[chip_idx].name, ioaddr, dev->irq,
dev->dev_addr);

memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);

return 0;

err_out_free_netdev:
Expand Down
11 changes: 10 additions & 1 deletion drivers/net/netconsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ static int netconsole_netdev_event(struct notifier_block *this,
struct netconsole_target *nt;
struct net_device *dev = ptr;

if (!(event == NETDEV_CHANGENAME))
if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER))
goto done;

spin_lock_irqsave(&target_list_lock, flags);
Expand All @@ -675,6 +675,15 @@ static int netconsole_netdev_event(struct notifier_block *this,
case NETDEV_CHANGENAME:
strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ);
break;
case NETDEV_UNREGISTER:
if (!nt->enabled)
break;
netpoll_cleanup(&nt->np);
nt->enabled = 0;
printk(KERN_INFO "netconsole: network logging stopped"
", interface %s unregistered\n",
dev->name);
break;
}
}
netconsole_target_put(nt);
Expand Down
14 changes: 14 additions & 0 deletions drivers/net/usb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,20 @@ config USB_NET_CDCETHER
IEEE 802 "local assignment" bit is set in the address, a "usbX"
name is used instead.

config USB_NET_CDC_EEM
tristate "CDC EEM support"
depends on USB_USBNET && EXPERIMENTAL
help
This option supports devices conforming to the Communication Device
Class (CDC) Ethernet Emulation Model, a specification that's easy to
implement in device firmware. The CDC EEM specifications are available
from <http://www.usb.org/>.

This driver creates an interface named "ethX", where X depends on
what other networking devices you have in use. However, if the
IEEE 802 "local assignment" bit is set in the address, a "usbX"
name is used instead.

config USB_NET_DM9601
tristate "Davicom DM9601 based USB 1.1 10/100 ethernet devices"
depends on USB_USBNET
Expand Down
1 change: 1 addition & 0 deletions drivers/net/usb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ obj-$(CONFIG_USB_RTL8150) += rtl8150.o
obj-$(CONFIG_USB_HSO) += hso.o
obj-$(CONFIG_USB_NET_AX8817X) += asix.o
obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.o
obj-$(CONFIG_USB_NET_CDC_EEM) += cdc_eem.o
obj-$(CONFIG_USB_NET_DM9601) += dm9601.o
obj-$(CONFIG_USB_NET_SMSC95XX) += smsc95xx.o
obj-$(CONFIG_USB_NET_GL620A) += gl620a.o
Expand Down
Loading

0 comments on commit 80445de

Please sign in to comment.