From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QowBteNDwG3dw7NP9FRkQ2prEQvwUY45W7Pma0+tImE=; b=K+WT3FO69byh3lIttBixtpTVWpltGZE/B+qtyoFg0A4k5R3vGZBsIaWNlp96geGaKO uxZ5D5fzMyKwxPA4NXh6BAW8z2ZUyCgKPlAlX9hyEL8nKNcsVlpjAHoyMNK+wZZd9V4b +oCHdPRLFGYlaAW0Ik3sLgJVaR2UQJZVHk9/uWVkqBVV70HIY1C9W2r1iRa5exgkBga8 zvn0OwN1eItq9IUHNIIcjgK0Um/5013LMpa2xjPcEx7dKXTUAmD3PoXlJ6iOq5/J5Yo2 nG2BA0zn0tS1ZTHBRS+PdaJEbcnvwO4Mpg6J28aE+yLoTO2uI/r08ClT1COSYNS2vETp CWbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QowBteNDwG3dw7NP9FRkQ2prEQvwUY45W7Pma0+tImE=; b=JonUoFcNwhjFx6RjOwczP6Lpg5qFcoMNnPpSEX0TDD9YYXWz7bowKNDM9HOuWYEML0 z016uKcjuNer2ozhIlmKQ+J+0Xo6z9yA4BcZf7ZOpWrGQqL6t12qC89EsPl7hnpRC1kO 9cUKPgBKOSxEx4fhE7mxK7jQUfVgz3lJtbORw4ePy8h3JHSpzVdLDbVmwg9U2AvEExoF W2zfcmhQhzqoBpzwjZmQSZeb3dXPDmgOEnnlvC2VhDwGkls2Jmhzc/1ZSdP2nRwH/FUe WfPX1ZUTiMxp+n+VukBUjp03VxKBh/HZ4Tva5t7iYbtHnkhQsXHcCPLf48IGGB6VVeZV OFjw== X-Gm-Message-State: AE9vXwMUgpAnu341Gpfw+ati4k1oYaJHW/gsoqwXeKBnQ/kfQ4I6QsLBqJYMX6abUgtMog== X-Received: by 10.98.139.220 with SMTP id e89mr57209300pfl.125.1474396584748; Tue, 20 Sep 2016 11:36:24 -0700 (PDT) Received: from xeon-e3 (static-50-53-69-251.bvtn.or.frontiernet.net. [50.53.69.251]) by smtp.gmail.com with ESMTPSA id i4sm27979448pav.27.2016.09.20.11.36.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Sep 2016 11:36:24 -0700 (PDT) Date: Tue, 20 Sep 2016 11:36:36 -0700 From: Stephen Hemminger To: Vladyslav Buslov Cc: , Message-ID: <20160920113636.38b2ed2a@xeon-e3> In-Reply-To: <20160920181637.26778-1-vladyslav.buslov@harmonicinc.com> 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 Subject: Re: [dpdk-dev] [PATCH] kni: add support for core_id param in single threaded mode 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: Tue, 20 Sep 2016 18:36:25 -0000 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.