]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
netpoll queue cleanup
authorStephen Hemminger <shemminger@osdl.org>
Thu, 26 Oct 2006 22:46:55 +0000 (15:46 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 3 Dec 2006 05:22:37 +0000 (21:22 -0800)
The beast had a long and not very happy history. At one
point, a friend (netdump) had asked that he open up a little.
Well, the friend was long gone now, and the beast had
this dangling piece hanging (netpoll_queue).

It wasn't hard to stitch the netpoll_queue back in
where it belonged and make everything tidy.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
drivers/net/netconsole.c
include/linux/netpoll.h
net/core/netpoll.c

index e6e8a9797b6dbff81c8f4a8be6e34e58bef82811..69233f6aa05ca2d115f77ed3c71d00954c5c0204 100644 (file)
@@ -60,7 +60,6 @@ static struct netpoll np = {
        .local_port = 6665,
        .remote_port = 6666,
        .remote_mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
-       .drop = netpoll_queue,
 };
 static int configured = 0;
 
index c65d12ec7bb0818241325c603ad0155c41934f47..b7eb008c43de8f968172680bb707fe54c2cec457 100644 (file)
@@ -18,7 +18,7 @@ struct netpoll {
        struct net_device *dev;
        char dev_name[16], *name;
        void (*rx_hook)(struct netpoll *, int, char *, int);
-       void (*drop)(struct sk_buff *skb);
+
        u32 local_ip, remote_ip;
        u16 local_port, remote_port;
        unsigned char local_mac[6], remote_mac[6];
@@ -44,7 +44,7 @@ int netpoll_trap(void);
 void netpoll_set_trap(int trap);
 void netpoll_cleanup(struct netpoll *np);
 int __netpoll_rx(struct sk_buff *skb);
-void netpoll_queue(struct sk_buff *skb);
+
 
 #ifdef CONFIG_NETPOLL
 static inline int netpoll_rx(struct sk_buff *skb)
index 6b34c394672fa0472bc1ff5b3476c7a679153904..0d1de3c47a01276aeccb3c9c611ec7e00acaf614 100644 (file)
@@ -77,19 +77,6 @@ static void queue_process(void *p)
        }
 }
 
-void netpoll_queue(struct sk_buff *skb)
-{
-       struct net_device *dev = skb->dev;
-       struct netpoll_info *npinfo = dev->npinfo;
-
-       if (!npinfo)
-               kfree_skb(skb);
-       else {
-               skb_queue_tail(&npinfo->txq, skb);
-               schedule_work(&npinfo->tx_work);
-       }
-}
-
 static int checksum_udp(struct sk_buff *skb, struct udphdr *uh,
                             unsigned short ulen, u32 saddr, u32 daddr)
 {
@@ -256,7 +243,7 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
        }
 
        /* don't get messages out of order, and no recursion */
-       if ( !(np->drop == netpoll_queue && skb_queue_len(&npinfo->txq))
+       if ( skb_queue_len(&npinfo->txq) == 0
             && npinfo->poll_owner != smp_processor_id()
             && netif_tx_trylock(dev)) {
 
@@ -277,11 +264,8 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
        }
 
        if (status != NETDEV_TX_OK) {
-               /* requeue for later */
-               if (np->drop)
-                       np->drop(skb);
-               else
-                       __kfree_skb(skb);
+               skb_queue_tail(&npinfo->txq, skb);
+               schedule_work(&npinfo->tx_work);
        }
 }
 
@@ -809,4 +793,3 @@ EXPORT_SYMBOL(netpoll_setup);
 EXPORT_SYMBOL(netpoll_cleanup);
 EXPORT_SYMBOL(netpoll_send_udp);
 EXPORT_SYMBOL(netpoll_poll);
-EXPORT_SYMBOL(netpoll_queue);