From: Jiri Pirko <j...@resnulli.us> Date: Thu, 3 Oct 2019 11:49:25 +0200
> Devlink from the beginning counts with network namespaces, but the > instances has been fixed to init_net. > > Implement change of network namespace as part of "devlink reload" > procedure like this: > > $ ip netns add testns1 > $ devlink/devlink dev reload netdevsim/netdevsim10 netns testns1 > > This command reloads device "netdevsim10" into network > namespace "testns1". > > Note that "devlink reload" reinstantiates driver objects, effectively it > reloads the driver instance, including possible hw reset etc. Newly > created netdevices respect the network namespace of the parent devlink > instance and according to that, they are created in target network > namespace. > > Driver is able to refuse to be reloaded into different namespace. That > is the case of mlx4 right now. > > FIB entries and rules are replayed during FIB notifier registration > which is triggered during reload (driver instance init). FIB notifier > is also registered to the target network namespace, that allows user > to use netdevsim devlink resources to setup per-namespace limits of FIB > entries and FIB rules. In fact, with multiple netdevsim instances > in each network namespace, user might setup different limits. > This maintains and extends current netdevsim resources behaviour. ... Series applied, thanks Jiri.