All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kni: create KNI interface in current network namespace
@ 2014-11-21  3:10 Takayuki Usui
       [not found] ` <1416539426-20684-1-git-send-email-takayuki-SN072n759w5Wk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Takayuki Usui @ 2014-11-21  3:10 UTC (permalink / raw)
  To: dev-VfR2kkLFssw

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 <takayuki-SN072n759w5Wk0Htik3J/w@public.gmane.org>
---
 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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-12-03 14:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-21  3:10 [PATCH] kni: create KNI interface in current network namespace Takayuki Usui
     [not found] ` <1416539426-20684-1-git-send-email-takayuki-SN072n759w5Wk0Htik3J/w@public.gmane.org>
2014-11-26 21:26   ` Thomas Monjalon
2014-12-01  5:45     ` Hemant-KZfg59tc24xl57MIdRCFDg
     [not found]       ` <BY2PR0301MB0693EA8FA0BDAF0AE6B55F52C27D0-swgC6WJTr6E3qekZfdyv35wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2014-12-01 10:42         ` Nicolas Dichtel
2014-11-27  9:06   ` Nicolas Dichtel
     [not found]     ` <5476E97D.5040304-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-12-02  2:19       ` [PATCH v2] " Takayuki Usui
     [not found]         ` <1417486763-12883-1-git-send-email-takayuki-SN072n759w5Wk0Htik3J/w@public.gmane.org>
2014-12-02  9:04           ` Nicolas Dichtel
     [not found]             ` <547D809E.8020607-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-12-03  1:37               ` [PATCH v3] " Takayuki Usui
     [not found]                 ` <1417570646-7724-1-git-send-email-takayuki-SN072n759w5Wk0Htik3J/w@public.gmane.org>
2014-12-03 10:51                   ` Nicolas Dichtel
     [not found]                     ` <547EEB31.4070900-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-12-03 14:01                       ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.