kni: Passing virtual PID to get_net_ns_by_pid(), so we can create kni interfaces in containers like docker
PATCH 1/1 kni: Passing virtual PID to get_net_ns_by_pid(), so we can create kni interfaces in containers like docker
Signed-off-by Wenfeng Liu <[email protected]>
--- lib/librte_eal/linuxapp/kni/kni_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/linuxapp/kni/kni_misc.c +1 -1
@@ -359,7 +359,7 @@ kni_ioctl_create(unsigned int ioctl_num, unsigned long ioctl_param)return -EBUSY ; } - net =get_net_ns_by_pid (current->pid); + net =get_net_ns_by_pid (task_pid_vnr (current));if (IS_ERR (net)) {free_netdev (net_dev);return PTR_ERR (net);
Signature · 1 line
1.8.3.1
Hi Wenfeng
It would be better to describe why 'current->pid' cannot, while 'task_pid_vnr(current)' can be used in containers.
In addition, the title should be brief, and there should be a commit log for the detailed description.
Thanks,
Helin
Quoted 29 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wenfeng Liu
Sent: Monday, June 1, 2015 1:43 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH] kni: Passing virtual PID toget_net_ns_by_pid(), so we can create kni interfaces in containers like dockerSigned-off-by Wenfeng Liu <[email protected]>--- lib/librte_eal/linuxapp/kni/kni_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/librte_eal/linuxapp/kni/kni_misc.c +1
-1@@ -359,7 +359,7 @@ kni_ioctl_create(unsigned int ioctl_num, unsigned long ioctl_param)return -EBUSY ; } - net =get_net_ns_by_pid (current->pid); + net =get_net_ns_by_pid (task_pid_vnr (current));if (IS_ERR (net)) {free_netdev (net_dev);return
PTR_ERR(net);
--
1.8.3.1