From da9cc0b9df1f9a6caa9ce19e743e9aae8cd858cb Mon Sep 17 00:00:00 2001 From: Jay Rolette Date: Wed, 3 Jun 2015 14:18:55 -0500 Subject: [PATCH] kni: optimize single thread loop Do not need the 'safe' version of list_for_each_entry() if you are not deleting from the list as you iterate over it. Signed-off-by: Jay Rolette Acked-by: Bruce Richardson Acked-by: Helin Zhang --- lib/librte_eal/linuxapp/kni/kni_misc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c index 2c411e299f..912a8f1804 100644 --- a/lib/librte_eal/linuxapp/kni/kni_misc.c +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c @@ -213,13 +213,12 @@ static int kni_thread_single(void *unused) { int j; - struct kni_dev *dev, *n; + struct kni_dev *dev; while (!kthread_should_stop()) { down_read(&kni_list_lock); for (j = 0; j < KNI_RX_LOOP_NUM; j++) { - list_for_each_entry_safe(dev, n, - &kni_list_head, list) { + list_for_each_entry(dev, &kni_list_head, list) { #ifdef RTE_KNI_VHOST kni_chk_vhost_rx(dev); #else -- 2.20.1