Commit 2b1c4354 authored by David S. Miller's avatar David S. Miller

Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:
	drivers/net/virtio_net.c
parents 5e140dfc 170ebf85
...@@ -1478,6 +1478,13 @@ of problems on the network like duplicate address or bad checksums. Normally, ...@@ -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 this should be enabled, but if the problem persists the messages can be
disabled. 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 netdev_max_backlog
------------------ ------------------
......
...@@ -46,6 +46,9 @@ MODULE_PARM_DESC(cidmode, "Call-ID mode"); ...@@ -46,6 +46,9 @@ MODULE_PARM_DESC(cidmode, "Call-ID mode");
/* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */ /* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */
#define IF_WRITEBUF 264 #define IF_WRITEBUF 264
/* interrupt pipe message size according to ibid. ch. 2.2 */
#define IP_MSGSIZE 3
/* Values for the Gigaset 307x */ /* Values for the Gigaset 307x */
#define USB_GIGA_VENDOR_ID 0x0681 #define USB_GIGA_VENDOR_ID 0x0681
#define USB_3070_PRODUCT_ID 0x0001 #define USB_3070_PRODUCT_ID 0x0001
...@@ -110,7 +113,7 @@ struct bas_cardstate { ...@@ -110,7 +113,7 @@ struct bas_cardstate {
unsigned char *rcvbuf; /* AT reply receive buffer */ unsigned char *rcvbuf; /* AT reply receive buffer */
struct urb *urb_int_in; /* URB for interrupt pipe */ 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 */ spinlock_t lock; /* locks all following */
int basstate; /* bitmap (BS_*) */ int basstate; /* bitmap (BS_*) */
...@@ -657,7 +660,7 @@ static void read_int_callback(struct urb *urb) ...@@ -657,7 +660,7 @@ static void read_int_callback(struct urb *urb)
} }
/* drop incomplete packets even if the missing bytes wouldn't matter */ /* 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", dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n",
urb->actual_length); urb->actual_length);
goto resubmit; goto resubmit;
...@@ -2127,6 +2130,7 @@ static void gigaset_reinitbcshw(struct bc_state *bcs) ...@@ -2127,6 +2130,7 @@ static void gigaset_reinitbcshw(struct bc_state *bcs)
static void gigaset_freecshw(struct cardstate *cs) static void gigaset_freecshw(struct cardstate *cs)
{ {
/* timers, URBs and rcvbuf are disposed of in disconnect */ /* timers, URBs and rcvbuf are disposed of in disconnect */
kfree(cs->hw.bas->int_in_buf);
kfree(cs->hw.bas); kfree(cs->hw.bas);
cs->hw.bas = NULL; cs->hw.bas = NULL;
} }
...@@ -2140,6 +2144,12 @@ static int gigaset_initcshw(struct cardstate *cs) ...@@ -2140,6 +2144,12 @@ static int gigaset_initcshw(struct cardstate *cs)
pr_err("out of memory\n"); pr_err("out of memory\n");
return 0; 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_in = NULL;
ucs->urb_cmd_out = NULL; ucs->urb_cmd_out = NULL;
...@@ -2292,7 +2302,7 @@ static int gigaset_probe(struct usb_interface *interface, ...@@ -2292,7 +2302,7 @@ static int gigaset_probe(struct usb_interface *interface,
usb_fill_int_urb(ucs->urb_int_in, udev, usb_fill_int_urb(ucs->urb_int_in, udev,
usb_rcvintpipe(udev, usb_rcvintpipe(udev,
(endpoint->bEndpointAddress) & 0x0f), (endpoint->bEndpointAddress) & 0x0f),
ucs->int_in_buf, 3, read_int_callback, cs, ucs->int_in_buf, IP_MSGSIZE, read_int_callback, cs,
endpoint->bInterval); endpoint->bInterval);
if ((rc = usb_submit_urb(ucs->urb_int_in, GFP_KERNEL)) != 0) { if ((rc = usb_submit_urb(ucs->urb_int_in, GFP_KERNEL)) != 0) {
dev_err(cs->dev, "could not submit interrupt URB: %s\n", dev_err(cs->dev, "could not submit interrupt URB: %s\n",
......
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
#define DRV_MODULE_NAME "bnx2" #define DRV_MODULE_NAME "bnx2"
#define PFX DRV_MODULE_NAME ": " #define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.9.2" #define DRV_MODULE_VERSION "1.9.3"
#define DRV_MODULE_RELDATE "Feb 11, 2009" #define DRV_MODULE_RELDATE "March 17, 2009"
#define RUN_AT(x) (jiffies + (x)) #define RUN_AT(x) (jiffies + (x))
...@@ -5855,9 +5855,6 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs) ...@@ -5855,9 +5855,6 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs)
for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) { for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
msix_ent[i].entry = i; msix_ent[i].entry = i;
msix_ent[i].vector = 0; 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); rc = pci_enable_msix(bp->pdev, msix_ent, BNX2_MAX_MSIX_VEC);
...@@ -5866,8 +5863,11 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs) ...@@ -5866,8 +5863,11 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs)
bp->irq_nvecs = msix_vecs; bp->irq_nvecs = msix_vecs;
bp->flags |= BNX2_FLAG_USING_MSIX | BNX2_FLAG_ONE_SHOT_MSI; 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; 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 static void
......
...@@ -3545,11 +3545,26 @@ static int bond_slave_netdev_event(unsigned long event, struct net_device *slave ...@@ -3545,11 +3545,26 @@ static int bond_slave_netdev_event(unsigned long event, struct net_device *slave
} }
break; break;
case NETDEV_CHANGE: case NETDEV_CHANGE:
/* if (bond->params.mode == BOND_MODE_8023AD || bond_is_lb(bond)) {
* TODO: is this what we get if somebody struct slave *slave;
* sets up a hierarchical bond, then rmmod's
* one of the slave bonding devices? 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; break;
case NETDEV_DOWN: case NETDEV_DOWN:
/* /*
......
...@@ -687,6 +687,7 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev) ...@@ -687,6 +687,7 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
{ {
struct net_device *ndev = netdev; struct net_device *ndev = netdev;
struct sh_eth_private *mdp = netdev_priv(ndev); struct sh_eth_private *mdp = netdev_priv(ndev);
irqreturn_t ret = IRQ_NONE;
u32 ioaddr, boguscnt = RX_RING_SIZE; u32 ioaddr, boguscnt = RX_RING_SIZE;
u32 intr_status = 0; u32 intr_status = 0;
...@@ -696,7 +697,13 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev) ...@@ -696,7 +697,13 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
/* Get interrpt stat */ /* Get interrpt stat */
intr_status = ctrl_inl(ioaddr + EESR); intr_status = ctrl_inl(ioaddr + EESR);
/* Clear interrupt */ /* Clear interrupt */
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); ctrl_outl(intr_status, ioaddr + EESR);
ret = IRQ_HANDLED;
} else
goto other_irq;
if (intr_status & (EESR_FRC | /* Frame recv*/ if (intr_status & (EESR_FRC | /* Frame recv*/
EESR_RMAF | /* Multi cast address recv*/ EESR_RMAF | /* Multi cast address recv*/
...@@ -723,9 +730,10 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev) ...@@ -723,9 +730,10 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
ndev->name, intr_status); ndev->name, intr_status);
} }
other_irq:
spin_unlock(&mdp->lock); spin_unlock(&mdp->lock);
return IRQ_HANDLED; return ret;
} }
static void sh_eth_timer(unsigned long data) static void sh_eth_timer(unsigned long data)
...@@ -844,7 +852,13 @@ static int sh_eth_open(struct net_device *ndev) ...@@ -844,7 +852,13 @@ static int sh_eth_open(struct net_device *ndev)
int ret = 0; int ret = 0;
struct sh_eth_private *mdp = netdev_priv(ndev); 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) { if (ret) {
printk(KERN_ERR "Can not assign IRQ number to %s\n", CARDNAME); printk(KERN_ERR "Can not assign IRQ number to %s\n", CARDNAME);
return ret; return ret;
......
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
#define SH7763_SKB_ALIGN 32 #define SH7763_SKB_ALIGN 32
/* Chip Base Address */ /* Chip Base Address */
# define SH_TSU_ADDR 0xFFE01800 # define SH_TSU_ADDR 0xFEE01800
# define ARSTR 0xFFE01800 # define ARSTR SH_TSU_ADDR
/* Chip Registers */ /* Chip Registers */
/* E-DMAC */ /* E-DMAC */
......
...@@ -1225,6 +1225,10 @@ static int smsc911x_open(struct net_device *dev) ...@@ -1225,6 +1225,10 @@ static int smsc911x_open(struct net_device *dev)
dev_info(&dev->dev, "SMSC911x/921x identified at %#08lx, IRQ: %d\n", dev_info(&dev->dev, "SMSC911x/921x identified at %#08lx, IRQ: %d\n",
(unsigned long)pdata->ioaddr, dev->irq); (unsigned long)pdata->ioaddr, dev->irq);
/* Reset the last known duplex and carrier */
pdata->last_duplex = -1;
pdata->last_carrier = -1;
/* Bring the PHY up */ /* Bring the PHY up */
phy_start(pdata->phy_dev); phy_start(pdata->phy_dev);
......
...@@ -255,6 +255,7 @@ const char tulip_media_cap[32] = ...@@ -255,6 +255,7 @@ const char tulip_media_cap[32] =
static void tulip_tx_timeout(struct net_device *dev); static void tulip_tx_timeout(struct net_device *dev);
static void tulip_init_ring(struct net_device *dev); static void tulip_init_ring(struct net_device *dev);
static void tulip_free_ring(struct net_device *dev);
static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev); static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev);
static int tulip_open(struct net_device *dev); static int tulip_open(struct net_device *dev);
static int tulip_close(struct net_device *dev); static int tulip_close(struct net_device *dev);
...@@ -502,16 +503,21 @@ tulip_open(struct net_device *dev) ...@@ -502,16 +503,21 @@ tulip_open(struct net_device *dev)
{ {
int retval; int retval;
if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev)))
return retval;
tulip_init_ring (dev); tulip_init_ring (dev);
retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev);
if (retval)
goto free_ring;
tulip_up (dev); tulip_up (dev);
netif_start_queue (dev); netif_start_queue (dev);
return 0; return 0;
free_ring:
tulip_free_ring (dev);
return retval;
} }
...@@ -768,23 +774,11 @@ static void tulip_down (struct net_device *dev) ...@@ -768,23 +774,11 @@ static void tulip_down (struct net_device *dev)
tulip_set_power_state (tp, 0, 1); tulip_set_power_state (tp, 0, 1);
} }
static void tulip_free_ring (struct net_device *dev)
static int tulip_close (struct net_device *dev)
{ {
struct tulip_private *tp = netdev_priv(dev); struct tulip_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp->base_addr;
int i; int i;
netif_stop_queue (dev);
tulip_down (dev);
if (tulip_debug > 1)
printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n",
dev->name, ioread32 (ioaddr + CSR5));
free_irq (dev->irq, dev);
/* Free all the skbuffs in the Rx queue. */ /* Free all the skbuffs in the Rx queue. */
for (i = 0; i < RX_RING_SIZE; i++) { for (i = 0; i < RX_RING_SIZE; i++) {
struct sk_buff *skb = tp->rx_buffers[i].skb; struct sk_buff *skb = tp->rx_buffers[i].skb;
...@@ -803,6 +797,7 @@ static int tulip_close (struct net_device *dev) ...@@ -803,6 +797,7 @@ static int tulip_close (struct net_device *dev)
dev_kfree_skb (skb); dev_kfree_skb (skb);
} }
} }
for (i = 0; i < TX_RING_SIZE; i++) { for (i = 0; i < TX_RING_SIZE; i++) {
struct sk_buff *skb = tp->tx_buffers[i].skb; struct sk_buff *skb = tp->tx_buffers[i].skb;
...@@ -814,6 +809,24 @@ static int tulip_close (struct net_device *dev) ...@@ -814,6 +809,24 @@ static int tulip_close (struct net_device *dev)
tp->tx_buffers[i].skb = NULL; tp->tx_buffers[i].skb = NULL;
tp->tx_buffers[i].mapping = 0; tp->tx_buffers[i].mapping = 0;
} }
}
static int tulip_close (struct net_device *dev)
{
struct tulip_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp->base_addr;
netif_stop_queue (dev);
tulip_down (dev);
if (tulip_debug > 1)
printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n",
dev->name, ioread32 (ioaddr + CSR5));
free_irq (dev->irq, dev);
tulip_free_ring (dev);
return 0; return 0;
} }
......
...@@ -953,6 +953,7 @@ static int virtnet_probe(struct virtio_device *vdev) ...@@ -953,6 +953,7 @@ static int virtnet_probe(struct virtio_device *vdev)
vi->status = VIRTIO_NET_S_LINK_UP; vi->status = VIRTIO_NET_S_LINK_UP;
virtnet_update_status(vi); virtnet_update_status(vi);
netif_carrier_on(dev);
pr_debug("virtnet: registered device %s\n", dev->name); pr_debug("virtnet: registered device %s\n", dev->name);
return 0; return 0;
......
...@@ -2712,7 +2712,7 @@ void netif_napi_del(struct napi_struct *napi) ...@@ -2712,7 +2712,7 @@ void netif_napi_del(struct napi_struct *napi)
struct sk_buff *skb, *next; struct sk_buff *skb, *next;
list_del_init(&napi->dev_list); list_del_init(&napi->dev_list);
kfree(napi->skb); kfree_skb(napi->skb);
for (skb = napi->gro_list; skb; skb = next) { for (skb = napi->gro_list; skb; skb = next) {
next = skb->next; next = skb->next;
......
...@@ -463,6 +463,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) ...@@ -463,6 +463,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev, static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
struct net_device *dev) struct net_device *dev)
{ {
struct net *net = container_of(qp->q.net, struct net, ipv4.frags);
struct iphdr *iph; struct iphdr *iph;
struct sk_buff *fp, *head = qp->q.fragments; struct sk_buff *fp, *head = qp->q.fragments;
int len; int len;
...@@ -548,7 +549,7 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev, ...@@ -548,7 +549,7 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
iph = ip_hdr(head); iph = ip_hdr(head);
iph->frag_off = 0; iph->frag_off = 0;
iph->tot_len = htons(len); iph->tot_len = htons(len);
IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_REASMOKS); IP_INC_STATS_BH(net, IPSTATS_MIB_REASMOKS);
qp->q.fragments = NULL; qp->q.fragments = NULL;
return 0; return 0;
......
...@@ -452,6 +452,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, ...@@ -452,6 +452,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
struct net_device *dev) struct net_device *dev)
{ {
struct net *net = container_of(fq->q.net, struct net, ipv6.frags);
struct sk_buff *fp, *head = fq->q.fragments; struct sk_buff *fp, *head = fq->q.fragments;
int payload_len; int payload_len;
unsigned int nhoff; unsigned int nhoff;
...@@ -551,8 +552,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, ...@@ -551,8 +552,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
head->csum); head->csum);
rcu_read_lock(); rcu_read_lock();
IP6_INC_STATS_BH(dev_net(dev), IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMOKS);
__in6_dev_get(dev), IPSTATS_MIB_REASMOKS);
rcu_read_unlock(); rcu_read_unlock();
fq->q.fragments = NULL; fq->q.fragments = NULL;
return 1; return 1;
...@@ -566,8 +566,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, ...@@ -566,8 +566,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n"); printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n");
out_fail: out_fail:
rcu_read_lock(); rcu_read_lock();
IP6_INC_STATS_BH(dev_net(dev), IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS);
__in6_dev_get(dev), IPSTATS_MIB_REASMFAILS);
rcu_read_unlock(); rcu_read_unlock();
return -1; return -1;
} }
......
...@@ -188,9 +188,9 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct net *net, ...@@ -188,9 +188,9 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct net *net,
} }
nt = netdev_priv(dev); nt = netdev_priv(dev);
ipip6_tunnel_init(dev);
nt->parms = *parms; nt->parms = *parms;
ipip6_tunnel_init(dev);
if (parms->i_flags & SIT_ISATAP) if (parms->i_flags & SIT_ISATAP)
dev->priv_flags |= IFF_ISATAP; dev->priv_flags |= IFF_ISATAP;
......
...@@ -111,7 +111,8 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep, ...@@ -111,7 +111,8 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
if (sctp_addip_enable) { if (sctp_addip_enable) {
auth_chunks->chunks[0] = SCTP_CID_ASCONF; auth_chunks->chunks[0] = SCTP_CID_ASCONF;
auth_chunks->chunks[1] = SCTP_CID_ASCONF_ACK; auth_chunks->chunks[1] = SCTP_CID_ASCONF_ACK;
auth_chunks->param_hdr.length += htons(2); auth_chunks->param_hdr.length =
htons(sizeof(sctp_paramhdr_t) + 2);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment