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 72888CE7 for ; Tue, 10 Feb 2015 13:21:58 +0100 (CET) Received: from [172.16.251.227] (unknown [172.16.251.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx.bisdn.de (Postfix) with ESMTPSA id E41CFA34E1; Tue, 10 Feb 2015 13:21:57 +0100 (CET) Message-ID: <54D9F7E3.2060504@bisdn.de> Date: Tue, 10 Feb 2015 13:21:55 +0100 From: Marc Sune User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-Version: 1.0 To: Bruce Richardson References: <1415358037-424-1-git-send-email-marc.sune@bisdn.de> <54D9F2A1.2040102@bisdn.de> <20150210120230.GC18684@bricha3-MOBL3> In-Reply-To: <20150210120230.GC18684@bricha3-MOBL3> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] Adding RTE_KNI_PREEMPT 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: Tue, 10 Feb 2015 12:21:58 -0000 On 10/02/15 13:02, Bruce Richardson wrote: > On Tue, Feb 10, 2015 at 12:59:29PM +0100, Marc Sune wrote: >> This patch of Nov 2014 hasn't been yet ACKed/NACKed. Could someone please >> give some quick feedback? >> >> Thanks >> marc >> > Idea is good, any chance it could be added as a run-time rather than > compile-time option? It is also an option. I wasn't really thinking someone would want to change this behaviour at runtime. If we think it is worth, I can have a closer look on it. Any other opinions on this? If we would go for a runtime flag, we would either have to add a config parameter to rte_kni_init() or add a specific call to turn on/off this knob, depending on whether it is sufficient to change this behaviour at bootstrapping time, or we want to also change it during 'operation'. In either case we would require some communication, probably via ioctl(), from user-space to kernel space. Thanks Marc > > /Bruce > >> On 07/11/14 12:00, Marc Sune wrote: >>> 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 >>> --- >>> 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;