From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by dpdk.org (Postfix) with ESMTP id A3C937F0C for ; Fri, 21 Nov 2014 04:00:02 +0100 (CET) Received: by mail-pa0-f45.google.com with SMTP id lj1so3896041pab.32 for ; Thu, 20 Nov 2014 19:10:34 -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:subject:date:message-id; bh=98biOOZhHfUtecsnOXpoAZ6CpajnfAevEg61TfmrYe4=; b=X9hWFmiT5OdJS1mD/pKb7t1KgUjZ8rOZWAvRvnR2iOLaFjhT9n3d+Hq7fizJDltZqk yWzeFJFMKxjuO149kEDLriQOoo6SjN2LPDh1rsM7LQO2420zwQiTp7JyvEMhxAi1XShN IgSGqEO5vYr9iT5LbgasX7G8MYkyJj6Ja6lsr1ymfPyfJ8i8qaQXTdCcVOXP8FW8O9DQ gwgNV1kskHy9sPe/HVMD66iF/QcFuYyg1LaS6dydywcFtsjxE8EISZuE63f1iW4iSkur HKLGliBRXfy5dWtJqGqNTzsROcYgnJ8vZs/R9IXs9RGDtablMRrKeNU23W2gfB3HJt7c O2GQ== X-Gm-Message-State: ALoCoQmaNz1mfrbOA29Pdy8qx69H2Y4q09StygjK7qXbQktNrmBKO+2jlmvBMM1uSWH8ejkThgNH X-Received: by 10.68.111.161 with SMTP id ij1mr3045306pbb.10.1416539433483; Thu, 20 Nov 2014 19:10:33 -0800 (PST) Received: from orifice.localdomain ([240b:10:25c0:200:178:126:4037:f352]) by mx.google.com with ESMTPSA id kj9sm3290431pbc.37.2014.11.20.19.10.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Nov 2014 19:10:33 -0800 (PST) From: Takayuki Usui To: dev@dpdk.org Date: Fri, 21 Nov 2014 12:10:26 +0900 Message-Id: <1416539426-20684-1-git-send-email-takayuki@midokura.com> X-Mailer: git-send-email 2.1.3 Subject: [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: Fri, 21 Nov 2014 03:00:03 -0000 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; -- 2.1.3