On Mon, 12 Aug 2019 18:24:41 -0600, David Ahern wrote: > On 8/12/19 7:47 AM, Jiri Pirko wrote: > > From: Jiri Pirko <j...@mellanox.com> > > > > Devlink from the beginning counts with network namespaces, but the > > instances has been fixed to init_net. The first patch allows user > > to move existing devlink instances into namespaces: > > > > $ devlink dev > > netdevsim/netdevsim1 > > $ ip netns add ns1 > > $ devlink dev set netdevsim/netdevsim1 netns ns1 > > $ devlink -N ns1 dev > > netdevsim/netdevsim1 > > > > The last patch allows user to create new netdevsim instance directly > > inside network namespace of a caller. > > The namespace behavior seems odd to me. If devlink instance is created > in a namespace and never moved, it should die with the namespace. With > this patch set, devlink instance and its ports are moved to init_net on > namespace delete.
If the devlink instance just disappeared - that'd be a very very strange thing. Only software objects disappear with the namespace. Netdevices without ->rtnl_link_ops go back to init_net.