Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204038
b: refs/heads/master
c: 3578b0c
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Aug 3, 2010
1 parent 8a704be commit c0e16df
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 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: a427615e0420f179eab801b929111abaadea2ed3
refs/heads/master: 3578b0c8abc7bdb4f02152ce5db7e09d484c6866
4 changes: 1 addition & 3 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,9 +1591,7 @@ EXPORT_SYMBOL(__netif_schedule);

void dev_kfree_skb_irq(struct sk_buff *skb)
{
if (!skb->destructor)
dev_kfree_skb(skb);
else if (atomic_dec_and_test(&skb->users)) {
if (atomic_dec_and_test(&skb->users)) {
struct softnet_data *sd;
unsigned long flags;

Expand Down
31 changes: 31 additions & 0 deletions trunk/net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ static atomic_t trapped;
(MAX_UDP_CHUNK + sizeof(struct udphdr) + \
sizeof(struct iphdr) + sizeof(struct ethhdr))

static void zap_completion_queue(void);
static void arp_reply(struct sk_buff *skb);

static unsigned int carrier_timeout = 4;
Expand Down Expand Up @@ -196,6 +197,7 @@ void netpoll_poll_dev(struct net_device *dev)

service_arp_queue(dev->npinfo);

zap_completion_queue();
}
EXPORT_SYMBOL(netpoll_poll_dev);

Expand All @@ -221,11 +223,40 @@ static void refill_skbs(void)
spin_unlock_irqrestore(&skb_pool.lock, flags);
}

static void zap_completion_queue(void)
{
unsigned long flags;
struct softnet_data *sd = &get_cpu_var(softnet_data);

if (sd->completion_queue) {
struct sk_buff *clist;

local_irq_save(flags);
clist = sd->completion_queue;
sd->completion_queue = NULL;
local_irq_restore(flags);

while (clist != NULL) {
struct sk_buff *skb = clist;
clist = clist->next;
if (skb->destructor) {
atomic_inc(&skb->users);
dev_kfree_skb_any(skb); /* put this one back */
} else {
__kfree_skb(skb);
}
}
}

put_cpu_var(softnet_data);
}

static struct sk_buff *find_skb(struct netpoll *np, int len, int reserve)
{
int count = 0;
struct sk_buff *skb;

zap_completion_queue();
refill_skbs();
repeat:

Expand Down

0 comments on commit c0e16df

Please sign in to comment.