From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id F085D5960 for ; Wed, 11 Feb 2015 02:54:09 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 10 Feb 2015 17:50:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,554,1418112000"; d="scan'208";a="676090299" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by fmsmga002.fm.intel.com with ESMTP; 10 Feb 2015 17:54:07 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 11 Feb 2015 09:54:05 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.161]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.46]) with mapi id 14.03.0195.001; Wed, 11 Feb 2015 09:54:04 +0800 From: "Zhang, Helin" To: "Richardson, Bruce" , Marc Sune Thread-Topic: [dpdk-dev] [PATCH] Adding RTE_KNI_PREEMPT configuration option Thread-Index: AQHQRSkPJ7QypXG7+kefMajZGtUUmpzpWUeAgAFWwZA= Date: Wed, 11 Feb 2015 01:54:03 +0000 Message-ID: References: <1415358037-424-1-git-send-email-marc.sune@bisdn.de> <54D9F2A1.2040102@bisdn.de> <20150210132411.GE18684@bricha3-MOBL3> In-Reply-To: <20150210132411.GE18684@bricha3-MOBL3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Wed, 11 Feb 2015 01:54:10 -0000 > -----Original Message----- > From: Richardson, Bruce > Sent: Tuesday, February 10, 2015 9:24 PM > To: Marc Sune > Cc: dev@dpdk.org; Zhang, Helin > Subject: Re: [dpdk-dev] [PATCH] Adding RTE_KNI_PREEMPT configuration > option >=20 > 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 > > > > 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 >=20 > Although a better option would be to have a runtime setting, this is stil= l an > improvement over what we have. >=20 > Acked-by: Bruce Richardson >=20 > > >--- > > > 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=3Dy > > > # Compile librte_kni > > > # > > > CONFIG_RTE_LIBRTE_KNI=3Dy > > >+CONFIG_RTE_KNI_PREEMPT=3Dy > > > CONFIG_RTE_KNI_KO_DEBUG=3Dn > > > CONFIG_RTE_KNI_VHOST=3Dn > > > CONFIG_RTE_KNI_VHOST_MAX_CACHE_SIZE=3D1024 > > >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; > > As Bruce indicated, it would be better to do that at runtime, we can add a config in struct rte_kni_conf, which will be copied to struct rte_kni_device_info, then kernel space will know the configuration. This way, we can enable/disable PREEMPT during KNI instance allocation time= . Anyway, it can be done now or later. Regards, Helin