From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1F4F0C2FC for ; Mon, 15 Jun 2015 03:09:02 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 14 Jun 2015 18:08:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,615,1427785200"; d="scan'208";a="710906915" Received: from pgsmsx108.gar.corp.intel.com ([10.221.44.103]) by orsmga001.jf.intel.com with ESMTP; 14 Jun 2015 18:08:49 -0700 Received: from kmsmsx154.gar.corp.intel.com (172.21.73.14) by PGSMSX108.gar.corp.intel.com (10.221.44.103) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 15 Jun 2015 09:08:48 +0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by KMSMSX154.gar.corp.intel.com (172.21.73.14) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 15 Jun 2015 09:08:47 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.129]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.246]) with mapi id 14.03.0224.002; Mon, 15 Jun 2015 09:08:46 +0800 From: "Zhang, Helin" To: Marc Sune , "thomas.monjalon@6wind.com" Thread-Topic: [dpdk-dev] [PATCH] kni: ignore double calls to rte_kni_init() Thread-Index: AQHQnAKO9jRqqkM0pkqiwJq5YHXB3J2s12LA Date: Mon, 15 Jun 2015 01:08:46 +0000 Message-ID: References: <1433118752-14600-1-git-send-email-marc.sune@bisdn.de> In-Reply-To: <1433118752-14600-1-git-send-email-marc.sune@bisdn.de> 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] 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, 15 Jun 2015 01:09:03 -0000 Hi Marc > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Marc Sune > Sent: Monday, June 1, 2015 8:33 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] kni: ignore double calls to rte_kni_init() >=20 > Prevent double initialization of the KNI subsytem. >=20 > Signed-off-by: Marc Sune > --- > lib/librte_kni/rte_kni.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > 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]; >=20 > + /* Immediately return if KNI is already initialized */ > + if (kni_memzone_pool.initialized) > + return; I'd prefer to have a debug log before returning out, as there is no error c= ode for it. Thanks, Helin > + > if (max_kni_ifaces =3D=3D 0) { > RTE_LOG(ERR, KNI, "Invalid number of max_kni_ifaces %d\n", > max_kni_ifaces); > -- > 2.1.4