[Ns-developers] patch for ns-3-linux

Hajime Tazaki tazaki at sfc.wide.ad.jp
Thu Aug 19 09:54:10 PDT 2010


Hi Mathieu,

Below is the patch for ns-3-linux.
I'm currently trying to work with UMIP (MIP6/NEMO daemon for
linux) with ns-3-linux.

the patch prevents double-queuing to workqueue. it is
occurred by workqueue in net/xfrm/xfrm_policy.c .

UMIP almost works fine with several fixes into ns-3-linux,
although it includes a bunch of my quick hacks such as
poll/select.

my current patchqueue is available at
http://www.sfc.wide.ad.jp/~tazaki/hg/ns-3-linux-patches/

regards,
hajime

diff -r 781cad83d36c sim/workqueue.c
--- a/sim/workqueue.c   Thu Aug 12 16:12:16 2010 +0200
+++ b/sim/workqueue.c   Wed Aug 18 01:25:11 2010 +0900
@@ -79,8 +79,11 @@
 
 int schedule_work(struct work_struct *work)
 {
-  list_add_tail(&work->entry, &g_work);
-  sim_task_wakeup (workqueue_task ());
+  if (!test_and_set_bit(WORK_STRUCT_PENDING, work_data_bits(work)))
+    {
+      list_add_tail(&work->entry, &g_work);
+      sim_task_wakeup (workqueue_task ());
+    }
   return 0;
 }
 void flush_scheduled_work(void)




More information about the Ns-developers mailing list