Message ID | 1415146642-24717-1-git-send-email-marc.sune@bisdn.de (mailing list archive) |
---|---|
State | RFC, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id A06A25944; Wed, 5 Nov 2014 01:08:17 +0100 (CET) Received: from mx.bisdn.de (mx.bisdn.de [185.27.182.31]) by dpdk.org (Postfix) with ESMTP id 145AC2E89 for <dev@dpdk.org>; Wed, 5 Nov 2014 01:08:13 +0100 (CET) Received: from localhost.localdomain (unknown [172.16.251.36]) by mx.bisdn.de (Postfix) with ESMTP id 3FB40A2D77; Wed, 5 Nov 2014 01:17:32 +0100 (CET) From: Marc Sune <marc.sune@bisdn.de> To: dev@dpdk.org Date: Wed, 5 Nov 2014 01:17:22 +0100 Message-Id: <1415146642-24717-1-git-send-email-marc.sune@bisdn.de> X-Mailer: git-send-email 1.7.10.4 Subject: [dpdk-dev] [RFC 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 <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Marc Sune
Nov. 5, 2014, 12:17 a.m. UTC
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(+)
Comments
Hi guys, Any comment, suggestion or objection to this patch? Otherwise I would send a non-RFC patch Thanks Marc On 05/11/14 01:17, 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. > > 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;
Hi Everyone: When I try to run l3fwd inside my VM I get the following error: ubuntu@ubuntu-VirtualBox:~/Desktop/dpdk-1.7.1/examples/l3fwd/build$ sudo ./l3fwd -c 0x3 -n 2 -- -p 0x3 --config="(0,0,0),(1,0,1)" EAL: Cannot read numa node link for lcore 0 - using physical package id instead EAL: Detected lcore 0 as core 0 on socket 0 EAL: Cannot read numa node link for lcore 1 - using physical package id instead EAL: Detected lcore 1 as core 1 on socket 0 EAL: Support maximum 64 logical core(s) by configuration. EAL: Detected 2 lcore(s) EAL: Setting up memory... EAL: cannot open /proc/self/numa_maps, consider that all memory is in socket_id 0 EAL: Ask a virtual area of 0x400000 bytes EAL: Virtual area found at 0xb6400000 (size = 0x400000) EAL: Ask a virtual area of 0x200000 bytes EAL: Virtual area found at 0xb6000000 (size = 0x200000) EAL: Ask a virtual area of 0xf000000 bytes EAL: Virtual area found at 0xa6e00000 (size = 0xf000000) EAL: Ask a virtual area of 0x1e200000 bytes EAL: Virtual area found at 0x88a00000 (size = 0x1e200000) EAL: Ask a virtual area of 0x200000 bytes EAL: Virtual area found at 0x88600000 (size = 0x200000) EAL: Ask a virtual area of 0x200000 bytes EAL: Virtual area found at 0x88200000 (size = 0x200000) EAL: Ask a virtual area of 0x200000 bytes EAL: Virtual area found at 0x87e00000 (size = 0x200000) EAL: Ask a virtual area of 0x200000 bytes EAL: Virtual area found at 0x87a00000 (size = 0x200000) EAL: Ask a virtual area of 0xe400000 bytes EAL: Virtual area found at 0x79400000 (size = 0xe400000) EAL: Ask a virtual area of 0x2200000 bytes EAL: Virtual area found at 0x77000000 (size = 0x2200000) EAL: Ask a virtual area of 0xc00000 bytes EAL: Virtual area found at 0x76200000 (size = 0xc00000) EAL: Ask a virtual area of 0xe00000 bytes EAL: Virtual area found at 0x75200000 (size = 0xe00000) EAL: Requesting 512 pages of size 2MB from socket 0 EAL: TSC frequency is ~2503668 KHz EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable clock cycles ! EAL: Master core 0 is ready (tid=b75c2800) EAL: Core 1 is ready (tid=751ffb40) EAL: PCI device 0000:00:03.0 on NUMA socket -1 EAL: probe driver: 8086:100e rte_em_pmd EAL: 0000:00:03.0 not managed by UIO driver, skipping EAL: PCI device 0000:00:08.0 on NUMA socket -1 EAL: probe driver: 8086:100e rte_em_pmd EAL: PCI memory mapped at 0xb7572000 EAL: PCI device 0000:00:09.0 on NUMA socket -1 EAL: probe driver: 8086:100e rte_em_pmd EAL: PCI memory mapped at 0xb7552000 EAL: PCI device 0000:00:03.0 on NUMA socket -1 EAL: probe driver: 8086:100e rte_em_pmd EAL: 0000:00:03.0 not managed by UIO driver, skipping Initializing port 0 ... Creating queues: nb_rxq=1 nb_txq=2... EAL: Error - exiting with code: 1 Cause: Cannot configure device: err=-22, port=0 Any ideas on what is causing the error? Thanks, Eduard Gibert Renart
Hi, You replied to an email which is absolutely not related to your question, polluting the thread. Don't take me wrong: I don't want you to re-post your question in a new thread. You have the source code of DPDK and you didn't check where the error is, not enabled the debug logs. So, it's clearly too early to post in this mailing-list. 2014-11-06 14:39, Eduard Gibert Renart: > Initializing port 0 ... Creating queues: nb_rxq=1 nb_txq=2... EAL: Error - exiting with code: 1 > Cause: Cannot configure device: err=-22, port=0 Maybe you didn't find the debug options. Please check in config files and rebuild.
> -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Eduard Gibert Renart > Sent: Thursday, November 06, 2014 7:40 PM > To: <dev@dpdk.org> > Subject: [dpdk-dev] Cannot run l3fwd > > Hi Everyone: > > When I try to run l3fwd inside my VM I get the following error: > > ubuntu@ubuntu-VirtualBox:~/Desktop/dpdk-1.7.1/examples/l3fwd/build$ sudo ./l3fwd -c 0x3 -n 2 -- -p 0x3 --config="(0,0,0),(1,0,1)" > EAL: Cannot read numa node link for lcore 0 - using physical package id instead > EAL: Detected lcore 0 as core 0 on socket 0 > EAL: Cannot read numa node link for lcore 1 - using physical package id instead > EAL: Detected lcore 1 as core 1 on socket 0 > EAL: Support maximum 64 logical core(s) by configuration. > EAL: Detected 2 lcore(s) > EAL: Setting up memory... > EAL: cannot open /proc/self/numa_maps, consider that all memory is in socket_id 0 > EAL: Ask a virtual area of 0x400000 bytes > EAL: Virtual area found at 0xb6400000 (size = 0x400000) > EAL: Ask a virtual area of 0x200000 bytes > EAL: Virtual area found at 0xb6000000 (size = 0x200000) > EAL: Ask a virtual area of 0xf000000 bytes > EAL: Virtual area found at 0xa6e00000 (size = 0xf000000) > EAL: Ask a virtual area of 0x1e200000 bytes > EAL: Virtual area found at 0x88a00000 (size = 0x1e200000) > EAL: Ask a virtual area of 0x200000 bytes > EAL: Virtual area found at 0x88600000 (size = 0x200000) > EAL: Ask a virtual area of 0x200000 bytes > EAL: Virtual area found at 0x88200000 (size = 0x200000) > EAL: Ask a virtual area of 0x200000 bytes > EAL: Virtual area found at 0x87e00000 (size = 0x200000) > EAL: Ask a virtual area of 0x200000 bytes > EAL: Virtual area found at 0x87a00000 (size = 0x200000) > EAL: Ask a virtual area of 0xe400000 bytes > EAL: Virtual area found at 0x79400000 (size = 0xe400000) > EAL: Ask a virtual area of 0x2200000 bytes > EAL: Virtual area found at 0x77000000 (size = 0x2200000) > EAL: Ask a virtual area of 0xc00000 bytes > EAL: Virtual area found at 0x76200000 (size = 0xc00000) > EAL: Ask a virtual area of 0xe00000 bytes > EAL: Virtual area found at 0x75200000 (size = 0xe00000) > EAL: Requesting 512 pages of size 2MB from socket 0 > EAL: TSC frequency is ~2503668 KHz > EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable clock cycles ! > EAL: Master core 0 is ready (tid=b75c2800) > EAL: Core 1 is ready (tid=751ffb40) > EAL: PCI device 0000:00:03.0 on NUMA socket -1 > EAL: probe driver: 8086:100e rte_em_pmd > EAL: 0000:00:03.0 not managed by UIO driver, skipping > EAL: PCI device 0000:00:08.0 on NUMA socket -1 > EAL: probe driver: 8086:100e rte_em_pmd > EAL: PCI memory mapped at 0xb7572000 > EAL: PCI device 0000:00:09.0 on NUMA socket -1 > EAL: probe driver: 8086:100e rte_em_pmd > EAL: PCI memory mapped at 0xb7552000 > EAL: PCI device 0000:00:03.0 on NUMA socket -1 > EAL: probe driver: 8086:100e rte_em_pmd > EAL: 0000:00:03.0 not managed by UIO driver, skipping > Initializing port 0 ... Creating queues: nb_rxq=1 nb_txq=2... EAL: Error - exiting with code: 1 > Cause: Cannot configure device: err=-22, port=0 > > Any ideas on what is causing the error? As I can see from your log: You are using emulated e1000 device. Only 1 RX and 1 TX queue per NIC are supported for that type of device. From other side l3fwd uses a separate TX queue per NIC for each logical core. In your case - 2 lcores, so 2 TX queues for each device are requested. Try to start with just one lcore ('-c 1' or '-c 2') - I think that should help. Konstantin > > Thanks, > Eduard Gibert Renart
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;