From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by dpdk.org (Postfix) with ESMTP id 1B8CA592C for ; Wed, 26 Nov 2014 22:26:49 +0100 (CET) Received: by mail-wi0-f173.google.com with SMTP id r20so13851627wiv.12 for ; Wed, 26 Nov 2014 13:26:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=02RFc+IVcFHimmWV+DvNe+C/RDWrfZR+Nf7jxXBbq8M=; b=d6CCvraR6GAwxaEEHqDUyO5oG/9BLgsIZ3vY/1PLKQ2NGUCTt7qGIeNuZnU5K2uQ5s 8mAeMwEdAwB3PZIqPaH6XTLZ4XB7xLtNXqblApt4Nz8pjNTRndA0HStBHNm6rUxHB+SH VhEsQ7xvdosGMkp3AWsDs3YQAb46Ow03RrVkKnJsnv1twW1o+D/PX6b3p6IHqN5E6iNq u7Tf0BmF1kWJgtaC5qXQT1lmNCqDZWE/KJZf3lC74PfgsukUbGR1smlvLQ1HLaWxV7Sp 2MocQKi3Wc4eOUvER20LIhmSMXWQxliehx1dYs60OIzurFawglt1eu9fSYPPrRBOQCIN K/1w== X-Gm-Message-State: ALoCoQkJemyZ7dSmyymqc/pQXb11oPVysBQbxtjmWtn5jcd94rIq5FJH2Th/UXWsSiBedX5plqTD X-Received: by 10.180.72.33 with SMTP id a1mr44278823wiv.18.1417037208927; Wed, 26 Nov 2014 13:26:48 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id fg2sm3044299wib.2.2014.11.26.13.26.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Nov 2014 13:26:48 -0800 (PST) From: Thomas Monjalon To: dev@dpdk.org Date: Wed, 26 Nov 2014 22:26:26 +0100 Message-ID: <4920841.6YLj9k6iQh@xps13> Organization: 6WIND User-Agent: KMail/4.14.2 (Linux/3.17.2-1-ARCH; KDE/4.14.2; x86_64; ; ) In-Reply-To: <1416539426-20684-1-git-send-email-takayuki@midokura.com> References: <1416539426-20684-1-git-send-email-takayuki@midokura.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] kni: create KNI interface in current network namespace 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, 26 Nov 2014 21:26:49 -0000 Anyone to review this KNI patch? 2014-11-21 12:10, Takayuki Usui: > With this patch, KNI interface (e.g. vEth0) is created in the > network namespace where the DPDK application is running. > Otherwise, all interfaces are created in the default namespace > in the host. > > Signed-off-by: Takayuki Usui > --- > lib/librte_eal/linuxapp/kni/kni_misc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c > index ba77776..f4a9965 100644 > --- a/lib/librte_eal/linuxapp/kni/kni_misc.c > +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c > @@ -354,6 +354,8 @@ kni_ioctl_create(unsigned int ioctl_num, unsigned long ioctl_param) > return -EBUSY; > } > > + dev_net_set(net_dev, get_net_ns_by_pid(current->pid)); > + > kni = netdev_priv(net_dev); > > kni->net_dev = net_dev;