summaryrefslogtreecommitdiff
path: root/libmachdev/net.c
diff options
context:
space:
mode:
authorZheng Da <zhengda1936@gmail.com>2010-02-08 08:58:53 +0100
committerZheng Da <zhengda1936@gmail.com>2010-02-08 08:58:53 +0100
commit5ea9105dff5f22606026afcd88b178110282b224 (patch)
tree7e42a5240018310fca4e805a4df95a01c44c75e2 /libmachdev/net.c
parentaff295710ea0b575c556f10981d1ae740e192969 (diff)
remove io done thread.
eliminate a potential race condition in thread_wait and thread_wakeup.
Diffstat (limited to 'libmachdev/net.c')
-rw-r--r--libmachdev/net.c35
1 files changed, 6 insertions, 29 deletions
diff --git a/libmachdev/net.c b/libmachdev/net.c
index d80e86ff..9a367a6b 100644
--- a/libmachdev/net.c
+++ b/libmachdev/net.c
@@ -161,32 +161,6 @@ struct net_data *search_nd (struct net_device *dev)
/* Linux kernel network support routines. */
-/* Free all sk_buffs on the done list.
- This routine is called by the iodone thread in ds_routines.c. */
-void
-free_skbuffs ()
-{
- struct sk_buff *skb;
-
- while (1)
- {
- skb = skb_done_dequeue ();
- if (skb)
- {
- struct skb_reply *reply = skb_reply(skb);
- if (MACH_PORT_VALID (reply->reply))
- {
- ds_device_write_reply (reply->reply, reply->reply_type,
- 0, reply->pkglen);
- reply->reply = MACH_PORT_NULL;
- }
- kfree_skb (skb);
- }
- else
- break;
- }
-}
-
/* actions before freeing the sk_buff SKB.
* If it returns 1, the packet will be deallocated later. */
int
@@ -200,9 +174,12 @@ pre_kfree_skb (struct sk_buff *skb, void *data)
Wakeup the iodone thread to process the list. */
if (reply && MACH_PORT_VALID (reply->reply))
{
- skb_done_queue (skb);
- wakeup_io_done_thread ();
- return 1;
+ if (MACH_PORT_VALID (reply->reply))
+ {
+ ds_device_write_reply (reply->reply, reply->reply_type,
+ 0, reply->pkglen);
+ reply->reply = MACH_PORT_NULL;
+ }
}
/* deallocate skb_reply before freeing the packet. */
free (data);