]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/core/netpoll.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6-omap-h63xx.git] / net / core / netpoll.c
index d09affdbad3c5cdabb6aa8a6a8fc9a2bdc8ab21a..802fe11efad0b2ad53942f28ce591435380e8008 100644 (file)
@@ -357,7 +357,6 @@ static void arp_reply(struct sk_buff *skb)
        unsigned char *arp_ptr;
        int size, type = ARPOP_REPLY, ptype = ETH_P_ARP;
        u32 sip, tip;
-       unsigned long flags;
        struct sk_buff *send_skb;
        struct netpoll *np = NULL;
 
@@ -646,10 +645,10 @@ int netpoll_setup(struct netpoll *np)
 
                npinfo->rx_flags = 0;
                npinfo->rx_np = NULL;
-               npinfo->poll_lock = SPIN_LOCK_UNLOCKED;
+               spin_lock_init(&npinfo->poll_lock);
                npinfo->poll_owner = -1;
                npinfo->tries = MAX_RETRIES;
-               npinfo->rx_lock = SPIN_LOCK_UNLOCKED;
+               spin_lock_init(&npinfo->rx_lock);
        } else
                npinfo = ndev->npinfo;
 
@@ -704,7 +703,7 @@ int netpoll_setup(struct netpoll *np)
 
        if (!np->local_ip) {
                rcu_read_lock();
-               in_dev = __in_dev_get(ndev);
+               in_dev = __in_dev_get_rcu(ndev);
 
                if (!in_dev || !in_dev->ifa_list) {
                        rcu_read_unlock();
@@ -725,9 +724,16 @@ int netpoll_setup(struct netpoll *np)
                npinfo->rx_np = np;
                spin_unlock_irqrestore(&npinfo->rx_lock, flags);
        }
+
+       /* fill up the skb queue */
+       refill_skbs();
+
        /* last thing to do is link it to the net device structure */
        ndev->npinfo = npinfo;
 
+       /* avoid racing with NAPI reading npinfo */
+       synchronize_rcu();
+
        return 0;
 
  release: