[dpdk-dev] [PATCH] kni: add support for core_id param in single threaded mode

Stephen Hemminger stephen at networkplumber.org
Tue Sep 20 20:36:36 CEST 2016


On Tue, 20 Sep 2016 21:16:37 +0300
Vladyslav Buslov <vladyslav.buslov at harmonicinc.com> 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.


More information about the dev mailing list