DPDK patches and discussions
 help / color / mirror / Atom feed
From: Marc Sune <marc.sune@bisdn.de>
To: dev@dpdk.org
Subject: [dpdk-dev] [RFC PATCH] Adding RTE_KNI_PREEMPT configuration option
Date: Wed,  5 Nov 2014 01:17:22 +0100	[thread overview]
Message-ID: <1415146642-24717-1-git-send-email-marc.sune@bisdn.de> (raw)

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.

Note: this RFC patch is based on v1.7.1, since I was using a 1.7 application.
It will eventually be rebased to 1.8 upon acceptance.

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 9047975..9cebcf1 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -382,6 +382,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

             reply	other threads:[~2014-11-05  0:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05  0:17 Marc Sune [this message]
2014-11-06 18:20 ` Marc Sune
2014-11-06 19:39   ` [dpdk-dev] Cannot run l3fwd Eduard Gibert Renart
2014-11-06 20:57     ` Thomas Monjalon
2014-11-06 23:44     ` Ananyev, Konstantin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1415146642-24717-1-git-send-email-marc.sune@bisdn.de \
    --to=marc.sune@bisdn.de \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).