[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190828103718.GF2312@nanopsycho>
Date: Wed, 28 Aug 2019 12:37:18 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: David Ahern <dsahern@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
David Ahern <dsahern@...il.com>
Subject: Re: [PATCH net] netdevsim: Restore per-network namespace accounting
for fib entries
Tue, Aug 06, 2019 at 09:15:17PM CEST, dsahern@...nel.org wrote:
>From: David Ahern <dsahern@...il.com>
>
>Prior to the commit in the fixes tag, the resource controller in netdevsim
>tracked fib entries and rules per network namespace. Restore that behavior.
David, please help me understand. If the counters are per-device, not
per-netns, they are both the same. If we have device (devlink instance)
is in a netns and take only things happening in this netns into account,
it should count exactly the same amount of fib entries, doesn't it?
I re-thinked the devlink netns patchset and currently I'm going in
slightly different direction. I'm having netns as an attribute of
devlink reload. So all the port netdevices and everything gets
re-instantiated into new netns. Works fine with mlxsw. There we also
re-register the fib notifier.
I think that this can work for your usecase in netdevsim too:
1) devlink instance is registering a fib notifier to track all fib
entries in a namespace it belongs to. The counters are per-device -
counting fib entries in a namespace the device is in.
2) another devlink instance can do the same tracking in the same
namespace. No problem, it's a separate counter, but the numbers are
the same. One can set different limits to different devlink
instances, but you can have only one. That is the bahaviour you have
now.
3) on devlink reload, netdevsim re-instantiates ports and re-registers
fib notifier
4) on devlink reload with netns change, all should be fine as the
re-registered fib nofitier replays the entries. The ports are
re-instatiated in new netns.
This way, we would get consistent behaviour between netdevsim and real
devices (mlxsw), correct devlink-netns implementation (you also
suggested to move ports to the namespace). Everyone should be happy.
What do you think?
Powered by blists - more mailing lists