[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1269360844.2983.294.camel@edumazet-laptop>
Date: Tue, 23 Mar 2010 17:14:04 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Tom Herbert <therbert@...gle.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH] Fix locking in flush_backlog
Le mardi 23 mars 2010 à 08:56 -0700, Tom Herbert a écrit :
> Eric,
>
> I'm not sure what you're asking. Do you just want to add spinlocks in
> the flush_backlog function without changing the mechanism to call the
> function on each CPU, or keep flush_backlog but call it from
> netdev_run_todo for each queue?
>
keep flush_backlog() so that its role is obvious and indentation level
not too big.
static void flush_backlog(int cpu)
{
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);
}
And call it from netdev_run_todo() :
for_each_online_cpu(i)
flush_backlog(i);
This adds two lines to netdev_run_todo() only.
Thanks
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists