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 BD4FD12A8 for ; Mon, 1 Jun 2015 02:32:53 +0200 (CEST) Received: from localhost.localdomain (f052159249.adsl.alicedsl.de [78.52.159.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mx.bisdn.de (Postfix) with ESMTPSA id 386CFA2F87; Mon, 1 Jun 2015 02:32:53 +0200 (CEST) From: Marc Sune To: dev@dpdk.org Date: Mon, 1 Jun 2015 02:32:32 +0200 Message-Id: <1433118752-14600-1-git-send-email-marc.sune@bisdn.de> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] kni: ignore double calls to rte_kni_init() 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: Mon, 01 Jun 2015 00:32:54 -0000 Prevent double initialization of the KNI subsytem. Signed-off-by: Marc Sune --- lib/librte_kni/rte_kni.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index c5a0089..df0449f 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -201,6 +201,10 @@ rte_kni_init(unsigned int max_kni_ifaces) char obj_name[OBJNAMSIZ]; char mz_name[RTE_MEMZONE_NAMESIZE]; + /* Immediately return if KNI is already initialized */ + if (kni_memzone_pool.initialized) + return; + if (max_kni_ifaces == 0) { RTE_LOG(ERR, KNI, "Invalid number of max_kni_ifaces %d\n", max_kni_ifaces); -- 2.1.4