Thread (1 message) 1 message, 1 author, 2006-10-23
DORMANTno replies

[PATCH 4/5] netpoll: move drop hook inline

From: Stephen Hemminger <hidden>
Date: 2006-10-23 19:04:49
Also in: lkml

Rather than have separate drop callback hook, just put
the logic inline in netpoll.  The code is cleaner and netconsole
is the only user of netpoll.

Signed-off-by: Stephen Hemminger <redacted>
--- netpoll.orig/drivers/net/netconsole.c
+++ netpoll/drivers/net/netconsole.c
@@ -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;
 
--- netpoll.orig/include/linux/netpoll.h
+++ netpoll/include/linux/netpoll.h
@@ -18,7 +18,6 @@ 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];
--- netpoll.orig/net/core/netpoll.c
+++ netpoll/net/core/netpoll.c
@@ -91,13 +91,6 @@ static void queue_purge(struct net_devic
 	spin_unlock_irqrestore(&netpoll_txq.lock, flags);
 }
 
-void netpoll_queue(struct sk_buff *skb)
-{
-	skb_queue_tail(&netpoll_txq, skb);
-
-	schedule_work(&send_queue);
-}
-
 static int checksum_udp(struct sk_buff *skb, struct udphdr *uh,
 			     unsigned short ulen, u32 saddr, u32 daddr)
 {
@@ -282,10 +275,10 @@ static void netpoll_send_skb(struct netp
 		udelay(50);
 	} while (--tries > 0);
 
-	if (np->drop)
-		np->drop(skb);
-	else
-		__kfree_skb(skb);
+	/* if transmitter is busy, try send later. */
+	skb_queue_tail(&netpoll_txq, skb);
+
+	schedule_work(&send_queue);
 }
 
 void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
@@ -784,4 +777,3 @@ EXPORT_SYMBOL(netpoll_setup);
 EXPORT_SYMBOL(netpoll_cleanup);
 EXPORT_SYMBOL(netpoll_send_udp);
 EXPORT_SYMBOL(netpoll_poll);
-EXPORT_SYMBOL(netpoll_queue);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help