From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] kni: add support for core_id param in single threaded mode Date: Tue, 20 Sep 2016 11:36:36 -0700 Message-ID: <20160920113636.38b2ed2a@xeon-e3> References: <20160910135016.6468-2-vladyslav.buslov@harmonicinc.com> <20160920181637.26778-1-vladyslav.buslov@harmonicinc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: , To: Vladyslav Buslov Return-path: Received: from mail-pf0-f177.google.com (mail-pf0-f177.google.com [209.85.192.177]) by dpdk.org (Postfix) with ESMTP id 6574B374F for ; Tue, 20 Sep 2016 20:36:25 +0200 (CEST) Received: by mail-pf0-f177.google.com with SMTP id q2so9991694pfj.3 for ; Tue, 20 Sep 2016 11:36:25 -0700 (PDT) In-Reply-To: <20160920181637.26778-1-vladyslav.buslov@harmonicinc.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, 20 Sep 2016 21:16:37 +0300 Vladyslav Buslov wrote: > @@ -123,6 +125,9 @@ static int __net_init kni_init_net(struct net *net) > /* Clear the bit of device in use */ > clear_bit(KNI_DEV_IN_USE_BIT_NUM, &knet->device_in_use); > > + mutex_init(&knet->kni_kthread_lock); > + knet->kni_kthread = NULL; > + Why not just use kzalloc() here? You would still need to init the mutex etc, but it would be safer.