From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail01.arraynetworks.com.cn (mail.arraynetworks.com.cn [124.42.99.121]) by dpdk.org (Postfix) with ESMTP id 95C6CC39A for ; Wed, 17 Jun 2015 07:43:36 +0200 (CEST) Received: from liuwfthinkpad (10.8.3.200) by mail01.arraynetworks.com.cn (10.3.0.251) with Microsoft SMTP Server id 14.3.123.3; Wed, 17 Jun 2015 13:43:32 +0800 From: Wenfeng Liu To: "'Zhang, Helin'" References: <1434341253-3227-1-git-send-email-liuwf@arraynetworks.com.cn> In-Reply-To: Date: Wed, 17 Jun 2015 13:43:31 +0800 Message-ID: <002401d0a8c0$8b871f60$a2955e20$@com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AQHQpyED7TxdXZ0E4EyEmKchsiCJ7J2wEOnwgAAfjWA= Content-Language: zh-cn X-Originating-IP: [10.8.3.200] Cc: dev@dpdk.org Subject: [dpdk-dev] =?gb2312?b?tPC4tDogW1BBVENIXSBrbmk6IFBhc3NpbmcgdGFz?= =?gb2312?b?a19waWRfdm5yKGN1cnJlbnQpIHRvIGdldF9uZXRfbnNfYnlfcGlk?= =?gb2312?b?KCkgaW4ga25pX2lvY3RsX2NyZWF0ZSgp?= 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: Wed, 17 Jun 2015 05:43:37 -0000 Hi Helin, Since I don=A1=AFt have any 2.6.33 machine on hand right now, I tried to = compile this patch on 2.6.32, and it succeed. I can't verify this modification in docker since it only support Linux kernel >=3D 3.10.=20 Thanks, liuwf -----=D3=CA=BC=FE=D4=AD=BC=FE----- =B7=A2=BC=FE=C8=CB: Zhang, Helin [mailto:helin.zhang@intel.com]=20 =B7=A2=CB=CD=CA=B1=BC=E4: 2015=C4=EA6=D4=C217=C8=D5 11:59 =CA=D5=BC=FE=C8=CB: Wenfeng Liu =B3=AD=CB=CD: dev@dpdk.org =D6=F7=CC=E2: RE: [PATCH] kni: Passing task_pid_vnr(current) to = get_net_ns_by_pid() in kni_ioctl_create() > -----Original Message----- > From: Wenfeng Liu [mailto:liuwf@arraynetworks.com.cn] > Sent: Monday, June 15, 2015 12:08 PM > To: Zhang, Helin; dev@dpdk.org > Subject: [PATCH] kni: Passing task_pid_vnr(current) to=20 > get_net_ns_by_pid() in > kni_ioctl_create() >=20 > In containers like docker, current->pid returns current process's=20 > global PID instead of its own PID under containers's PID namespace,=20 > and > get_net_ns_by_pid() suppose to accept a virtual PID under its own=20 > namespace, so we should use task_pid_vnr(current) to get current=20 > process's virtual PID instead of current->pid. >=20 > Signed-off-by: Wenfeng Liu > --- > lib/librte_eal/linuxapp/kni/kni_misc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c > b/lib/librte_eal/linuxapp/kni/kni_misc.c > index 1935d32..18fb677 100644 > --- a/lib/librte_eal/linuxapp/kni/kni_misc.c > +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c > @@ -359,7 +359,7 @@ kni_ioctl_create(unsigned int ioctl_num, unsigned=20 > long > ioctl_param) > return -EBUSY; > } >=20 > - net =3D get_net_ns_by_pid(current->pid); > + net =3D get_net_ns_by_pid(task_pid_vnr(current)); Have you tried it on a very old kernel versions? E.g. 2.6.33 Helin > if (IS_ERR(net)) { > free_netdev(net_dev); > return PTR_ERR(net); > -- > 1.8.3.1