Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (63 commits) drivers/net/usb/asix.c: Fix pointer cast. be2net: Bug fix to avoid disabling bottom half during firmware upgrade. proc_dointvec: write a single value hso: add support for new products Phonet: fix potential use-after-free in pep_sock_close() ath9k: remove VEOL support for ad-hoc ath9k: change beacon allocation to prefer the first beacon slot sock.h: fix kernel-doc warning cls_cgroup: Fix build error when built-in macvlan: do proper cleanup in macvlan_common_newlink() V2 be2net: Bug fix in init code in probe net/dccp: expansion of error code size ath9k: Fix rx of mcast/bcast frames in PS mode with auto sleep wireless: fix sta_info.h kernel-doc warnings wireless: fix mac80211.h kernel-doc warnings iwlwifi: testing the wrong variable in iwl_add_bssid_station() ath9k_htc: rare leak in ath9k_hif_usb_alloc_tx_urbs() ath9k_htc: dereferencing before check in hif_usb_tx_cb() rt2x00: Fix rt2800usb TX descriptor writing. rt2x00: Fix failed SLEEP->AWAKE and AWAKE->SLEEP transitions. ...
This commit is contained in:
@@ -954,18 +954,22 @@ int dev_alloc_name(struct net_device *dev, const char *name)
|
||||
}
|
||||
EXPORT_SYMBOL(dev_alloc_name);
|
||||
|
||||
static int dev_get_valid_name(struct net *net, const char *name, char *buf,
|
||||
bool fmt)
|
||||
static int dev_get_valid_name(struct net_device *dev, const char *name, bool fmt)
|
||||
{
|
||||
struct net *net;
|
||||
|
||||
BUG_ON(!dev_net(dev));
|
||||
net = dev_net(dev);
|
||||
|
||||
if (!dev_valid_name(name))
|
||||
return -EINVAL;
|
||||
|
||||
if (fmt && strchr(name, '%'))
|
||||
return __dev_alloc_name(net, name, buf);
|
||||
return dev_alloc_name(dev, name);
|
||||
else if (__dev_get_by_name(net, name))
|
||||
return -EEXIST;
|
||||
else if (buf != name)
|
||||
strlcpy(buf, name, IFNAMSIZ);
|
||||
else if (dev->name != name)
|
||||
strlcpy(dev->name, name, IFNAMSIZ);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -997,7 +1001,7 @@ int dev_change_name(struct net_device *dev, const char *newname)
|
||||
|
||||
memcpy(oldname, dev->name, IFNAMSIZ);
|
||||
|
||||
err = dev_get_valid_name(net, newname, dev->name, 1);
|
||||
err = dev_get_valid_name(dev, newname, 1);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
@@ -2421,10 +2425,7 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu,
|
||||
if (skb_queue_len(&sd->input_pkt_queue)) {
|
||||
enqueue:
|
||||
__skb_queue_tail(&sd->input_pkt_queue, skb);
|
||||
#ifdef CONFIG_RPS
|
||||
*qtail = sd->input_queue_head +
|
||||
skb_queue_len(&sd->input_pkt_queue);
|
||||
#endif
|
||||
input_queue_tail_incr_save(sd, qtail);
|
||||
rps_unlock(sd);
|
||||
local_irq_restore(flags);
|
||||
return NET_RX_SUCCESS;
|
||||
@@ -2959,7 +2960,7 @@ static void flush_backlog(void *arg)
|
||||
if (skb->dev == dev) {
|
||||
__skb_unlink(skb, &sd->input_pkt_queue);
|
||||
kfree_skb(skb);
|
||||
input_queue_head_add(sd, 1);
|
||||
input_queue_head_incr(sd);
|
||||
}
|
||||
}
|
||||
rps_unlock(sd);
|
||||
@@ -2968,6 +2969,7 @@ static void flush_backlog(void *arg)
|
||||
if (skb->dev == dev) {
|
||||
__skb_unlink(skb, &sd->process_queue);
|
||||
kfree_skb(skb);
|
||||
input_queue_head_incr(sd);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3323,18 +3325,20 @@ static int process_backlog(struct napi_struct *napi, int quota)
|
||||
while ((skb = __skb_dequeue(&sd->process_queue))) {
|
||||
local_irq_enable();
|
||||
__netif_receive_skb(skb);
|
||||
if (++work >= quota)
|
||||
return work;
|
||||
local_irq_disable();
|
||||
input_queue_head_incr(sd);
|
||||
if (++work >= quota) {
|
||||
local_irq_enable();
|
||||
return work;
|
||||
}
|
||||
}
|
||||
|
||||
rps_lock(sd);
|
||||
qlen = skb_queue_len(&sd->input_pkt_queue);
|
||||
if (qlen) {
|
||||
input_queue_head_add(sd, qlen);
|
||||
if (qlen)
|
||||
skb_queue_splice_tail_init(&sd->input_pkt_queue,
|
||||
&sd->process_queue);
|
||||
}
|
||||
|
||||
if (qlen < quota - work) {
|
||||
/*
|
||||
* Inline a custom version of __napi_complete().
|
||||
@@ -4960,7 +4964,7 @@ int register_netdevice(struct net_device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
ret = dev_get_valid_name(net, dev->name, dev->name, 0);
|
||||
ret = dev_get_valid_name(dev, dev->name, 0);
|
||||
if (ret)
|
||||
goto err_uninit;
|
||||
|
||||
@@ -5558,7 +5562,7 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
|
||||
/* We get here if we can't use the current device name */
|
||||
if (!pat)
|
||||
goto out;
|
||||
if (dev_get_valid_name(net, pat, dev->name, 1))
|
||||
if (dev_get_valid_name(dev, pat, 1))
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -5661,12 +5665,14 @@ static int dev_cpu_callback(struct notifier_block *nfb,
|
||||
local_irq_enable();
|
||||
|
||||
/* Process offline CPU's input_pkt_queue */
|
||||
while ((skb = __skb_dequeue(&oldsd->process_queue))) {
|
||||
netif_rx(skb);
|
||||
input_queue_head_incr(oldsd);
|
||||
}
|
||||
while ((skb = __skb_dequeue(&oldsd->input_pkt_queue))) {
|
||||
netif_rx(skb);
|
||||
input_queue_head_add(oldsd, 1);
|
||||
input_queue_head_incr(oldsd);
|
||||
}
|
||||
while ((skb = __skb_dequeue(&oldsd->process_queue)))
|
||||
netif_rx(skb);
|
||||
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user