From: Serhey Popovych <serhe.popov...@gmail.com> Date: Fri, 16 Jun 2017 19:39:34 +0300
> While making dev_new_index() return zero on overrun prevents > from infinite loop, there is no way to recovery mechanisms > since namespace ifindex only increases and never reused > from released network devices. > > To address this we introduce dev_free_index() helper which > is used to reclaim released network device index when it is > smaller than last allocated index in namespace. > > This also has positive side effect for equal distribution > of network devices per buckets in index hash table. That > positively affects performance of dev_get_by_index() family. > > Signed-off-by: Serhey Popovych <serhe.popov...@gmail.com> You haven't explained why the current behavior is undesirable, and why we want reuse. I don't think we want at all for anything to rely on ifindexes being allocated one way or another. Yes, I understand that hash table argument, but that can be solved other ways. And what you're talking about is more of an error case not a normal case.