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 B6E572A07 for ; Thu, 28 May 2015 11:12:17 +0200 (CEST) Received: from localhost.localdomain (unknown [172.16.250.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mx.bisdn.de (Postfix) with ESMTPSA id 7BCE7A23F3; Thu, 28 May 2015 11:12:17 +0200 (CEST) From: Marc Sune To: dev@dpdk.org Date: Thu, 28 May 2015 11:12:14 +0200 Message-Id: <1432804334-1981-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: Thu, 28 May 2015 09:12:18 -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