Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193774
b: refs/heads/master
c: e51d739
h: refs/heads/master
v: v3
  • Loading branch information
Tom Herbert authored and David S. Miller committed Mar 24, 2010
1 parent a52b83f commit 06e55f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ec43b1a64a132303a6800c781bc17c683aedc55b
refs/heads/master: e51d739ab79110c43ca03daf3ddb3c52dadd38b7
12 changes: 8 additions & 4 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2766,17 +2766,19 @@ int netif_receive_skb(struct sk_buff *skb)
EXPORT_SYMBOL(netif_receive_skb);

/* Network device is going away, flush any packets still pending */
static void flush_backlog(void *arg)
static void flush_backlog(struct net_device *dev, int cpu)
{
struct net_device *dev = arg;
struct softnet_data *queue = &__get_cpu_var(softnet_data);
struct softnet_data *queue = &per_cpu(softnet_data, cpu);
struct sk_buff *skb, *tmp;
unsigned long flags;

spin_lock_irqsave(&queue->input_pkt_queue.lock, flags);
skb_queue_walk_safe(&queue->input_pkt_queue, skb, tmp)
if (skb->dev == dev) {
__skb_unlink(skb, &queue->input_pkt_queue);
kfree_skb(skb);
}
spin_unlock_irqrestore(&queue->input_pkt_queue.lock, flags);
}

static int napi_gro_complete(struct sk_buff *skb)
Expand Down Expand Up @@ -5545,6 +5547,7 @@ void netdev_run_todo(void)
while (!list_empty(&list)) {
struct net_device *dev
= list_first_entry(&list, struct net_device, todo_list);
int i;
list_del(&dev->todo_list);

if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) {
Expand All @@ -5556,7 +5559,8 @@ void netdev_run_todo(void)

dev->reg_state = NETREG_UNREGISTERED;

on_each_cpu(flush_backlog, dev, 1);
for_each_online_cpu(i)
flush_backlog(dev, i);

netdev_wait_allrefs(dev);

Expand Down

0 comments on commit 06e55f4

Please sign in to comment.