From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx.bisdn.de (mx.bisdn.de [185.27.182.31]) by dpdk.org (Postfix) with ESMTP id 7EF70B466 for ; Fri, 13 Feb 2015 15:25:29 +0100 (CET) Received: from localhost.localdomain (unknown [172.16.250.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mx.bisdn.de (Postfix) with ESMTPSA id 0528AA3163; Fri, 13 Feb 2015 15:25:29 +0100 (CET) From: Marc Sune To: dev@dpdk.org Date: Fri, 13 Feb 2015 15:25:25 +0100 Message-Id: <1423837525-22283-1-git-send-email-marc.sune@bisdn.de> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH v2] Adding RTE_KNI_PREEMPT_DEFAULT configuration option X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2015 14:25:29 -0000 This patch introduces CONFIG_RTE_KNI_PREEMPT_DEFAULT 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. v2: CONFIG_RTE_KNI_PREEMPT -> CONFIG_RTE_KNI_PREEMPT_DEFAULT Signed-off-by: Marc Sune --- 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 d428f84..72ba6ab 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -359,6 +359,7 @@ CONFIG_RTE_LIBRTE_PIPELINE=y # Compile librte_kni # CONFIG_RTE_LIBRTE_KNI=y +CONFIG_RTE_KNI_PREEMPT_DEFAULT=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 868b325..1935d32 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_DEFAULT /* 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_DEFAULT schedule_timeout_interruptible(usecs_to_jiffies( \ KNI_KTHREAD_RESCHEDULE_INTERVAL)); +#endif } return 0; -- 2.1.4