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: (32 commits)
  ucc_geth: Fix oops when using fixed-link support
  dm9000: locking bugfix
  net: update dnet.c for bus_id removal
  dnet: DNET should depend on HAS_IOMEM
  dca: add missing copyright/license headers
  nl80211: Check that function pointer != NULL before using it
  sungem: missing net_device_ops
  be2net: fix to restore vlan ids into BE2 during a IF DOWN->UP cycle
  be2net: replenish when posting to rx-queue is starved in out of mem conditions
  bas_gigaset: correctly allocate USB interrupt transfer buffer
  smsc911x: reset last known duplex and carrier on open
  sh_eth: Fix mistake of the address of SH7763
  sh_eth: Change handling of IRQ
  netns: oops in ip[6]_frag_reasm incrementing stats
  net: kfree(napi->skb) => kfree_skb
  net: fix sctp breakage
  ipv6: fix display of local and remote sit endpoints
  net: Document /proc/sys/net/core/netdev_budget
  tulip: fix crash on iface up with shirq debug
  virtio_net: Make virtio_net support carrier detection
  ...
  • Loading branch information
torvalds committed Mar 23, 2009
2 parents 12a37b5 + 61fa9dc commit d56ffd3
Show file tree
Hide file tree
Showing 39 changed files with 314 additions and 121 deletions.
7 changes: 7 additions & 0 deletions Documentation/filesystems/proc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,13 @@ of problems on the network like duplicate address or bad checksums. Normally,
this should be enabled, but if the problem persists the messages can be
disabled.

netdev_budget
-------------

Maximum number of packets taken from all interfaces in one polling cycle (NAPI
poll). In one polling cycle interfaces which are registered to polling are
probed in a round-robin manner. The limit of packets in one such probe can be
set per-device via sysfs class/net/<device>/weight .

netdev_max_backlog
------------------
Expand Down
21 changes: 21 additions & 0 deletions drivers/dca/dca-sysfs.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/*
* Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The full GNU General Public License is included in this distribution in the
* file called COPYING.
*/

#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/device.h>
Expand Down
16 changes: 13 additions & 3 deletions drivers/isdn/gigaset/bas-gigaset.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ MODULE_PARM_DESC(cidmode, "Call-ID mode");
/* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */
#define IF_WRITEBUF 264

/* interrupt pipe message size according to ibid. ch. 2.2 */
#define IP_MSGSIZE 3

/* Values for the Gigaset 307x */
#define USB_GIGA_VENDOR_ID 0x0681
#define USB_3070_PRODUCT_ID 0x0001
Expand Down Expand Up @@ -110,7 +113,7 @@ struct bas_cardstate {
unsigned char *rcvbuf; /* AT reply receive buffer */

struct urb *urb_int_in; /* URB for interrupt pipe */
unsigned char int_in_buf[3];
unsigned char *int_in_buf;

spinlock_t lock; /* locks all following */
int basstate; /* bitmap (BS_*) */
Expand Down Expand Up @@ -657,7 +660,7 @@ static void read_int_callback(struct urb *urb)
}

/* drop incomplete packets even if the missing bytes wouldn't matter */
if (unlikely(urb->actual_length < 3)) {
if (unlikely(urb->actual_length < IP_MSGSIZE)) {
dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n",
urb->actual_length);
goto resubmit;
Expand Down Expand Up @@ -2127,6 +2130,7 @@ static void gigaset_reinitbcshw(struct bc_state *bcs)
static void gigaset_freecshw(struct cardstate *cs)
{
/* timers, URBs and rcvbuf are disposed of in disconnect */
kfree(cs->hw.bas->int_in_buf);
kfree(cs->hw.bas);
cs->hw.bas = NULL;
}
Expand All @@ -2140,6 +2144,12 @@ static int gigaset_initcshw(struct cardstate *cs)
pr_err("out of memory\n");
return 0;
}
ucs->int_in_buf = kmalloc(IP_MSGSIZE, GFP_KERNEL);
if (!ucs->int_in_buf) {
kfree(ucs);
pr_err("out of memory\n");
return 0;
}

ucs->urb_cmd_in = NULL;
ucs->urb_cmd_out = NULL;
Expand Down Expand Up @@ -2292,7 +2302,7 @@ static int gigaset_probe(struct usb_interface *interface,
usb_fill_int_urb(ucs->urb_int_in, udev,
usb_rcvintpipe(udev,
(endpoint->bEndpointAddress) & 0x0f),
ucs->int_in_buf, 3, read_int_callback, cs,
ucs->int_in_buf, IP_MSGSIZE, read_int_callback, cs,
endpoint->bInterval);
if ((rc = usb_submit_urb(ucs->urb_int_in, GFP_KERNEL)) != 0) {
dev_err(cs->dev, "could not submit interrupt URB: %s\n",
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ config NI65

config DNET
tristate "Dave ethernet support (DNET)"
depends on NET_ETHERNET
depends on NET_ETHERNET && HAS_IOMEM
select PHYLIB
help
The Dave ethernet interface (DNET) is found on Qong Board FPGA.
Expand Down
1 change: 1 addition & 0 deletions drivers/net/benet/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ struct be_adapter {
struct be_eq_obj rx_eq;
struct be_rx_obj rx_obj;
u32 big_page_size; /* Compounded page size shared by rx wrbs */
bool rx_post_starved; /* Zero rx frags have been posted to BE */

struct vlan_group *vlan_grp;
u16 num_vlans;
Expand Down
60 changes: 34 additions & 26 deletions drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,26 +273,6 @@ static void be_rx_eqd_update(struct be_adapter *adapter)
rx_eq->cur_eqd = eqd;
}

static void be_worker(struct work_struct *work)
{
struct be_adapter *adapter =
container_of(work, struct be_adapter, work.work);
int status;

/* Check link */
be_link_status_update(adapter);

/* Get Stats */
status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd);
if (!status)
netdev_stats_update(adapter);

/* Set EQ delay */
be_rx_eqd_update(adapter);

schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
}

static struct net_device_stats *be_get_stats(struct net_device *dev)
{
struct be_adapter *adapter = netdev_priv(dev);
Expand Down Expand Up @@ -493,7 +473,7 @@ static int be_change_mtu(struct net_device *netdev, int new_mtu)
* program them in BE. If more than BE_NUM_VLANS_SUPPORTED are configured,
* set the BE in promiscuous VLAN mode.
*/
static void be_vids_config(struct net_device *netdev)
static void be_vid_config(struct net_device *netdev)
{
struct be_adapter *adapter = netdev_priv(netdev);
u16 vtag[BE_NUM_VLANS_SUPPORTED];
Expand Down Expand Up @@ -536,7 +516,7 @@ static void be_vlan_add_vid(struct net_device *netdev, u16 vid)
adapter->num_vlans++;
adapter->vlan_tag[vid] = 1;

be_vids_config(netdev);
be_vid_config(netdev);
}

static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
Expand All @@ -547,7 +527,7 @@ static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
adapter->vlan_tag[vid] = 0;

vlan_group_set_device(adapter->vlan_grp, vid, NULL);
be_vids_config(netdev);
be_vid_config(netdev);
}

static void be_set_multicast_filter(struct net_device *netdev)
Expand Down Expand Up @@ -900,8 +880,11 @@ static void be_post_rx_frags(struct be_adapter *adapter)
page_info->last_page_user = true;

if (posted) {
be_rxq_notify(&adapter->ctrl, rxq->id, posted);
atomic_add(posted, &rxq->used);
be_rxq_notify(&adapter->ctrl, rxq->id, posted);
} else if (atomic_read(&rxq->used) == 0) {
/* Let be_worker replenish when memory is available */
adapter->rx_post_starved = true;
}

return;
Expand Down Expand Up @@ -1305,6 +1288,31 @@ int be_poll_tx(struct napi_struct *napi, int budget)
return 1;
}

static void be_worker(struct work_struct *work)
{
struct be_adapter *adapter =
container_of(work, struct be_adapter, work.work);
int status;

/* Check link */
be_link_status_update(adapter);

/* Get Stats */
status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd);
if (!status)
netdev_stats_update(adapter);

/* Set EQ delay */
be_rx_eqd_update(adapter);

if (adapter->rx_post_starved) {
adapter->rx_post_starved = false;
be_post_rx_frags(adapter);
}

schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
}

static void be_msix_enable(struct be_adapter *adapter)
{
int i, status;
Expand Down Expand Up @@ -1422,6 +1430,8 @@ static int be_open(struct net_device *netdev)
if (status != 0)
goto do_none;

be_vid_config(netdev);

status = be_cmd_set_flow_control(ctrl, true, true);
if (status != 0)
goto if_destroy;
Expand Down Expand Up @@ -1856,8 +1866,6 @@ static int be_resume(struct pci_dev *pdev)
pci_set_power_state(pdev, 0);
pci_restore_state(pdev);

be_vids_config(netdev);

if (netif_running(netdev)) {
rtnl_lock();
be_open(netdev);
Expand Down
12 changes: 6 additions & 6 deletions drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@

#define DRV_MODULE_NAME "bnx2"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.9.2"
#define DRV_MODULE_RELDATE "Feb 11, 2009"
#define DRV_MODULE_VERSION "1.9.3"
#define DRV_MODULE_RELDATE "March 17, 2009"

#define RUN_AT(x) (jiffies + (x))

Expand Down Expand Up @@ -5843,9 +5843,6 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs)
for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
msix_ent[i].entry = i;
msix_ent[i].vector = 0;

snprintf(bp->irq_tbl[i].name, len, "%s-%d", dev->name, i);
bp->irq_tbl[i].handler = bnx2_msi_1shot;
}

rc = pci_enable_msix(bp->pdev, msix_ent, BNX2_MAX_MSIX_VEC);
Expand All @@ -5854,8 +5851,11 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs)

bp->irq_nvecs = msix_vecs;
bp->flags |= BNX2_FLAG_USING_MSIX | BNX2_FLAG_ONE_SHOT_MSI;
for (i = 0; i < BNX2_MAX_MSIX_VEC; i++)
for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
bp->irq_tbl[i].vector = msix_ent[i].vector;
snprintf(bp->irq_tbl[i].name, len, "%s-%d", dev->name, i);
bp->irq_tbl[i].handler = bnx2_msi_1shot;
}
}

static void
Expand Down
25 changes: 20 additions & 5 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3537,11 +3537,26 @@ static int bond_slave_netdev_event(unsigned long event, struct net_device *slave
}
break;
case NETDEV_CHANGE:
/*
* TODO: is this what we get if somebody
* sets up a hierarchical bond, then rmmod's
* one of the slave bonding devices?
*/
if (bond->params.mode == BOND_MODE_8023AD || bond_is_lb(bond)) {
struct slave *slave;

slave = bond_get_slave_by_dev(bond, slave_dev);
if (slave) {
u16 old_speed = slave->speed;
u16 old_duplex = slave->duplex;

bond_update_speed_duplex(slave);

if (bond_is_lb(bond))
break;

if (old_speed != slave->speed)
bond_3ad_adapter_speed_changed(slave);
if (old_duplex != slave->duplex)
bond_3ad_adapter_duplex_changed(slave);
}
}

break;
case NETDEV_DOWN:
/*
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/dm9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,13 +930,15 @@ static irqreturn_t dm9000_interrupt(int irq, void *dev_id)
struct net_device *dev = dev_id;
board_info_t *db = netdev_priv(dev);
int int_status;
unsigned long flags;
u8 reg_save;

dm9000_dbg(db, 3, "entering %s\n", __func__);

/* A real interrupt coming */

spin_lock(&db->lock);
/* holders of db->lock must always block IRQs */
spin_lock_irqsave(&db->lock, flags);

/* Save previous register address */
reg_save = readb(db->io_addr);
Expand Down Expand Up @@ -972,7 +974,7 @@ static irqreturn_t dm9000_interrupt(int irq, void *dev_id)
/* Restore previous register address */
writeb(reg_save, db->io_addr);

spin_unlock(&db->lock);
spin_unlock_irqrestore(&db->lock, flags);

return IRQ_HANDLED;
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/dnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,11 @@ static int dnet_mii_probe(struct net_device *dev)

/* attach the mac to the phy */
if (bp->capabilities & DNET_HAS_RMII) {
phydev = phy_connect(dev, phydev->dev.bus_id,
phydev = phy_connect(dev, dev_name(&phydev->dev),
&dnet_handle_link_change, 0,
PHY_INTERFACE_MODE_RMII);
} else {
phydev = phy_connect(dev, phydev->dev.bus_id,
phydev = phy_connect(dev, dev_name(&phydev->dev),
&dnet_handle_link_change, 0,
PHY_INTERFACE_MODE_MII);
}
Expand Down Expand Up @@ -927,7 +927,7 @@ static int __devinit dnet_probe(struct platform_device *pdev)
phydev = bp->phy_dev;
dev_info(&pdev->dev, "attached PHY driver [%s] "
"(mii_bus:phy_addr=%s, irq=%d)\n",
phydev->drv->name, phydev->dev.bus_id, phydev->irq);
phydev->drv->name, dev_name(&phydev->dev), phydev->irq);

return 0;

Expand Down
20 changes: 17 additions & 3 deletions drivers/net/sh_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
{
struct net_device *ndev = netdev;
struct sh_eth_private *mdp = netdev_priv(ndev);
irqreturn_t ret = IRQ_NONE;
u32 ioaddr, boguscnt = RX_RING_SIZE;
u32 intr_status = 0;

Expand All @@ -696,7 +697,13 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
/* Get interrpt stat */
intr_status = ctrl_inl(ioaddr + EESR);
/* Clear interrupt */
ctrl_outl(intr_status, ioaddr + EESR);
if (intr_status & (EESR_FRC | EESR_RMAF | EESR_RRF |
EESR_RTLF | EESR_RTSF | EESR_PRE | EESR_CERF |
TX_CHECK | EESR_ERR_CHECK)) {
ctrl_outl(intr_status, ioaddr + EESR);
ret = IRQ_HANDLED;
} else
goto other_irq;

if (intr_status & (EESR_FRC | /* Frame recv*/
EESR_RMAF | /* Multi cast address recv*/
Expand All @@ -723,9 +730,10 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
ndev->name, intr_status);
}

other_irq:
spin_unlock(&mdp->lock);

return IRQ_HANDLED;
return ret;
}

static void sh_eth_timer(unsigned long data)
Expand Down Expand Up @@ -844,7 +852,13 @@ static int sh_eth_open(struct net_device *ndev)
int ret = 0;
struct sh_eth_private *mdp = netdev_priv(ndev);

ret = request_irq(ndev->irq, &sh_eth_interrupt, 0, ndev->name, ndev);
ret = request_irq(ndev->irq, &sh_eth_interrupt,
#if defined(CONFIG_CPU_SUBTYPE_SH7763) || defined(CONFIG_CPU_SUBTYPE_SH7764)
IRQF_SHARED,
#else
0,
#endif
ndev->name, ndev);
if (ret) {
printk(KERN_ERR "Can not assign IRQ number to %s\n", CARDNAME);
return ret;
Expand Down
Loading

0 comments on commit d56ffd3

Please sign in to comment.