DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] KNI latency improvement
@ 2017-12-29 14:27 Nirmoy Das
  2017-12-29 17:13 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Nirmoy Das @ 2017-12-29 14:27 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev

Hi Ferruh,

There is latency in the range of milliseconds when packets are passed
through KNI up to the IP stack. With CONFIG_RTE_KNI_PREEMPT_DEFAULT=n
its required sacrifice a cpu core. Do you have any suggestion to improve
latency without sacrificing a cpu?

What do you think about using cond_resched() instead of
schedule_timeout_interruptible(), in our test it helped to reduce
latency?

Index: dpdk-stable-16.11.1/lib/librte_eal/linuxapp/kni/kni_misc.c
===================================================================
--- dpdk/lib/librte_eal/linuxapp/kni/kni_misc.c
+++ dpdk/lib/librte_eal/linuxapp/kni/kni_misc.c
@@ -150,9 +150,8 @@ kni_thread_single(void *data)
 		}
 		up_read(&knet->kni_list_lock);
 #ifdef RTE_KNI_PREEMPT_DEFAULT
-		/* reschedule out for a while */
-		schedule_timeout_interruptible(
-			usecs_to_jiffies(KNI_KTHREAD_RESCHEDULE_INTERVAL));
+		/* reschedule out */
+		cond_resched();
 #endif
 	}


Regards,
Nirmoy
-- 
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB
21284 (AG Nürnberg) Maxfeldstr. 5
D-90409 Nürnberg / Phone: +49-911-740 18-4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] KNI latency improvement
  2017-12-29 14:27 [dpdk-dev] KNI latency improvement Nirmoy Das
@ 2017-12-29 17:13 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2017-12-29 17:13 UTC (permalink / raw)
  To: Nirmoy Das; +Cc: ferruh.yigit, dev

On Fri, 29 Dec 2017 15:27:03 +0100
Nirmoy Das <ndas@suse.de> wrote:

> Hi Ferruh,
> 
> There is latency in the range of milliseconds when packets are passed
> through KNI up to the IP stack. With CONFIG_RTE_KNI_PREEMPT_DEFAULT=n
> its required sacrifice a cpu core. Do you have any suggestion to improve
> latency without sacrificing a cpu?
> 
> What do you think about using cond_resched() instead of
> schedule_timeout_interruptible(), in our test it helped to reduce
> latency?
> 

That fully consumes a CPU  core when doing KNI.
It would be better to figure out how to use a a NAPI style
API for this.  I.e keep processing packet until idle,
then poll for a small window more, then if still idle
wait in kernel to be kicked by syscall from user space.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-29 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-29 14:27 [dpdk-dev] KNI latency improvement Nirmoy Das
2017-12-29 17:13 ` Stephen Hemminger

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).