DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] Adding RTE_KNI_PREEMPT configuration option
@ 2014-11-07 11:00 Marc Sune
  2015-02-10 11:59 ` Marc Sune
  0 siblings, 1 reply; 11+ messages in thread
From: Marc Sune @ 2014-11-07 11:00 UTC (permalink / raw)
  To: dev

This patch introduces CONFIG_RTE_KNI_PREEMPT flag. When set to 'no', KNI
kernel thread(s) do not call schedule_timeout_interruptible(), which improves
overall KNI performance at the expense of CPU cycles (polling).

Default values is 'yes', maintaining the same behaviour as of now.

Signed-off-by: Marc Sune <marc.sune@bisdn.de>
---
 config/common_linuxapp                 |    1 +
 lib/librte_eal/linuxapp/kni/kni_misc.c |    4 ++++
 2 files changed, 5 insertions(+)

diff --git a/config/common_linuxapp b/config/common_linuxapp
index 57b61c9..24b529d 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -380,6 +380,7 @@ CONFIG_RTE_LIBRTE_PIPELINE=y
 # Compile librte_kni
 #
 CONFIG_RTE_LIBRTE_KNI=y
+CONFIG_RTE_KNI_PREEMPT=y
 CONFIG_RTE_KNI_KO_DEBUG=n
 CONFIG_RTE_KNI_VHOST=n
 CONFIG_RTE_KNI_VHOST_MAX_CACHE_SIZE=1024
diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c
index ba77776..e7e6c27 100644
--- a/lib/librte_eal/linuxapp/kni/kni_misc.c
+++ b/lib/librte_eal/linuxapp/kni/kni_misc.c
@@ -229,9 +229,11 @@ kni_thread_single(void *unused)
 			}
 		}
 		up_read(&kni_list_lock);
+#ifdef RTE_KNI_PREEMPT
 		/* reschedule out for a while */
 		schedule_timeout_interruptible(usecs_to_jiffies( \
 				KNI_KTHREAD_RESCHEDULE_INTERVAL));
+#endif
 	}
 
 	return 0;
@@ -252,8 +254,10 @@ kni_thread_multiple(void *param)
 #endif
 			kni_net_poll_resp(dev);
 		}
+#ifdef RTE_KNI_PREEMPT
 		schedule_timeout_interruptible(usecs_to_jiffies( \
 				KNI_KTHREAD_RESCHEDULE_INTERVAL));
+#endif
 	}
 
 	return 0;
-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-02-12  9:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-07 11:00 [dpdk-dev] [PATCH] Adding RTE_KNI_PREEMPT configuration option Marc Sune
2015-02-10 11:59 ` Marc Sune
2015-02-10 12:02   ` Bruce Richardson
2015-02-10 12:21     ` Marc Sune
2015-02-10 13:22       ` Bruce Richardson
2015-02-10 18:06         ` Marc Sune
2015-02-10 13:24   ` Bruce Richardson
2015-02-11  1:54     ` Zhang, Helin
2015-02-11 12:26       ` Marc Sune
2015-02-11 14:27         ` Bruce Richardson
2015-02-12  9:25           ` Marc Sune

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).