On Tue, Aug 06, 2019 at 11:38:32AM -0600, David Ahern wrote: > On 8/6/19 10:40 AM, Jiri Pirko wrote: > > Hi all. > > > > I just discussed this with DavidA and I would like to bring this to > > broader audience. David wants to limit kernel resources in network > > namespaces, for example fibs, fib rules, etc. > > > > He claims that devlink api is rich enough to program this limitations > > as it already does for mlxsw hw resources for example. If we have this > > api for hardware, why don't to reuse it for the kernel and it's > > resources too? > > The analogy is that a kernel is 'programmed' just like hardware, it has > resources just like hardware (e.g., memory) and those resources are > limited as well. So the resources consumed by fib entries, rules, > nexthops, etc should be controllable.
I expect one question that will come up is why not control groups. That is often used by the rest of the kernel for resource control. But cgroups are mostly about limiting resources for a collection of processes. I don't think that is true for networking resources. The resources we are talking about are orthogonal to processes. Or are there any resources which should be linked to processes? eBPF resources? > > So the proposal is to have some new device, say "kernelnet", that would > > implicitly create per-namespace devlink instance. Maybe kernelns, to make it clear we are talking about namespace resources. Going back to cgroups concept. They are generally hierarchical. Do we need any sort of hierarchy here? Are there some resources we want to set a global limit on, and then a per namespace limit on top of that? We would then need two names, and kernelnet sounds more like the global level? Andrew